mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-12 01:25:49 +00:00
Pass the MDNode in and do the insertion at compile unit creation time
instead of relying upon an extra call to finish initializing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181383 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -32,11 +32,12 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
/// CompileUnit - Compile unit constructor.
|
/// CompileUnit - Compile unit constructor.
|
||||||
CompileUnit::CompileUnit(unsigned UID, unsigned L, DIE *D, AsmPrinter *A,
|
CompileUnit::CompileUnit(unsigned UID, unsigned L, DIE *D, const MDNode *N,
|
||||||
DwarfDebug *DW, DwarfUnits *DWU)
|
AsmPrinter *A, DwarfDebug *DW, DwarfUnits *DWU)
|
||||||
: UniqueID(UID), Language(L), CUDie(D), Asm(A), DD(DW), DU(DWU),
|
: UniqueID(UID), Language(L), CUDie(D), Asm(A), DD(DW), DU(DWU),
|
||||||
IndexTyDie(0), DebugInfoOffset(0) {
|
IndexTyDie(0), DebugInfoOffset(0) {
|
||||||
DIEIntegerOne = new (DIEValueAllocator) DIEInteger(1);
|
DIEIntegerOne = new (DIEValueAllocator) DIEInteger(1);
|
||||||
|
insertDIE(N, D);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ~CompileUnit - Destructor for compile unit.
|
/// ~CompileUnit - Destructor for compile unit.
|
||||||
|
@@ -95,8 +95,8 @@ class CompileUnit {
|
|||||||
int64_t getDefaultLowerBound() const;
|
int64_t getDefaultLowerBound() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CompileUnit(unsigned UID, unsigned L, DIE *D, AsmPrinter *A, DwarfDebug *DW,
|
CompileUnit(unsigned UID, unsigned L, DIE *D, const MDNode *N, AsmPrinter *A,
|
||||||
DwarfUnits *);
|
DwarfDebug *DW, DwarfUnits *DWU);
|
||||||
~CompileUnit();
|
~CompileUnit();
|
||||||
|
|
||||||
// Accessors.
|
// Accessors.
|
||||||
|
@@ -683,9 +683,8 @@ CompileUnit *DwarfDebug::constructCompileUnit(const MDNode *N) {
|
|||||||
|
|
||||||
DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
|
DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
|
||||||
CompileUnit *NewCU = new CompileUnit(GlobalCUIndexCount++,
|
CompileUnit *NewCU = new CompileUnit(GlobalCUIndexCount++,
|
||||||
DIUnit.getLanguage(), Die, Asm,
|
DIUnit.getLanguage(), Die, N, Asm,
|
||||||
this, &InfoHolder);
|
this, &InfoHolder);
|
||||||
NewCU->insertDIE(N, Die);
|
|
||||||
|
|
||||||
FileIDCUMap[NewCU->getUniqueID()] = 0;
|
FileIDCUMap[NewCU->getUniqueID()] = 0;
|
||||||
// Call this to emit a .file directive if it wasn't emitted for the source
|
// Call this to emit a .file directive if it wasn't emitted for the source
|
||||||
@@ -2587,7 +2586,7 @@ CompileUnit *DwarfDebug::constructSkeletonCU(const MDNode *N) {
|
|||||||
|
|
||||||
DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
|
DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
|
||||||
CompileUnit *NewCU = new CompileUnit(GlobalCUIndexCount++,
|
CompileUnit *NewCU = new CompileUnit(GlobalCUIndexCount++,
|
||||||
DIUnit.getLanguage(), Die, Asm,
|
DIUnit.getLanguage(), Die, N, Asm,
|
||||||
this, &SkeletonHolder);
|
this, &SkeletonHolder);
|
||||||
|
|
||||||
NewCU->addLocalString(Die, dwarf::DW_AT_GNU_dwo_name,
|
NewCU->addLocalString(Die, dwarf::DW_AT_GNU_dwo_name,
|
||||||
|
Reference in New Issue
Block a user