aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/Interpreter
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ExecutionEngine/Interpreter')
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp57
-rw-r--r--lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp14
2 files changed, 35 insertions, 36 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 964435d380..f7400e9ac9 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -188,7 +188,7 @@ GenericValue Interpreter::getConstantExprValue (ConstantExpr *CE,
getOperandValue(CE->getOperand(1), SF),
getOperandValue(CE->getOperand(2), SF));
default:
- llvm_cerr << "Unhandled ConstantExpr: " << *CE << "\n";
+ cerr << "Unhandled ConstantExpr: " << *CE << "\n";
abort();
return GenericValue();
}
@@ -236,7 +236,7 @@ static GenericValue executeAddInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_BINARY_OPERATOR(+, Float);
IMPLEMENT_BINARY_OPERATOR(+, Double);
default:
- llvm_cerr << "Unhandled type for Add instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for Add instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -257,7 +257,7 @@ static GenericValue executeSubInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_BINARY_OPERATOR(-, Float);
IMPLEMENT_BINARY_OPERATOR(-, Double);
default:
- llvm_cerr << "Unhandled type for Sub instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for Sub instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -278,7 +278,7 @@ static GenericValue executeMulInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_BINARY_OPERATOR(*, Float);
IMPLEMENT_BINARY_OPERATOR(*, Double);
default:
- llvm_cerr << "Unhandled type for Mul instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for Mul instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -296,7 +296,7 @@ static GenericValue executeUDivInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_SIGNLESS_BINOP(/, UInt, Int);
IMPLEMENT_SIGNLESS_BINOP(/, ULong, Long);
default:
- llvm_cerr << "Unhandled type for UDiv instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for UDiv instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -311,7 +311,7 @@ static GenericValue executeSDivInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_SIGNLESS_BINOP(/, Int, UInt);
IMPLEMENT_SIGNLESS_BINOP(/, Long, ULong);
default:
- llvm_cerr << "Unhandled type for SDiv instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for SDiv instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -324,7 +324,7 @@ static GenericValue executeFDivInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_BINARY_OPERATOR(/, Float);
IMPLEMENT_BINARY_OPERATOR(/, Double);
default:
- llvm_cerr << "Unhandled type for Div instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for Div instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -339,7 +339,7 @@ static GenericValue executeURemInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_SIGNLESS_BINOP(%, UInt, Int);
IMPLEMENT_SIGNLESS_BINOP(%, ULong, Long);
default:
- llvm_cerr << "Unhandled type for URem instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for URem instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -354,7 +354,7 @@ static GenericValue executeSRemInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_SIGNLESS_BINOP(%, Int, UInt);
IMPLEMENT_SIGNLESS_BINOP(%, Long, ULong);
default:
- llvm_cerr << "Unhandled type for Rem instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for Rem instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -371,7 +371,7 @@ static GenericValue executeFRemInst(GenericValue Src1, GenericValue Src2,
Dest.DoubleVal = fmod(Src1.DoubleVal, Src2.DoubleVal);
break;
default:
- llvm_cerr << "Unhandled type for Rem instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for Rem instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -391,7 +391,7 @@ static GenericValue executeAndInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_BINARY_OPERATOR(&, ULong);
IMPLEMENT_BINARY_OPERATOR(&, Long);
default:
- llvm_cerr << "Unhandled type for And instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for And instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -411,7 +411,7 @@ static GenericValue executeOrInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_BINARY_OPERATOR(|, ULong);
IMPLEMENT_BINARY_OPERATOR(|, Long);
default:
- llvm_cerr << "Unhandled type for Or instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for Or instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -431,7 +431,7 @@ static GenericValue executeXorInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_BINARY_OPERATOR(^, ULong);
IMPLEMENT_BINARY_OPERATOR(^, Long);
default:
- llvm_cerr << "Unhandled type for Xor instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for Xor instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -465,7 +465,7 @@ static GenericValue executeSetEQInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_SETCC(==, Double);
IMPLEMENT_POINTERSETCC(==);
default:
- llvm_cerr << "Unhandled type for SetEQ instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for SetEQ instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -488,7 +488,7 @@ static GenericValue executeSetNEInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_POINTERSETCC(!=);
default:
- llvm_cerr << "Unhandled type for SetNE instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for SetNE instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -510,7 +510,7 @@ static GenericValue executeSetLEInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_SETCC(<=, Double);
IMPLEMENT_POINTERSETCC(<=);
default:
- llvm_cerr << "Unhandled type for SetLE instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for SetLE instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -532,7 +532,7 @@ static GenericValue executeSetGEInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_SETCC(>=, Double);
IMPLEMENT_POINTERSETCC(>=);
default:
- llvm_cerr << "Unhandled type for SetGE instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for SetGE instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -554,7 +554,7 @@ static GenericValue executeSetLTInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_SETCC(<, Double);
IMPLEMENT_POINTERSETCC(<);
default:
- llvm_cerr << "Unhandled type for SetLT instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for SetLT instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -576,7 +576,7 @@ static GenericValue executeSetGTInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_SETCC(>, Double);
IMPLEMENT_POINTERSETCC(>);
default:
- llvm_cerr << "Unhandled type for SetGT instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for SetGT instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -609,7 +609,7 @@ void Interpreter::visitBinaryOperator(BinaryOperator &I) {
case Instruction::SetLT: R = executeSetLTInst(Src1, Src2, Ty); break;
case Instruction::SetGT: R = executeSetGTInst(Src1, Src2, Ty); break;
default:
- llvm_cerr << "Don't know how to handle this binary operator!\n-->" << I;
+ cerr << "Don't know how to handle this binary operator!\n-->" << I;
abort();
}
@@ -710,7 +710,7 @@ void Interpreter::visitUnwindInst(UnwindInst &I) {
}
void Interpreter::visitUnreachableInst(UnreachableInst &I) {
- llvm_cerr << "ERROR: Program executed an 'unreachable' instruction!\n";
+ cerr << "ERROR: Program executed an 'unreachable' instruction!\n";
abort();
}
@@ -978,7 +978,7 @@ static GenericValue executeShlInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_SHIFT(<<, ULong);
IMPLEMENT_SHIFT(<<, Long);
default:
- llvm_cerr << "Unhandled type for Shl instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for Shl instruction: " << *Ty << "\n";
}
return Dest;
}
@@ -992,7 +992,7 @@ static GenericValue executeLShrInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_SIGNLESS_SHIFT(>>, UInt, Int);
IMPLEMENT_SIGNLESS_SHIFT(>>, ULong, Long);
default:
- llvm_cerr << "Unhandled type for LShr instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for LShr instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -1007,7 +1007,7 @@ static GenericValue executeAShrInst(GenericValue Src1, GenericValue Src2,
IMPLEMENT_SIGNLESS_SHIFT(>>, Int, UInt);
IMPLEMENT_SIGNLESS_SHIFT(>>, Long, ULong);
default:
- llvm_cerr << "Unhandled type for AShr instruction: " << *Ty << "\n";
+ cerr << "Unhandled type for AShr instruction: " << *Ty << "\n";
abort();
}
return Dest;
@@ -1065,14 +1065,14 @@ void Interpreter::visitAShr(ShiftInst &I) {
IMPLEMENT_CAST(DESTTY, DESTCTY, Float); \
IMPLEMENT_CAST(DESTTY, DESTCTY, Double) \
default: \
- llvm_cerr << "Unhandled cast: " \
+ cerr << "Unhandled cast: " \
<< *SrcTy << " to " << *DstTy << "\n"; \
abort(); \
} \
break
#define IMPLEMENT_CAST_END \
- default: llvm_cerr \
+ default: cerr \
<< "Unhandled dest type for cast instruction: " \
<< *DstTy << "\n"; \
abort(); \
@@ -1226,8 +1226,7 @@ GenericValue Interpreter::executeCastOperation(Instruction::CastOps opcode,
IMPLEMENT_CAST_END
break;
default:
- llvm_cerr
- << "Invalid cast opcode for cast instruction: " << opcode << "\n";
+ cerr << "Invalid cast opcode for cast instruction: " << opcode << "\n";
abort();
}
return Dest;
@@ -1266,7 +1265,7 @@ void Interpreter::visitVAArgInst(VAArgInst &I) {
IMPLEMENT_VAARG(Double);
IMPLEMENT_VAARG(Bool);
default:
- llvm_cerr << "Unhandled dest type for vaarg instruction: " << *Ty << "\n";
+ cerr << "Unhandled dest type for vaarg instruction: " << *Ty << "\n";
abort();
}
diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
index 161873c2c8..a1c43175da 100644
--- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
+++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
@@ -93,8 +93,8 @@ GenericValue Interpreter::callExternalFunction(Function *F,
std::map<const Function *, ExFunc>::iterator FI = Functions.find(F);
ExFunc Fn = (FI == Functions.end()) ? lookupFunction(F) : FI->second;
if (Fn == 0) {
- llvm_cerr << "Tried to execute an unknown external function: "
- << F->getType()->getDescription() << " " << F->getName() << "\n";
+ cerr << "Tried to execute an unknown external function: "
+ << F->getType()->getDescription() << " " << F->getName() << "\n";
if (F->getName() == "__main")
return GenericValue();
abort();
@@ -114,19 +114,19 @@ extern "C" { // Don't add C++ manglings to llvm mangling :)
// void putchar(sbyte)
GenericValue lle_Vb_putchar(FunctionType *M, const vector<GenericValue> &Args) {
- llvm_cout << Args[0].SByteVal;
+ cout << Args[0].SByteVal;
return GenericValue();
}
// int putchar(int)
GenericValue lle_ii_putchar(FunctionType *M, const vector<GenericValue> &Args) {
- llvm_cout << ((char)Args[0].IntVal) << std::flush;
+ cout << ((char)Args[0].IntVal) << std::flush;
return Args[0];
}
// void putchar(ubyte)
GenericValue lle_VB_putchar(FunctionType *M, const vector<GenericValue> &Args) {
- llvm_cout << Args[0].SByteVal << std::flush;
+ cout << Args[0].SByteVal << std::flush;
return Args[0];
}
@@ -332,7 +332,7 @@ GenericValue lle_X_sprintf(FunctionType *M, const vector<GenericValue> &Args) {
sprintf(Buffer, FmtBuf, (void*)GVTOP(Args[ArgNo++])); break;
case 's':
sprintf(Buffer, FmtBuf, (char*)GVTOP(Args[ArgNo++])); break;
- default: llvm_cerr << "<unknown printf code '" << *FmtStr << "'!>";
+ default: cerr << "<unknown printf code '" << *FmtStr << "'!>";
ArgNo++; break;
}
strcpy(OutputBuffer, Buffer);
@@ -350,7 +350,7 @@ GenericValue lle_X_printf(FunctionType *M, const vector<GenericValue> &Args) {
NewArgs.push_back(PTOGV(Buffer));
NewArgs.insert(NewArgs.end(), Args.begin(), Args.end());
GenericValue GV = lle_X_sprintf(M, NewArgs);
- llvm_cout << Buffer;
+ cout << Buffer;
return GV;
}