1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Implement cast operations on booleans to allow casting bools to ints, f.e.

llvm-svn: 2437
This commit is contained in:
Chris Lattner 2002-05-02 19:28:45 +00:00
parent 8f309d920f
commit dff0195064

View File

@ -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); \