From: Duncan P. N. Exon Smith Date: Thu, 20 Mar 2014 22:49:50 +0000 (+0000) Subject: PGO: Rename FuncLinkage to VarLinkage; no functionality change X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eddc01635b67d2310e030631b6bc4e84820964d8;p=clang PGO: Rename FuncLinkage to VarLinkage; no functionality change The variable is used to set the linkage for variables, and will become different from function linkage in a follow-up commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204407 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenPGO.cpp b/lib/CodeGen/CodeGenPGO.cpp index 2dbe88cb27..0dfecfc36c 100644 --- a/lib/CodeGen/CodeGenPGO.cpp +++ b/lib/CodeGen/CodeGenPGO.cpp @@ -238,7 +238,7 @@ llvm::GlobalVariable *CodeGenPGO::buildDataVar() { auto *VarName = llvm::ConstantDataArray::getString(Ctx, getFuncName(), false); auto *Name = new llvm::GlobalVariable(CGM.getModule(), VarName->getType(), - true, FuncLinkage, VarName, + true, VarLinkage, VarName, getFuncVarName("name")); Name->setSection(getNameSection(CGM)); Name->setAlignment(1); @@ -260,7 +260,7 @@ llvm::GlobalVariable *CodeGenPGO::buildDataVar() { llvm::ConstantExpr::getBitCast(RegionCounters, Int64PtrTy) }; auto *Data = - new llvm::GlobalVariable(CGM.getModule(), DataTy, true, FuncLinkage, + new llvm::GlobalVariable(CGM.getModule(), DataTy, true, VarLinkage, llvm::ConstantStruct::get(DataTy, DataVals), getFuncVarName("data")); @@ -824,7 +824,7 @@ void CodeGenPGO::assignRegionCounters(const Decl *D, llvm::Function *Fn) { if (!D) return; setFuncName(Fn); - FuncLinkage = Fn->getLinkage(); + VarLinkage = Fn->getLinkage(); mapRegionCounters(D); if (InstrumentRegions) emitCounterVariables(); @@ -882,7 +882,7 @@ void CodeGenPGO::emitCounterVariables() { llvm::ArrayType *CounterTy = llvm::ArrayType::get(llvm::Type::getInt64Ty(Ctx), NumRegionCounters); RegionCounters = - new llvm::GlobalVariable(CGM.getModule(), CounterTy, false, FuncLinkage, + new llvm::GlobalVariable(CGM.getModule(), CounterTy, false, VarLinkage, llvm::Constant::getNullValue(CounterTy), getFuncVarName("counters")); RegionCounters->setAlignment(8); diff --git a/lib/CodeGen/CodeGenPGO.h b/lib/CodeGen/CodeGenPGO.h index d22486d372..2645537cba 100644 --- a/lib/CodeGen/CodeGenPGO.h +++ b/lib/CodeGen/CodeGenPGO.h @@ -55,7 +55,7 @@ private: CodeGenModule &CGM; std::string *PrefixedFuncName; StringRef RawFuncName; - llvm::GlobalValue::LinkageTypes FuncLinkage; + llvm::GlobalValue::LinkageTypes VarLinkage; unsigned NumRegionCounters; uint64_t FunctionHash;