diff options
author | Chris Lattner <sabre@nondot.org> | 2001-10-27 04:15:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-10-27 04:15:57 +0000 |
commit | 15157b88e9628f962bb2d1d768ef02f0dc8672d1 (patch) | |
tree | 3cd99efb2c6021c5fecfdc8cffb24a04298aa6bc /llvm/lib/ExecutionEngine/Interpreter/Execution.cpp | |
parent | 0863c161e9431eec93c6c6e318748019dfb4fed2 (diff) | |
download | bcm5719-llvm-15157b88e9628f962bb2d1d768ef02f0dc8672d1.tar.gz bcm5719-llvm-15157b88e9628f962bb2d1d768ef02f0dc8672d1.zip |
* Implement exit() builtin function
* Implement linked in runtime library with puts(char*) in it
* implement builtin putchar(int) function
llvm-svn: 985
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/Interpreter/Execution.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp index b8cb4909342..9ad5abab2d9 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -419,6 +419,15 @@ static void executeBinaryInst(BinaryOperator *I, ExecutionContext &SF) { // Terminator Instruction Implementations //===----------------------------------------------------------------------===// +void Interpreter::exitCalled(GenericValue GV) { + cout << "Program returned "; + print(Type::IntTy, GV); + cout << " via 'void exit(int)'\n"; + + ExitCode = GV.SByteVal; + ECStack.clear(); +} + void Interpreter::executeRetInst(ReturnInst *I, ExecutionContext &SF) { const Type *RetTy = 0; GenericValue Result; |