summaryrefslogtreecommitdiffstats
path: root/llvm/tools/gccld/gccld.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-12-12 07:53:51 +0000
committerChris Lattner <sabre@nondot.org>2004-12-12 07:53:51 +0000
commitb92fd6006c9d05b6c743cf51aade219a5a5601d2 (patch)
tree823a46f503c43f049c29cfd6c4e0788df6e1ef5a /llvm/tools/gccld/gccld.cpp
parented9346820d5136e9f4dc1720441957a4dbeda873 (diff)
downloadbcm5719-llvm-b92fd6006c9d05b6c743cf51aade219a5a5601d2.tar.gz
bcm5719-llvm-b92fd6006c9d05b6c743cf51aade219a5a5601d2.zip
Do not internalize a module if -link-as-library is passed.
llvm-svn: 18825
Diffstat (limited to 'llvm/tools/gccld/gccld.cpp')
-rw-r--r--llvm/tools/gccld/gccld.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/tools/gccld/gccld.cpp b/llvm/tools/gccld/gccld.cpp
index d06eb6ec05f..9e344a61e23 100644
--- a/llvm/tools/gccld/gccld.cpp
+++ b/llvm/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");
}
OpenPOWER on IntegriCloud