diff options
author | Chris Lattner <sabre@nondot.org> | 2004-12-12 07:53:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-12-12 07:53:51 +0000 |
commit | bcfe1e2d64f1b064ea0a7f27a3d3e6d271e5e778 (patch) | |
tree | 8eaeefcda9f6dc21477647d75d2923d87e93b882 /tools/gccld/gccld.cpp | |
parent | 326f378a8fb9e81bf41804a5a66bfdb5f76b67f3 (diff) |
Do not internalize a module if -link-as-library is passed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18825 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gccld/gccld.cpp')
-rw-r--r-- | tools/gccld/gccld.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/gccld/gccld.cpp b/tools/gccld/gccld.cpp index d06eb6ec05..9e344a61e2 100644 --- a/tools/gccld/gccld.cpp +++ b/tools/gccld/gccld.cpp @@ -212,9 +212,16 @@ int main(int argc, char **argv, char **envp) { // SIGINT signal. sys::RemoveFileOnSignal(sys::Path(RealBytecodeOutput)); - // Generate the bytecode file. + // Strip everything if Strip is set, otherwise if stripdebug is set, just + // strip debug info. int StripLevel = Strip ? 2 : (StripDebug ? 1 : 0); - if (GenerateBytecode(Composite.get(), StripLevel, !NoInternalize, &Out)) { + + // Internalize the module if neither -disable-internalize nor + // -link-as-library are passed in. + bool ShouldInternalize = !NoInternalize & !LinkAsLibrary; + + // Generate the bytecode file. + if (GenerateBytecode(Composite.get(), StripLevel, ShouldInternalize, &Out)){ Out.close(); return PrintAndReturn(argv[0], "error generating bytecode"); } |