mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-20 14:29:27 +00:00
Add extra code for debugging linker problems
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1091 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d4f981d00f
commit
2d3e8bba62
@ -27,6 +27,15 @@ static inline bool Error(string *E, string Message) {
|
|||||||
|
|
||||||
#include "llvm/Assembly/Writer.h" // TODO: REMOVE
|
#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
|
// RemapOperand - Use LocalMap and GlobalMap to convert references from one
|
||||||
// module to another. This is somewhat sophisticated in that it can
|
// module to another. This is somewhat sophisticated in that it can
|
||||||
// automatically handle constant references correctly as well...
|
// automatically handle constant references correctly as well...
|
||||||
@ -76,7 +85,15 @@ static Value *RemapOperand(const Value *In, map<const Value*, Value*> &LocalMap,
|
|||||||
return Result;
|
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!");
|
assert(0 && "Couldn't remap value!");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,15 @@ static inline bool Error(string *E, string Message) {
|
|||||||
|
|
||||||
#include "llvm/Assembly/Writer.h" // TODO: REMOVE
|
#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
|
// RemapOperand - Use LocalMap and GlobalMap to convert references from one
|
||||||
// module to another. This is somewhat sophisticated in that it can
|
// module to another. This is somewhat sophisticated in that it can
|
||||||
// automatically handle constant references correctly as well...
|
// automatically handle constant references correctly as well...
|
||||||
@ -76,7 +85,15 @@ static Value *RemapOperand(const Value *In, map<const Value*, Value*> &LocalMap,
|
|||||||
return Result;
|
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!");
|
assert(0 && "Couldn't remap value!");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,15 @@ static inline bool Error(string *E, string Message) {
|
|||||||
|
|
||||||
#include "llvm/Assembly/Writer.h" // TODO: REMOVE
|
#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
|
// RemapOperand - Use LocalMap and GlobalMap to convert references from one
|
||||||
// module to another. This is somewhat sophisticated in that it can
|
// module to another. This is somewhat sophisticated in that it can
|
||||||
// automatically handle constant references correctly as well...
|
// automatically handle constant references correctly as well...
|
||||||
@ -76,7 +85,15 @@ static Value *RemapOperand(const Value *In, map<const Value*, Value*> &LocalMap,
|
|||||||
return Result;
|
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!");
|
assert(0 && "Couldn't remap value!");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user