From fbcd54f2cbf89bd277a0531711cdc0e7cb1f15a3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 18 Oct 2005 06:29:43 +0000 Subject: [PATCH] Fix PR637 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23784 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/gccld/GenerateCode.cpp | 10 ++++------ tools/llvm-ld/Optimize.cpp | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/tools/gccld/GenerateCode.cpp b/tools/gccld/GenerateCode.cpp index 72a159a1de1..0d945493704 100644 --- a/tools/gccld/GenerateCode.cpp +++ b/tools/gccld/GenerateCode.cpp @@ -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()); diff --git a/tools/llvm-ld/Optimize.cpp b/tools/llvm-ld/Optimize.cpp index 1961a95ef53..69ef608ee6b 100644 --- a/tools/llvm-ld/Optimize.cpp +++ b/tools/llvm-ld/Optimize.cpp @@ -111,12 +111,10 @@ void Optimize(Module* M) { addPass(Passes, createFunctionResolvingPass()); if (!DisableOptimizations) { - if (!DisableInternalize) { - // 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(!DisableInternalize)); // Now that we internalized some globals, see if we can hack on them! addPass(Passes, createGlobalOptimizerPass()); -- 2.34.1