-disable-opt is not -O0, it's okay for it to disable internalize.
authorChris Lattner <sabre@nondot.org>
Wed, 17 Nov 2004 16:41:19 +0000 (16:41 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 17 Nov 2004 16:41:19 +0000 (16:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17911 91177308-0d34-0410-b5e6-96231b3b80d8

tools/gccld/GenerateCode.cpp
tools/gccld/gccld.cpp

index e604921a90c0d11ea08ec5c55b0692a351a4985e..f22319df5bf9d3347301e93502635946d8bb5062 100644 (file)
@@ -153,14 +153,14 @@ int llvm::GenerateBytecode(Module *M, bool Strip, bool Internalize,
   // arguments).  This pass merges the two functions.
   addPass(Passes, createFunctionResolvingPass());
 
-  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) {
+    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());
+    }
+
     // Now that we internalized some globals, see if we can hack on them!
     addPass(Passes, createGlobalOptimizerPass());
 
index 87b1d6fa3e472438f0aceb04a6034c21f05bf726..5a19866bca4d73837368de9dc5cbb83ab731dd2b 100644 (file)
@@ -163,7 +163,8 @@ int main(int argc, char **argv, char **envp) {
     std::string ModuleID("gccld-output");
     std::auto_ptr<Module> Composite(new Module(ModuleID));
 
-    // We always look first in the current directory when searching for libraries.
+    // We always look first in the current directory when searching for
+    // libraries.
     LibPaths.insert(LibPaths.begin(), ".");
 
     // If the user specified an extra search path in their environment, respect