diff options
author | Bill Wendling <isanbard@gmail.com> | 2006-11-27 23:54:50 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2006-11-27 23:54:50 +0000 |
commit | 480f093dc2b6aff9b501cc56cf5728513e55be81 (patch) | |
tree | 25addc3b3f3b33d17cea0b98a8119ca090c290d8 /lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | |
parent | 29c277fc2c8beeddfeda00f5a333318b8557f025 (diff) | |
download | external_llvm-480f093dc2b6aff9b501cc56cf5728513e55be81.zip external_llvm-480f093dc2b6aff9b501cc56cf5728513e55be81.tar.gz external_llvm-480f093dc2b6aff9b501cc56cf5728513e55be81.tar.bz2 |
Removed #include <iostream> and replaced streams with llvm streams.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31949 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp')
-rw-r--r-- | lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index 28bb9bf..1b8f399 100644 --- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -22,6 +22,7 @@ #include "Interpreter.h" #include "llvm/DerivedTypes.h" #include "llvm/Module.h" +#include "llvm/Support/Streams.h" #include "llvm/System/DynamicLibrary.h" #include "llvm/Target/TargetData.h" #include <csignal> @@ -91,7 +92,7 @@ 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) { - std::cout << "Tried to execute an unknown external function: " + llvm_cerr << "Tried to execute an unknown external function: " << F->getType()->getDescription() << " " << F->getName() << "\n"; if (F->getName() == "__main") return GenericValue(); @@ -112,19 +113,19 @@ extern "C" { // Don't add C++ manglings to llvm mangling :) // void putchar(sbyte) GenericValue lle_Vb_putchar(FunctionType *M, const vector<GenericValue> &Args) { - std::cout << Args[0].SByteVal; + llvm_cout << Args[0].SByteVal; return GenericValue(); } // int putchar(int) GenericValue lle_ii_putchar(FunctionType *M, const vector<GenericValue> &Args) { - std::cout << ((char)Args[0].IntVal) << std::flush; + llvm_cout << ((char)Args[0].IntVal) << std::flush; return Args[0]; } // void putchar(ubyte) GenericValue lle_VB_putchar(FunctionType *M, const vector<GenericValue> &Args) { - std::cout << Args[0].SByteVal << std::flush; + llvm_cout << Args[0].SByteVal << std::flush; return Args[0]; } @@ -330,7 +331,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: std::cout << "<unknown printf code '" << *FmtStr << "'!>"; + default: llvm_cerr << "<unknown printf code '" << *FmtStr << "'!>"; ArgNo++; break; } strcpy(OutputBuffer, Buffer); @@ -348,7 +349,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); - std::cout << Buffer; + llvm_cout << Buffer; return GV; } |