aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/JIT
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2006-12-07 20:04:42 +0000
committerBill Wendling <isanbard@gmail.com>2006-12-07 20:04:42 +0000
commit832171cb9724d2d31c8dfb73172e2be8f6dd13ee (patch)
tree19c97b01f69b4d0765e4ccdd1dac03c854d6e5eb /lib/ExecutionEngine/JIT
parent04b4e0595ffffab232a73a78d742e08efb6ebcfb (diff)
Removing even more <iostream> includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32320 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT')
-rw-r--r--lib/ExecutionEngine/JIT/Intercept.cpp5
-rw-r--r--lib/ExecutionEngine/JIT/JIT.cpp11
-rw-r--r--lib/ExecutionEngine/JIT/JITEmitter.cpp55
-rw-r--r--lib/ExecutionEngine/JIT/TargetSelect.cpp7
4 files changed, 37 insertions, 41 deletions
diff --git a/lib/ExecutionEngine/JIT/Intercept.cpp b/lib/ExecutionEngine/JIT/Intercept.cpp
index db6165f781..f370e5bb0a 100644
--- a/lib/ExecutionEngine/JIT/Intercept.cpp
+++ b/lib/ExecutionEngine/JIT/Intercept.cpp
@@ -18,7 +18,6 @@
#include "JIT.h"
#include "llvm/System/DynamicLibrary.h"
#include "llvm/Config/config.h"
-#include <iostream>
using namespace llvm;
// AtExitHandlers - List of functions to call when the program exits,
@@ -115,8 +114,8 @@ void *JIT::getPointerToNamedFunction(const std::string &Name) {
if (Ptr) return Ptr;
}
- std::cerr << "ERROR: Program used external function '" << Name
- << "' which could not be resolved!\n";
+ cerr << "ERROR: Program used external function '" << Name
+ << "' which could not be resolved!\n";
abort();
return 0;
}
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp
index 9795eb7935..28c452d7fb 100644
--- a/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/lib/ExecutionEngine/JIT/JIT.cpp
@@ -27,7 +27,6 @@
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetJITInfo.h"
-#include <iostream>
using namespace llvm;
#ifdef __APPLE__
@@ -64,7 +63,7 @@ JIT::JIT(ModuleProvider *MP, TargetMachine &tm, TargetJITInfo &tji)
// Turn the machine code intermediate representation into bytes in memory that
// may be executed.
if (TM.addPassesToEmitMachineCode(PM, *MCE, false /*fast*/)) {
- std::cerr << "Target does not support machine code emission!\n";
+ cerr << "Target does not support machine code emission!\n";
abort();
}
@@ -279,8 +278,8 @@ void *JIT::getPointerToFunction(Function *F) {
std::string ErrorMsg;
if (MP->materializeFunction(F, &ErrorMsg)) {
- std::cerr << "Error reading function '" << F->getName()
- << "' from bytecode file: " << ErrorMsg << "\n";
+ cerr << "Error reading function '" << F->getName()
+ << "' from bytecode file: " << ErrorMsg << "\n";
abort();
}
}
@@ -323,8 +322,8 @@ void *JIT::getOrEmitGlobalVariable(const GlobalVariable *GV) {
#endif
Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(GV->getName().c_str());
if (Ptr == 0) {
- std::cerr << "Could not resolve external global address: "
- << GV->getName() << "\n";
+ cerr << "Could not resolve external global address: "
+ << GV->getName() << "\n";
abort();
}
} else {
diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp
index 02113473a5..3c54b581cb 100644
--- a/lib/ExecutionEngine/JIT/JITEmitter.cpp
+++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp
@@ -30,7 +30,6 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/System/Memory.h"
#include <algorithm>
-#include <iostream>
using namespace llvm;
namespace {
@@ -410,7 +409,7 @@ unsigned char *JITMemoryManager::allocateStub(unsigned StubSize,
~(intptr_t)(Alignment-1));
if (CurStubPtr < StubBase) {
// FIXME: allocate a new block
- std::cerr << "JIT ran out of memory for function stubs!\n";
+ cerr << "JIT ran out of memory for function stubs!\n";
abort();
}
return CurStubPtr;
@@ -422,8 +421,8 @@ sys::MemoryBlock JITMemoryManager::getNewMemoryBlock(unsigned size) {
std::string ErrMsg;
sys::MemoryBlock B = sys::Memory::AllocateRWX(size, BOld, &ErrMsg);
if (B.base() == 0) {
- std::cerr << "Allocation failed when allocating new memory in the JIT\n";
- std::cerr << ErrMsg << "\n";
+ cerr << "Allocation failed when allocating new memory in the JIT\n";
+ cerr << ErrMsg << "\n";
abort();
}
Blocks.push_back(B);
@@ -562,8 +561,8 @@ void *JITResolver::getFunctionStub(Function *F) {
// Invalidate the icache if necessary.
synchronizeICache(Stub, MCE.getCurrentPCValue()-(intptr_t)Stub);
- DEBUG(std::cerr << "JIT: Stub emitted at [" << Stub << "] for function '"
- << F->getName() << "'\n");
+ DOUT << "JIT: Stub emitted at [" << Stub << "] for function '"
+ << F->getName() << "'\n";
// Finally, keep track of the stub-to-Function mapping so that the
// JITCompilerFn knows which function to compile!
@@ -583,8 +582,8 @@ void *JITResolver::getExternalFunctionStub(void *FnAddr) {
// Invalidate the icache if necessary.
synchronizeICache(Stub, MCE.getCurrentPCValue()-(intptr_t)Stub);
- DEBUG(std::cerr << "JIT: Stub emitted at [" << Stub
- << "] for external function at '" << FnAddr << "'\n");
+ DOUT << "JIT: Stub emitted at [" << Stub
+ << "] for external function at '" << FnAddr << "'\n";
return Stub;
}
@@ -593,8 +592,8 @@ unsigned JITResolver::getGOTIndexForAddr(void* addr) {
if (!idx) {
idx = ++nextGOTIndex;
revGOTMap[addr] = idx;
- DEBUG(std::cerr << "Adding GOT entry " << idx
- << " for addr " << addr << "\n");
+ DOUT << "Adding GOT entry " << idx
+ << " for addr " << addr << "\n";
// ((void**)MemMgr.getGOTBase())[idx] = addr;
}
return idx;
@@ -618,8 +617,8 @@ void *JITResolver::JITCompilerFn(void *Stub) {
// If disabled, emit a useful error message and abort.
if (TheJIT->isLazyCompilationDisabled()) {
- std::cerr << "LLVM JIT requested to do lazy compilation of function '"
- << F->getName() << "' when lazy compiles are disabled!\n";
+ cerr << "LLVM JIT requested to do lazy compilation of function '"
+ << F->getName() << "' when lazy compiles are disabled!\n";
abort();
}
@@ -630,9 +629,9 @@ void *JITResolver::JITCompilerFn(void *Stub) {
// needs to call.
//JR.state.getStubToFunctionMap(locked).erase(I);
- DEBUG(std::cerr << "JIT: Lazily resolving function '" << F->getName()
- << "' In stub ptr = " << Stub << " actual ptr = "
- << I->first << "\n");
+ DOUT << "JIT: Lazily resolving function '" << F->getName()
+ << "' In stub ptr = " << Stub << " actual ptr = "
+ << I->first << "\n";
void *Result = TheJIT->getPointerToFunction(F);
@@ -693,7 +692,7 @@ namespace {
public:
JITEmitter(JIT &jit) : MemMgr(jit.getJITInfo().needsGOT()) {
TheJIT = &jit;
- DEBUG(if (MemMgr.isManagingGOT()) std::cerr << "JIT is managing a GOT\n");
+ if (MemMgr.isManagingGOT()) DOUT << "JIT is managing a GOT\n";
}
virtual void startFunction(MachineFunction &F);
@@ -788,7 +787,7 @@ void JITEmitter::startFunction(MachineFunction &F) {
bool JITEmitter::finishFunction(MachineFunction &F) {
if (CurBufferPtr == BufferEnd) {
// FIXME: Allocate more space, then try again.
- std::cerr << "JIT: Ran out of space for generated machine code!\n";
+ cerr << "JIT: Ran out of space for generated machine code!\n";
abort();
}
@@ -837,9 +836,9 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
unsigned idx = getJITResolver(this).getGOTIndexForAddr(ResultPtr);
MR.setGOTIndex(idx);
if (((void**)MemMgr.getGOTBase())[idx] != ResultPtr) {
- DEBUG(std::cerr << "GOT was out of date for " << ResultPtr
- << " pointing at " << ((void**)MemMgr.getGOTBase())[idx]
- << "\n");
+ DOUT << "GOT was out of date for " << ResultPtr
+ << " pointing at " << ((void**)MemMgr.getGOTBase())[idx]
+ << "\n";
((void**)MemMgr.getGOTBase())[idx] = ResultPtr;
}
}
@@ -853,8 +852,8 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
if(MemMgr.isManagingGOT()) {
unsigned idx = getJITResolver(this).getGOTIndexForAddr((void*)BufferBegin);
if (((void**)MemMgr.getGOTBase())[idx] != (void*)BufferBegin) {
- DEBUG(std::cerr << "GOT was out of date for " << (void*)BufferBegin
- << " pointing at " << ((void**)MemMgr.getGOTBase())[idx] << "\n");
+ DOUT << "GOT was out of date for " << (void*)BufferBegin
+ << " pointing at " << ((void**)MemMgr.getGOTBase())[idx] << "\n";
((void**)MemMgr.getGOTBase())[idx] = (void*)BufferBegin;
}
}
@@ -862,10 +861,10 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
// Invalidate the icache if necessary.
synchronizeICache(FnStart, FnEnd-FnStart);
- DEBUG(std::cerr << "JIT: Finished CodeGen of [" << (void*)FnStart
- << "] Function: " << F.getFunction()->getName()
- << ": " << (FnEnd-FnStart) << " bytes of text, "
- << Relocations.size() << " relocations\n");
+ DOUT << "JIT: Finished CodeGen of [" << (void*)FnStart
+ << "] Function: " << F.getFunction()->getName()
+ << ": " << (FnEnd-FnStart) << " bytes of text, "
+ << Relocations.size() << " relocations\n";
Relocations.clear();
return false;
}
@@ -890,8 +889,8 @@ void JITEmitter::emitConstantPool(MachineConstantPool *MCP) {
void *CAddr = (char*)ConstantPoolBase+Constants[i].Offset;
if (Constants[i].isMachineConstantPoolEntry()) {
// FIXME: add support to lower machine constant pool values into bytes!
- std::cerr << "Initialize memory with machine specific constant pool entry"
- << " has not been implemented!\n";
+ cerr << "Initialize memory with machine specific constant pool entry"
+ << " has not been implemented!\n";
abort();
}
TheJIT->InitializeMemory(Constants[i].Val.ConstVal, CAddr);
diff --git a/lib/ExecutionEngine/JIT/TargetSelect.cpp b/lib/ExecutionEngine/JIT/TargetSelect.cpp
index ef9c8f549e..c30f88c572 100644
--- a/lib/ExecutionEngine/JIT/TargetSelect.cpp
+++ b/lib/ExecutionEngine/JIT/TargetSelect.cpp
@@ -18,7 +18,6 @@
#include "llvm/Target/SubtargetFeature.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetMachineRegistry.h"
-#include <iostream>
using namespace llvm;
static cl::opt<const TargetMachineRegistry::Entry*, false, TargetNameParser>
@@ -45,9 +44,9 @@ ExecutionEngine *JIT::create(ModuleProvider *MP) {
MArch = TargetMachineRegistry::getClosestTargetForJIT(Error);
if (MArch == 0) return 0;
} else if (MArch->JITMatchQualityFn() == 0) {
- std::cerr << "WARNING: This target JIT is not designed for the host you are"
- << " running. If bad things happen, please choose a different "
- << "-march switch.\n";
+ cerr << "WARNING: This target JIT is not designed for the host you are"
+ << " running. If bad things happen, please choose a different "
+ << "-march switch.\n";
}
// Package up features to be passed to target/subtarget