]> granicus.if.org Git - clang/commitdiff
PGO: Rename FuncLinkage to VarLinkage; no functionality change
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 20 Mar 2014 22:49:50 +0000 (22:49 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 20 Mar 2014 22:49:50 +0000 (22:49 +0000)
The variable is used to set the linkage for variables, and will become
different from function linkage in a follow-up commit.

<rdar://problem/15943240>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204407 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenPGO.cpp
lib/CodeGen/CodeGenPGO.h

index 2dbe88cb277e640889633931718a543d515411ad..0dfecfc36cdfe54813483415e9f8a2893218f2d1 100644 (file)
@@ -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);
index d22486d372da75aa1fee99ea7eaaa5c95956815f..2645537cba62538cc141568a1a6c4830d3ac00d5 100644 (file)
@@ -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;