mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-26 06:29:20 +00:00
Construct CompileUnits lazily.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91159 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
87862e77bb
commit
d037d7a497
@ -393,7 +393,7 @@ void DwarfDebug::addSourceLine(DIE *Die, const DIVariable *V) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
unsigned Line = V->getLineNumber();
|
unsigned Line = V->getLineNumber();
|
||||||
unsigned FileID = findCompileUnit(V->getCompileUnit()).getID();
|
unsigned FileID = findCompileUnit(V->getCompileUnit())->getID();
|
||||||
assert(FileID && "Invalid file id");
|
assert(FileID && "Invalid file id");
|
||||||
addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
|
addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
|
||||||
addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
|
addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
|
||||||
@ -407,7 +407,7 @@ void DwarfDebug::addSourceLine(DIE *Die, const DIGlobal *G) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
unsigned Line = G->getLineNumber();
|
unsigned Line = G->getLineNumber();
|
||||||
unsigned FileID = findCompileUnit(G->getCompileUnit()).getID();
|
unsigned FileID = findCompileUnit(G->getCompileUnit())->getID();
|
||||||
assert(FileID && "Invalid file id");
|
assert(FileID && "Invalid file id");
|
||||||
addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
|
addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
|
||||||
addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
|
addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
|
||||||
@ -425,7 +425,7 @@ void DwarfDebug::addSourceLine(DIE *Die, const DISubprogram *SP) {
|
|||||||
|
|
||||||
|
|
||||||
unsigned Line = SP->getLineNumber();
|
unsigned Line = SP->getLineNumber();
|
||||||
unsigned FileID = findCompileUnit(SP->getCompileUnit()).getID();
|
unsigned FileID = findCompileUnit(SP->getCompileUnit())->getID();
|
||||||
assert(FileID && "Invalid file id");
|
assert(FileID && "Invalid file id");
|
||||||
addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
|
addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
|
||||||
addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
|
addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
|
||||||
@ -440,7 +440,7 @@ void DwarfDebug::addSourceLine(DIE *Die, const DIType *Ty) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
unsigned Line = Ty->getLineNumber();
|
unsigned Line = Ty->getLineNumber();
|
||||||
unsigned FileID = findCompileUnit(CU).getID();
|
unsigned FileID = findCompileUnit(CU)->getID();
|
||||||
assert(FileID && "Invalid file id");
|
assert(FileID && "Invalid file id");
|
||||||
addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
|
addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
|
||||||
addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
|
addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
|
||||||
@ -1214,11 +1214,12 @@ DIE *DwarfDebug::createSubprogramDIE(const DISubprogram &SP) {
|
|||||||
|
|
||||||
/// findCompileUnit - Get the compile unit for the given descriptor.
|
/// findCompileUnit - Get the compile unit for the given descriptor.
|
||||||
///
|
///
|
||||||
CompileUnit &DwarfDebug::findCompileUnit(DICompileUnit Unit) const {
|
CompileUnit *DwarfDebug::findCompileUnit(DICompileUnit Unit) {
|
||||||
DenseMap<Value *, CompileUnit *>::const_iterator I =
|
DenseMap<Value *, CompileUnit *>::const_iterator I =
|
||||||
CompileUnitMap.find(Unit.getNode());
|
CompileUnitMap.find(Unit.getNode());
|
||||||
assert(I != CompileUnitMap.end() && "Missing compile unit.");
|
if (I == CompileUnitMap.end())
|
||||||
return *I->second;
|
return constructCompileUnit(Unit.getNode());
|
||||||
|
return I->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getUpdatedDbgScope - Find or create DbgScope assicated with the instruction.
|
/// getUpdatedDbgScope - Find or create DbgScope assicated with the instruction.
|
||||||
@ -1579,7 +1580,7 @@ unsigned DwarfDebug::GetOrCreateSourceID(StringRef DirName, StringRef FileName)
|
|||||||
return SrcId;
|
return SrcId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DwarfDebug::constructCompileUnit(MDNode *N) {
|
CompileUnit *DwarfDebug::constructCompileUnit(MDNode *N) {
|
||||||
DICompileUnit DIUnit(N);
|
DICompileUnit DIUnit(N);
|
||||||
StringRef FN = DIUnit.getFilename();
|
StringRef FN = DIUnit.getFilename();
|
||||||
StringRef Dir = DIUnit.getDirectory();
|
StringRef Dir = DIUnit.getDirectory();
|
||||||
@ -1618,6 +1619,7 @@ void DwarfDebug::constructCompileUnit(MDNode *N) {
|
|||||||
|
|
||||||
CompileUnitMap[DIUnit.getNode()] = Unit;
|
CompileUnitMap[DIUnit.getNode()] = Unit;
|
||||||
CompileUnits.push_back(Unit);
|
CompileUnits.push_back(Unit);
|
||||||
|
return Unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DwarfDebug::constructGlobalVariableDIE(MDNode *N) {
|
void DwarfDebug::constructGlobalVariableDIE(MDNode *N) {
|
||||||
|
@ -364,7 +364,7 @@ class DwarfDebug : public Dwarf {
|
|||||||
|
|
||||||
/// findCompileUnit - Get the compile unit for the given descriptor.
|
/// findCompileUnit - Get the compile unit for the given descriptor.
|
||||||
///
|
///
|
||||||
CompileUnit &findCompileUnit(DICompileUnit Unit) const;
|
CompileUnit *findCompileUnit(DICompileUnit Unit);
|
||||||
|
|
||||||
/// getUpdatedDbgScope - Find or create DbgScope assicated with
|
/// getUpdatedDbgScope - Find or create DbgScope assicated with
|
||||||
/// the instruction. Initialize scope and update scope hierarchy.
|
/// the instruction. Initialize scope and update scope hierarchy.
|
||||||
@ -495,7 +495,7 @@ class DwarfDebug : public Dwarf {
|
|||||||
/// as well.
|
/// as well.
|
||||||
unsigned GetOrCreateSourceID(StringRef DirName, StringRef FileName);
|
unsigned GetOrCreateSourceID(StringRef DirName, StringRef FileName);
|
||||||
|
|
||||||
void constructCompileUnit(MDNode *N);
|
CompileUnit *constructCompileUnit(MDNode *N);
|
||||||
|
|
||||||
void constructGlobalVariableDIE(MDNode *N);
|
void constructGlobalVariableDIE(MDNode *N);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user