aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/Interpreter/Execution.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-05-02 19:28:45 +0000
committerChris Lattner <sabre@nondot.org>2002-05-02 19:28:45 +0000
commitf4dca807d8c337154afc6cc1aa194a607df89494 (patch)
tree6aa78598b83bb3197cb19d3355a1b7caea1b0945 /lib/ExecutionEngine/Interpreter/Execution.cpp
parent9705a15b1a8f09cd08236ed8fbfe287b9aeedf86 (diff)
Implement cast operations on booleans to allow casting bools to ints, f.e.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2437 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index fa61298762..6254293ad7 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -682,7 +682,7 @@ void Interpreter::executeRetInst(ReturnInst *I, ExecutionContext &SF) {
}
if (RetTy->isIntegral())
- ExitCode = Result.SByteVal; // Capture the exit code of the program
+ ExitCode = Result.IntVal; // Capture the exit code of the program
} else {
ExitCode = 0;
}
@@ -963,6 +963,7 @@ static void executeShrInst(ShiftInst *I, ExecutionContext &SF) {
#define IMPLEMENT_CAST_CASE_START(DESTTY, DESTCTY) \
case Type::DESTTY##TyID: \
switch (SrcTy->getPrimitiveID()) { \
+ IMPLEMENT_CAST(DESTTY, DESTCTY, Bool); \
IMPLEMENT_CAST(DESTTY, DESTCTY, UByte); \
IMPLEMENT_CAST(DESTTY, DESTCTY, SByte); \
IMPLEMENT_CAST(DESTTY, DESTCTY, UShort); \