r204407 - PGO: Rename FuncLinkage to VarLinkage; no functionality change

Duncan P. N. Exon Smith dexonsmith at apple.com
Thu Mar 20 15:49:51 PDT 2014


Author: dexonsmith
Date: Thu Mar 20 17:49:50 2014
New Revision: 204407

URL: http://llvm.org/viewvc/llvm-project?rev=204407&view=rev
Log:
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.

<rdar://problem/15943240>

Modified:
    cfe/trunk/lib/CodeGen/CodeGenPGO.cpp
    cfe/trunk/lib/CodeGen/CodeGenPGO.h

Modified: cfe/trunk/lib/CodeGen/CodeGenPGO.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenPGO.cpp?rev=204407&r1=204406&r2=204407&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenPGO.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenPGO.cpp Thu Mar 20 17:49:50 2014
@@ -238,7 +238,7 @@ llvm::GlobalVariable *CodeGenPGO::buildD
   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::buildD
     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(co
   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);

Modified: cfe/trunk/lib/CodeGen/CodeGenPGO.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenPGO.h?rev=204407&r1=204406&r2=204407&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenPGO.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenPGO.h Thu Mar 20 17:49:50 2014
@@ -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;





More information about the cfe-commits mailing list