summaryrefslogtreecommitdiffstats
path: root/llvm/tools/gccld/GenerateCode.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-11-16 18:59:20 +0000
committerChris Lattner <sabre@nondot.org>2004-11-16 18:59:20 +0000
commit05fe0244e119a22f97d14ae2c8ffd46ea7cabc20 (patch)
tree38929e98fea9b32ddcb2a414c11add1e8dcc3800 /llvm/tools/gccld/GenerateCode.cpp
parent2004d90f97c47cbf8d0260b582185fcad07e685f (diff)
downloadbcm5719-llvm-05fe0244e119a22f97d14ae2c8ffd46ea7cabc20.tar.gz
bcm5719-llvm-05fe0244e119a22f97d14ae2c8ffd46ea7cabc20.zip
Even with -disable-opt we should still internalize and strip if requested.
llvm-svn: 17903
Diffstat (limited to 'llvm/tools/gccld/GenerateCode.cpp')
-rw-r--r--llvm/tools/gccld/GenerateCode.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/llvm/tools/gccld/GenerateCode.cpp b/llvm/tools/gccld/GenerateCode.cpp
index df347007257..e604921a90c 100644
--- a/llvm/tools/gccld/GenerateCode.cpp
+++ b/llvm/tools/gccld/GenerateCode.cpp
@@ -153,14 +153,14 @@ int llvm::GenerateBytecode(Module *M, bool Strip, bool Internalize,
// 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 @@ int llvm::GenerateBytecode(Module *M, bool Strip, bool Internalize,
// 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 @@ int llvm::GenerateBytecode(Module *M, bool Strip, bool Internalize,
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());
OpenPOWER on IntegriCloud