summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit45243fa9b71d09484e8fb9f24728a1e5daaaad7d (patch)
treea108b4905e7f9c91288e0692391866693a8d2786 /llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
parent18489fb61ff315c4b3a0f8f39748296b6368d8da (diff)
downloadbcm5719-llvm-45243fa9b71d09484e8fb9f24728a1e5daaaad7d.tar.gz
bcm5719-llvm-45243fa9b71d09484e8fb9f24728a1e5daaaad7d.zip
Implement cast operations on booleans to allow casting bools to ints, f.e.
llvm-svn: 2437
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/Execution.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
index fa612987627..6254293ad7f 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/llvm/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); \
OpenPOWER on IntegriCloud