aboutsummaryrefslogtreecommitdiffstats
path: root/projects
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-08-24 22:52:01 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-08-24 22:52:01 +0000
commitbef77ec085fc507bb2bf6c3c4584717ae659e354 (patch)
treebda4e917da56c6a05fb7b7d31d9c28ea5524d8c1 /projects
parent95e4cceaff6caa1588a0ad36ad40d1209182fd01 (diff)
downloadexternal_llvm-bef77ec085fc507bb2bf6c3c4584717ae659e354.zip
external_llvm-bef77ec085fc507bb2bf6c3c4584717ae659e354.tar.gz
external_llvm-bef77ec085fc507bb2bf6c3c4584717ae659e354.tar.bz2
Add dependent library support for Stacker. It now inserts "stkr_runtime" as
a dependent library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'projects')
-rw-r--r--projects/Stacker/lib/compiler/StackerCompiler.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/projects/Stacker/lib/compiler/StackerCompiler.cpp b/projects/Stacker/lib/compiler/StackerCompiler.cpp
index 1ca88da..15bf13e 100644
--- a/projects/Stacker/lib/compiler/StackerCompiler.cpp
+++ b/projects/Stacker/lib/compiler/StackerCompiler.cpp
@@ -114,6 +114,9 @@ StackerCompiler::compile(
// Create the module we'll return
TheModule = new Module( CurFilename );
+ // Tell the module about our runtime library
+ TheModule->addLibrary("stkr_runtime");
+
// Create a type to represent the stack. This is the same as the LLVM
// Assembly type [ 256 x long ]
stack_type = ArrayType::get( Type::LongTy, stack_size );
@@ -245,12 +248,13 @@ StackerCompiler::compile(
TheInstance = this;
// Parse the file. The parser (see StackParser.y) will call back to
- // the StackCompiler via the "handle*" methods
+ // the StackerCompiler via the "handle*" methods
Stackerparse();
// Avoid potential illegal use (TheInstance might be on the stack)
TheInstance = 0;
+
} catch (...) {
if (F != stdin) fclose(F); // Make sure to close file descriptor
throw; // if an exception is thrown