mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Factor parentness out of Module & GlobalVariable into GlobalValue
Implement SymbolTable debug/dump utility git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@710 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -173,3 +173,29 @@ void SymbolTable::refineAbstractType(const DerivedType *OldType,
|
||||
cast<const DerivedType>(NewType)->addAbstractTypeUser(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
#include "llvm/Assembly/Writer.h"
|
||||
#include <algorithm>
|
||||
|
||||
static void DumpVal(const pair<const string, Value *> &V) {
|
||||
cout << " '%" << V.first << "' = " << V.second << endl;
|
||||
}
|
||||
|
||||
static void DumpPlane(const pair<const Type *, map<const string, Value *> >&P) {
|
||||
cout << " Plane: " << P.first << endl;
|
||||
for_each(P.second.begin(), P.second.end(), DumpVal);
|
||||
}
|
||||
|
||||
void SymbolTable::dump() const {
|
||||
cout << "Symbol table dump:\n";
|
||||
for_each(begin(), end(), DumpPlane);
|
||||
|
||||
if (ParentSymTab) {
|
||||
cout << "Parent ";
|
||||
ParentSymTab->dump();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user