[llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/Intercept.cpp JIT.cpp JITEmitter.cpp TargetSelect.cpp

Bill Wendling isanbard at gmail.com
Thu Dec 7 12:05:10 PST 2006



Changes in directory llvm/lib/ExecutionEngine/JIT:

Intercept.cpp updated: 1.28 -> 1.29
JIT.cpp updated: 1.81 -> 1.82
JITEmitter.cpp updated: 1.120 -> 1.121
TargetSelect.cpp updated: 1.12 -> 1.13
---
Log message:

Removing even more <iostream> includes.


---
Diffs of the changes:  (+37 -41)

 Intercept.cpp    |    5 ++---
 JIT.cpp          |   11 +++++------
 JITEmitter.cpp   |   55 +++++++++++++++++++++++++++----------------------------
 TargetSelect.cpp |    7 +++----
 4 files changed, 37 insertions(+), 41 deletions(-)


Index: llvm/lib/ExecutionEngine/JIT/Intercept.cpp
diff -u llvm/lib/ExecutionEngine/JIT/Intercept.cpp:1.28 llvm/lib/ExecutionEngine/JIT/Intercept.cpp:1.29
--- llvm/lib/ExecutionEngine/JIT/Intercept.cpp:1.28	Fri Jul 28 16:11:31 2006
+++ llvm/lib/ExecutionEngine/JIT/Intercept.cpp	Thu Dec  7 14:04:42 2006
@@ -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 @@
     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;
 }


Index: llvm/lib/ExecutionEngine/JIT/JIT.cpp
diff -u llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.81 llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.82
--- llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.81	Fri Oct 20 02:07:24 2006
+++ llvm/lib/ExecutionEngine/JIT/JIT.cpp	Thu Dec  7 14:04:42 2006
@@ -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 @@
   // 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 @@
     
     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 @@
 #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 {


Index: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
diff -u llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.120 llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.121
--- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.120	Wed Dec  6 11:46:32 2006
+++ llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp	Thu Dec  7 14:04:42 2006
@@ -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 @@
                                 ~(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 @@
   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 @@
   // 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 @@
   // 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 @@
   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 @@
 
   // 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 @@
   // 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 @@
 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 @@
 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 @@
         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 @@
   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 @@
   // 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 *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);


Index: llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp
diff -u llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp:1.12 llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp:1.13
--- llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp:1.12	Wed Mar 22 23:28:02 2006
+++ llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp	Thu Dec  7 14:04:42 2006
@@ -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 @@
     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






More information about the llvm-commits mailing list