[llvm-commits] CVS: llvm/tools/gccld/GenerateCode.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Nov 16 10:59:34 PST 2004



Changes in directory llvm/tools/gccld:

GenerateCode.cpp updated: 1.35 -> 1.36
---
Log message:

Even with -disable-opt we should still internalize and strip if requested.


---
Diffs of the changes:  (+13 -13)

Index: llvm/tools/gccld/GenerateCode.cpp
diff -u llvm/tools/gccld/GenerateCode.cpp:1.35 llvm/tools/gccld/GenerateCode.cpp:1.36
--- llvm/tools/gccld/GenerateCode.cpp:1.35	Sun Nov 14 17:00:08 2004
+++ llvm/tools/gccld/GenerateCode.cpp	Tue Nov 16 12:59:20 2004
@@ -153,14 +153,14 @@
   // arguments).  This pass merges the two functions.
   addPass(Passes, createFunctionResolvingPass());
 
-  if (!DisableOptimizations) {
-    if (Internalize) {
-      // Now that composite has been compiled, scan through the module, looking
-      // for a main function.  If main is defined, mark all other functions
-      // internal.
-      addPass(Passes, createInternalizePass());
-    }
+  if (Internalize) {
+    // Now that composite has been compiled, scan through the module, looking
+    // for a main function.  If main is defined, mark all other functions
+    // internal.
+    addPass(Passes, createInternalizePass());
+  }
 
+  if (!DisableOptimizations) {
     // Now that we internalized some globals, see if we can hack on them!
     addPass(Passes, createGlobalOptimizerPass());
 
@@ -168,12 +168,6 @@
     // keep one copy of each constant...
     addPass(Passes, createConstantMergePass());
 
-    // If the -s command line option was specified, strip the symbols out of the
-    // resulting program to make it smaller.  -s is a GCC option that we are
-    // supporting.
-    if (Strip)
-      addPass(Passes, createSymbolStrippingPass());
-
     // Propagate constants at call sites into the functions they call.
     addPass(Passes, createIPConstantPropagationPass());
 
@@ -214,6 +208,12 @@
     addPass(Passes, createGlobalDCEPass());
   }
 
+  // If the -s command line option was specified, strip the symbols out of the
+  // resulting program to make it smaller.  -s is a GCC option that we are
+  // supporting.
+  if (Strip)
+    addPass(Passes, createSymbolStrippingPass());
+
   // Make sure everything is still good.
   Passes.add(createVerifierPass());
 






More information about the llvm-commits mailing list