[llvm] r189632 - Random cleanup: No need to use a std::vector here, since createInternalizePass uses an ArrayRef.

Bill Wendling isanbard at gmail.com
Thu Aug 29 17:48:37 PDT 2013


Author: void
Date: Thu Aug 29 19:48:37 2013
New Revision: 189632

URL: http://llvm.org/viewvc/llvm-project?rev=189632&view=rev
Log:
Random cleanup: No need to use a std::vector here, since createInternalizePass uses an ArrayRef.

Modified:
    llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp

Modified: llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp?rev=189632&r1=189631&r2=189632&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp Thu Aug 29 19:48:37 2013
@@ -276,11 +276,8 @@ void PassManagerBuilder::populateLTOPass
   // Now that composite has been compiled, scan through the module, looking
   // for a main function.  If main is defined, mark all other functions
   // internal.
-  if (Internalize) {
-    std::vector<const char*> E;
-    E.push_back("main");
-    PM.add(createInternalizePass(E));
-  }
+  if (Internalize)
+    PM.add(createInternalizePass("main"));
 
   // Propagate constants at call sites into the functions they call.  This
   // opens opportunities for globalopt (and inlining) by substituting function
@@ -321,6 +318,7 @@ void PassManagerBuilder::populateLTOPass
   // The IPO passes may leave cruft around.  Clean up after them.
   PM.add(createInstructionCombiningPass());
   PM.add(createJumpThreadingPass());
+
   // Break up allocas
   if (UseNewSROA)
     PM.add(createSROAPass());
@@ -334,6 +332,7 @@ void PassManagerBuilder::populateLTOPass
   PM.add(createLICMPass());                 // Hoist loop invariants.
   PM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies.
   PM.add(createMemCpyOptPass());            // Remove dead memcpys.
+
   // Nuke dead stores.
   PM.add(createDeadStoreEliminationPass());
 





More information about the llvm-commits mailing list