From eddc01635b67d2310e030631b6bc4e84820964d8 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Thu, 20 Mar 2014 22:49:50 +0000 Subject: [PATCH] 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 --- lib/CodeGen/CodeGenPGO.cpp | 8 ++++---- lib/CodeGen/CodeGenPGO.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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; -- 2.50.1