diff options
author | Chris Lattner <sabre@nondot.org> | 2001-11-03 03:27:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-11-03 03:27:29 +0000 |
commit | 1e60d6b762a6c300fa740891e1afdae31db05ad9 (patch) | |
tree | 0db4304e832f2b1970ed002fbf41ab2ff6e3e3a4 /llvm/lib/Transforms/Utils/Linker.cpp | |
parent | c7724169bf387096161f12ae26a77624f27dcf3f (diff) | |
download | bcm5719-llvm-1e60d6b762a6c300fa740891e1afdae31db05ad9.tar.gz bcm5719-llvm-1e60d6b762a6c300fa740891e1afdae31db05ad9.zip |
Add extra code for debugging linker problems
llvm-svn: 1091
Diffstat (limited to 'llvm/lib/Transforms/Utils/Linker.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Linker.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/Linker.cpp b/llvm/lib/Transforms/Utils/Linker.cpp index 3cb1ffecd26..a2399ed37a5 100644 --- a/llvm/lib/Transforms/Utils/Linker.cpp +++ b/llvm/lib/Transforms/Utils/Linker.cpp @@ -27,6 +27,15 @@ static inline bool Error(string *E, string Message) { #include "llvm/Assembly/Writer.h" // TODO: REMOVE +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 << endl; + } +} + + // RemapOperand - Use LocalMap and GlobalMap to convert references from one // module to another. This is somewhat sophisticated in that it can // automatically handle constant references correctly as well... @@ -75,8 +84,16 @@ static Value *RemapOperand(const Value *In, map<const Value*, Value*> &LocalMap, LocalMap.insert(make_pair(In, CPV)); return Result; } - - cerr << "Couldn't remap value: " << In << endl; + + cerr << "XXX LocalMap: \n"; + PrintMap(LocalMap); + + if (GlobalMap) { + cerr << "XXX GlobalMap: \n"; + PrintMap(*GlobalMap); + } + + cerr << "Couldn't remap value: " << (void*)In << " " << In << endl; assert(0 && "Couldn't remap value!"); return 0; } |