Add dependent library support for Stacker. It now inserts "stkr_runtime" as

a dependent library.

llvm-svn: 16040
This commit is contained in:
Reid Spencer 2004-08-24 22:52:01 +00:00
parent db0bdd69f5
commit f20d76d71e
1 changed files with 5 additions and 1 deletions

View File

@ -114,6 +114,9 @@ StackerCompiler::compile(
// Create the module we'll return // Create the module we'll return
TheModule = new Module( CurFilename ); 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 // Create a type to represent the stack. This is the same as the LLVM
// Assembly type [ 256 x long ] // Assembly type [ 256 x long ]
stack_type = ArrayType::get( Type::LongTy, stack_size ); stack_type = ArrayType::get( Type::LongTy, stack_size );
@ -245,12 +248,13 @@ StackerCompiler::compile(
TheInstance = this; TheInstance = this;
// Parse the file. The parser (see StackParser.y) will call back to // 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(); Stackerparse();
// Avoid potential illegal use (TheInstance might be on the stack) // Avoid potential illegal use (TheInstance might be on the stack)
TheInstance = 0; TheInstance = 0;
} catch (...) { } catch (...) {
if (F != stdin) fclose(F); // Make sure to close file descriptor if (F != stdin) fclose(F); // Make sure to close file descriptor
throw; // if an exception is thrown throw; // if an exception is thrown