[llvm] r189982 - Rename some variables to match the style guide.

Rafael Espindola rafael.espindola at gmail.com
Wed Sep 4 13:08:46 PDT 2013


Author: rafael
Date: Wed Sep  4 15:08:46 2013
New Revision: 189982

URL: http://llvm.org/viewvc/llvm-project?rev=189982&view=rev
Log:
Rename some variables to match the style guide.

I am about to patch this code, and this makes the diff far more readable.

Modified:
    llvm/trunk/include/llvm/Transforms/IPO.h
    llvm/trunk/lib/Transforms/IPO/Internalize.cpp
    llvm/trunk/tools/lto/LTOCodeGenerator.cpp
    llvm/trunk/tools/lto/LTOCodeGenerator.h

Modified: llvm/trunk/include/llvm/Transforms/IPO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO.h?rev=189982&r1=189981&r2=189982&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/IPO.h (original)
+++ llvm/trunk/include/llvm/Transforms/IPO.h Wed Sep  4 15:08:46 2013
@@ -109,7 +109,7 @@ Pass *createPruneEHPass();
 ///
 /// Note that commandline options that are used with the above function are not
 /// used now!
-ModulePass *createInternalizePass(ArrayRef<const char *> exportList);
+ModulePass *createInternalizePass(ArrayRef<const char *> ExportList);
 /// createInternalizePass - Same as above, but with an empty exportList.
 ModulePass *createInternalizePass();
 

Modified: llvm/trunk/lib/Transforms/IPO/Internalize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Internalize.cpp?rev=189982&r1=189981&r2=189982&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Internalize.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Internalize.cpp Wed Sep  4 15:08:46 2013
@@ -50,7 +50,7 @@ namespace {
   public:
     static char ID; // Pass identification, replacement for typeid
     explicit InternalizePass();
-    explicit InternalizePass(ArrayRef<const char *> exportList);
+    explicit InternalizePass(ArrayRef<const char *> ExportList);
     void LoadFile(const char *Filename);
     virtual bool runOnModule(Module &M);
 
@@ -73,11 +73,11 @@ InternalizePass::InternalizePass()
   ExternalNames.insert(APIList.begin(), APIList.end());
 }
 
-InternalizePass::InternalizePass(ArrayRef<const char *> exportList)
+InternalizePass::InternalizePass(ArrayRef<const char *> ExportList)
   : ModulePass(ID){
   initializeInternalizePassPass(*PassRegistry::getPassRegistry());
-  for(ArrayRef<const char *>::const_iterator itr = exportList.begin();
-        itr != exportList.end(); itr++) {
+  for(ArrayRef<const char *>::const_iterator itr = ExportList.begin();
+        itr != ExportList.end(); itr++) {
     ExternalNames.insert(*itr);
   }
 }
@@ -210,6 +210,6 @@ ModulePass *llvm::createInternalizePass(
   return new InternalizePass();
 }
 
-ModulePass *llvm::createInternalizePass(ArrayRef<const char *> el) {
-  return new InternalizePass(el);
+ModulePass *llvm::createInternalizePass(ArrayRef<const char *> ExportList) {
+  return new InternalizePass(ExportList);
 }

Modified: llvm/trunk/tools/lto/LTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOCodeGenerator.cpp?rev=189982&r1=189981&r2=189982&view=diff
==============================================================================
--- llvm/trunk/tools/lto/LTOCodeGenerator.cpp (original)
+++ llvm/trunk/tools/lto/LTOCodeGenerator.cpp Wed Sep  4 15:08:46 2013
@@ -300,18 +300,18 @@ bool LTOCodeGenerator::determineTarget(s
 
 void LTOCodeGenerator::
 applyRestriction(GlobalValue &GV,
-                 std::vector<const char*> &mustPreserveList,
-                 SmallPtrSet<GlobalValue*, 8> &asmUsed,
-                 Mangler &mangler) {
+                 std::vector<const char*> &MustPreserveList,
+                 SmallPtrSet<GlobalValue*, 8> &AsmUsed,
+                 Mangler &Mangler) {
   SmallString<64> Buffer;
-  mangler.getNameWithPrefix(Buffer, &GV, false);
+  Mangler.getNameWithPrefix(Buffer, &GV, false);
 
   if (GV.isDeclaration())
     return;
   if (MustPreserveSymbols.count(Buffer))
-    mustPreserveList.push_back(GV.getName().data());
+    MustPreserveList.push_back(GV.getName().data());
   if (AsmUndefinedRefs.count(Buffer))
-    asmUsed.insert(&GV);
+    AsmUsed.insert(&GV);
 }
 
 static void findUsedValues(GlobalVariable *LLVMUsed,
@@ -337,31 +337,31 @@ void LTOCodeGenerator::applyScopeRestric
   // mark which symbols can not be internalized
   MCContext MContext(TargetMach->getMCAsmInfo(), TargetMach->getRegisterInfo(),
                      NULL);
-  Mangler mangler(MContext, TargetMach);
-  std::vector<const char*> mustPreserveList;
-  SmallPtrSet<GlobalValue*, 8> asmUsed;
+  Mangler Mangler(MContext, TargetMach);
+  std::vector<const char*> MustPreserveList;
+  SmallPtrSet<GlobalValue*, 8> AsmUsed;
 
   for (Module::iterator f = mergedModule->begin(),
          e = mergedModule->end(); f != e; ++f)
-    applyRestriction(*f, mustPreserveList, asmUsed, mangler);
+    applyRestriction(*f, MustPreserveList, AsmUsed, Mangler);
   for (Module::global_iterator v = mergedModule->global_begin(),
          e = mergedModule->global_end(); v !=  e; ++v)
-    applyRestriction(*v, mustPreserveList, asmUsed, mangler);
+    applyRestriction(*v, MustPreserveList, AsmUsed, Mangler);
   for (Module::alias_iterator a = mergedModule->alias_begin(),
          e = mergedModule->alias_end(); a != e; ++a)
-    applyRestriction(*a, mustPreserveList, asmUsed, mangler);
+    applyRestriction(*a, MustPreserveList, AsmUsed, Mangler);
 
   GlobalVariable *LLVMCompilerUsed =
     mergedModule->getGlobalVariable("llvm.compiler.used");
-  findUsedValues(LLVMCompilerUsed, asmUsed);
+  findUsedValues(LLVMCompilerUsed, AsmUsed);
   if (LLVMCompilerUsed)
     LLVMCompilerUsed->eraseFromParent();
 
-  if (!asmUsed.empty()) {
+  if (!AsmUsed.empty()) {
     llvm::Type *i8PTy = llvm::Type::getInt8PtrTy(Context);
     std::vector<Constant*> asmUsed2;
-    for (SmallPtrSet<GlobalValue*, 16>::const_iterator i = asmUsed.begin(),
-           e = asmUsed.end(); i !=e; ++i) {
+    for (SmallPtrSet<GlobalValue*, 16>::const_iterator i = AsmUsed.begin(),
+           e = AsmUsed.end(); i !=e; ++i) {
       GlobalValue *GV = *i;
       Constant *c = ConstantExpr::getBitCast(GV, i8PTy);
       asmUsed2.push_back(c);
@@ -377,7 +377,7 @@ void LTOCodeGenerator::applyScopeRestric
     LLVMCompilerUsed->setSection("llvm.metadata");
   }
 
-  passes.add(createInternalizePass(mustPreserveList));
+  passes.add(createInternalizePass(MustPreserveList));
 
   // apply scope restrictions
   passes.run(*mergedModule);

Modified: llvm/trunk/tools/lto/LTOCodeGenerator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOCodeGenerator.h?rev=189982&r1=189981&r2=189982&view=diff
==============================================================================
--- llvm/trunk/tools/lto/LTOCodeGenerator.h (original)
+++ llvm/trunk/tools/lto/LTOCodeGenerator.h Wed Sep  4 15:08:46 2013
@@ -106,9 +106,9 @@ private:
   bool generateObjectFile(llvm::raw_ostream &out, std::string &errMsg);
   void applyScopeRestrictions();
   void applyRestriction(llvm::GlobalValue &GV,
-                        std::vector<const char*> &mustPreserveList,
-                        llvm::SmallPtrSet<llvm::GlobalValue*, 8> &asmUsed,
-                        llvm::Mangler &mangler);
+                        std::vector<const char*> &MustPreserveList,
+                        llvm::SmallPtrSet<llvm::GlobalValue*, 8> &AsmUsed,
+                        llvm::Mangler &Mangler);
   bool determineTarget(std::string &errMsg);
 
   typedef llvm::StringMap<uint8_t> StringSet;





More information about the llvm-commits mailing list