Fix PR637
[oota-llvm.git] / tools / gccld / GenerateCode.cpp
index 72a159a1de19d84e34618846f77a2768709a52d2..0d9454937047fe4bbd5c5dd2493e7ad146ebd443 100644 (file)
@@ -216,12 +216,10 @@ int llvm::GenerateBytecode(Module *M, int StripLevel, bool Internalize,
   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());
-    }
+    // 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(Internalize));
 
     // Now that we internalized some globals, see if we can hack on them!
     addPass(Passes, createGlobalOptimizerPass());