Print out all globals as they are emitted, not just those emitted from
authorChris Lattner <sabre@nondot.org>
Sun, 8 Feb 2004 19:33:23 +0000 (19:33 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 8 Feb 2004 19:33:23 +0000 (19:33 +0000)
emitGlobals

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11191 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/ExecutionEngine.cpp

index 5892d169e78827701b5a14fc0e8417180283eb10..665b5c6273766271d570cb5fe1e03fd1ed7d6cf6 100644 (file)
@@ -454,9 +454,6 @@ void ExecutionEngine::emitGlobals() {
       // Allocate some memory for it!
       unsigned Size = TD.getTypeSize(Ty);
       addGlobalMapping(I, new char[Size]);
-
-      DEBUG(std::cerr << "Global '" << I->getName() << "' -> "
-                      << getPointerToGlobal(I) << "\n");
     } else {
       // External variable reference. Try to use the dynamic loader to
       // get a pointer to it.
@@ -482,6 +479,8 @@ void ExecutionEngine::emitGlobals() {
 // already in the map.
 void ExecutionEngine::EmitGlobalVariable(const GlobalVariable *GV) {
   void *GA = getPointerToGlobalIfAvailable(GV);
+  DEBUG(std::cerr << "Global '" << GV->getName() << "' -> " << GA << "\n");
+
   const Type *ElTy = GV->getType()->getElementType();
   if (GA == 0) {
     // If it's not already specified, allocate memory for the global.