aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2006-12-07 01:30:32 +0000
committerBill Wendling <isanbard@gmail.com>2006-12-07 01:30:32 +0000
commite81561909d128c6e2d8033cb5465a49b2596b26a (patch)
tree6f2845604d482bc86d8d12aae500292c561d8cd7 /lib/ExecutionEngine
parent85c671b90870705ba7e10baf99aa306c843f1325 (diff)
downloadexternal_llvm-e81561909d128c6e2d8033cb5465a49b2596b26a.zip
external_llvm-e81561909d128c6e2d8033cb5465a49b2596b26a.tar.gz
external_llvm-e81561909d128c6e2d8033cb5465a49b2596b26a.tar.bz2
Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp18
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp57
-rw-r--r--lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp14
3 files changed, 44 insertions, 45 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index ff312f0..8aaf0ed 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -402,7 +402,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
default:
break;
}
- llvm_cerr << "ConstantExpr not handled as global var init: " << *CE << "\n";
+ cerr << "ConstantExpr not handled as global var init: " << *CE << "\n";
abort();
}
@@ -432,7 +432,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
assert(0 && "Unknown constant pointer type!");
break;
default:
- llvm_cerr << "ERROR: Constant unimp for type: " << *C->getType() << "\n";
+ cerr << "ERROR: Constant unimp for type: " << *C->getType() << "\n";
abort();
}
return Result;
@@ -477,7 +477,7 @@ void ExecutionEngine::StoreValueToMemory(GenericValue Val, GenericValue *Ptr,
Ptr->Untyped[7] = (unsigned char)(Val.ULongVal >> 56);
break;
default:
- llvm_cerr << "Cannot store value of type " << *Ty << "!\n";
+ cerr << "Cannot store value of type " << *Ty << "!\n";
}
} else {
switch (Ty->getTypeID()) {
@@ -511,7 +511,7 @@ void ExecutionEngine::StoreValueToMemory(GenericValue Val, GenericValue *Ptr,
Ptr->Untyped[0] = (unsigned char)(Val.ULongVal >> 56);
break;
default:
- llvm_cerr << "Cannot store value of type " << *Ty << "!\n";
+ cerr << "Cannot store value of type " << *Ty << "!\n";
}
}
}
@@ -552,7 +552,7 @@ GenericValue ExecutionEngine::LoadValueFromMemory(GenericValue *Ptr,
((uint64_t)Ptr->Untyped[7] << 56);
break;
default:
- llvm_cerr << "Cannot load value of type " << *Ty << "!\n";
+ cerr << "Cannot load value of type " << *Ty << "!\n";
abort();
}
} else {
@@ -586,7 +586,7 @@ GenericValue ExecutionEngine::LoadValueFromMemory(GenericValue *Ptr,
((uint64_t)Ptr->Untyped[0] << 56);
break;
default:
- llvm_cerr << "Cannot load value of type " << *Ty << "!\n";
+ cerr << "Cannot load value of type " << *Ty << "!\n";
abort();
}
}
@@ -634,7 +634,7 @@ void ExecutionEngine::InitializeMemory(const Constant *Init, void *Addr) {
}
default:
- llvm_cerr << "Bad Type: " << *Init->getType() << "\n";
+ cerr << "Bad Type: " << *Init->getType() << "\n";
assert(0 && "Unknown constant type to initialize memory with!");
}
}
@@ -718,8 +718,8 @@ void ExecutionEngine::emitGlobals() {
sys::DynamicLibrary::SearchForAddressOfSymbol(I->getName().c_str()))
addGlobalMapping(I, SymAddr);
else {
- llvm_cerr << "Could not resolve external global address: "
- << I->getName() << "\n";
+ cerr << "Could not resolve external global address: "
+ << I->getName() << "\n";
abort();
}
}
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 964435d..f7400e9 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 161873c..a1c4317 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;
}