Eliminate explicit use of Writer library, using debug dump output instead.
authorChris Lattner <sabre@nondot.org>
Sun, 7 Apr 2002 22:31:23 +0000 (22:31 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 7 Apr 2002 22:31:23 +0000 (22:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2147 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Linker/LinkModules.cpp
lib/Transforms/Utils/Linker.cpp
lib/VMCore/Linker.cpp

index f3955c89b44766444999d32502e399d83be981e4..9637f747e28cbc2b1f56809eefb16c928623405b 100644 (file)
@@ -31,9 +31,6 @@ static inline bool Error(string *E, string Message) {
   return true;
 }
 
-#include "llvm/Assembly/Writer.h" // TODO: REMOVE
-
-
 // LinkTypes - Go through the symbol table of the Src module and see if any
 // types are named in the src module that are not named in the Dst module.
 // Make sure there are no type name conflicts.
@@ -74,8 +71,11 @@ static bool LinkTypes(Module *Dest, const Module *Src, string *Err = 0) {
 static void PrintMap(const map<const Value*, Value*> &M) {
   for (map<const Value*, Value*>::const_iterator I = M.begin(), E = M.end();
        I != E; ++I) {
-    cerr << " Fr: " << (void*)I->first << " " << I->first 
-         << " To: " << (void*)I->second << " " << I->second << "\n";
+    cerr << " Fr: " << (void*)I->first << " ";
+    I->first->dump();
+    cerr << " To: " << (void*)I->second << " ";
+    I->second->dump();
+    cerr << "\n";
   }
 }
 
@@ -137,7 +137,9 @@ static Value *RemapOperand(const Value *In, map<const Value*, Value*> &LocalMap,
     PrintMap(*GlobalMap);
   }
 
-  cerr << "Couldn't remap value: " << (void*)In << " " << In << "\n";
+  cerr << "Couldn't remap value: " << (void*)In << " ";
+  In->dump();
+  cerr << "\n";
   assert(0 && "Couldn't remap value!");
   return 0;
 }
index f3955c89b44766444999d32502e399d83be981e4..9637f747e28cbc2b1f56809eefb16c928623405b 100644 (file)
@@ -31,9 +31,6 @@ static inline bool Error(string *E, string Message) {
   return true;
 }
 
-#include "llvm/Assembly/Writer.h" // TODO: REMOVE
-
-
 // LinkTypes - Go through the symbol table of the Src module and see if any
 // types are named in the src module that are not named in the Dst module.
 // Make sure there are no type name conflicts.
@@ -74,8 +71,11 @@ static bool LinkTypes(Module *Dest, const Module *Src, string *Err = 0) {
 static void PrintMap(const map<const Value*, Value*> &M) {
   for (map<const Value*, Value*>::const_iterator I = M.begin(), E = M.end();
        I != E; ++I) {
-    cerr << " Fr: " << (void*)I->first << " " << I->first 
-         << " To: " << (void*)I->second << " " << I->second << "\n";
+    cerr << " Fr: " << (void*)I->first << " ";
+    I->first->dump();
+    cerr << " To: " << (void*)I->second << " ";
+    I->second->dump();
+    cerr << "\n";
   }
 }
 
@@ -137,7 +137,9 @@ static Value *RemapOperand(const Value *In, map<const Value*, Value*> &LocalMap,
     PrintMap(*GlobalMap);
   }
 
-  cerr << "Couldn't remap value: " << (void*)In << " " << In << "\n";
+  cerr << "Couldn't remap value: " << (void*)In << " ";
+  In->dump();
+  cerr << "\n";
   assert(0 && "Couldn't remap value!");
   return 0;
 }
index f3955c89b44766444999d32502e399d83be981e4..9637f747e28cbc2b1f56809eefb16c928623405b 100644 (file)
@@ -31,9 +31,6 @@ static inline bool Error(string *E, string Message) {
   return true;
 }
 
-#include "llvm/Assembly/Writer.h" // TODO: REMOVE
-
-
 // LinkTypes - Go through the symbol table of the Src module and see if any
 // types are named in the src module that are not named in the Dst module.
 // Make sure there are no type name conflicts.
@@ -74,8 +71,11 @@ static bool LinkTypes(Module *Dest, const Module *Src, string *Err = 0) {
 static void PrintMap(const map<const Value*, Value*> &M) {
   for (map<const Value*, Value*>::const_iterator I = M.begin(), E = M.end();
        I != E; ++I) {
-    cerr << " Fr: " << (void*)I->first << " " << I->first 
-         << " To: " << (void*)I->second << " " << I->second << "\n";
+    cerr << " Fr: " << (void*)I->first << " ";
+    I->first->dump();
+    cerr << " To: " << (void*)I->second << " ";
+    I->second->dump();
+    cerr << "\n";
   }
 }
 
@@ -137,7 +137,9 @@ static Value *RemapOperand(const Value *In, map<const Value*, Value*> &LocalMap,
     PrintMap(*GlobalMap);
   }
 
-  cerr << "Couldn't remap value: " << (void*)In << " " << In << "\n";
+  cerr << "Couldn't remap value: " << (void*)In << " ";
+  In->dump();
+  cerr << "\n";
   assert(0 && "Couldn't remap value!");
   return 0;
 }