mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
Merging dwarf info to a single compile unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31593 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -438,10 +438,11 @@ public:
|
||||
|
||||
/// Profile - Used to gather unique data for the value folding set.
|
||||
///
|
||||
virtual void Profile(FoldingSetNodeID &ID) {
|
||||
static void Profile(FoldingSetNodeID &ID, unsigned Integer) {
|
||||
ID.AddInteger(isInteger);
|
||||
ID.AddInteger(Integer);
|
||||
}
|
||||
virtual void Profile(FoldingSetNodeID &ID) { Profile(ID, Integer); }
|
||||
|
||||
#ifndef NDEBUG
|
||||
virtual void print(std::ostream &O) {
|
||||
@@ -476,10 +477,11 @@ public:
|
||||
|
||||
/// Profile - Used to gather unique data for the value folding set.
|
||||
///
|
||||
virtual void Profile(FoldingSetNodeID &ID) {
|
||||
static void Profile(FoldingSetNodeID &ID, const std::string &String) {
|
||||
ID.AddInteger(isString);
|
||||
ID.AddString(String);
|
||||
}
|
||||
virtual void Profile(FoldingSetNodeID &ID) { Profile(ID, String); }
|
||||
|
||||
#ifndef NDEBUG
|
||||
virtual void print(std::ostream &O) {
|
||||
@@ -512,10 +514,11 @@ public:
|
||||
|
||||
/// Profile - Used to gather unique data for the value folding set.
|
||||
///
|
||||
virtual void Profile(FoldingSetNodeID &ID) {
|
||||
static void Profile(FoldingSetNodeID &ID, const DWLabel &Label) {
|
||||
ID.AddInteger(isLabel);
|
||||
Label.Profile(ID);
|
||||
}
|
||||
virtual void Profile(FoldingSetNodeID &ID) { Profile(ID, Label); }
|
||||
|
||||
#ifndef NDEBUG
|
||||
virtual void print(std::ostream &O) {
|
||||
@@ -549,10 +552,11 @@ public:
|
||||
|
||||
/// Profile - Used to gather unique data for the value folding set.
|
||||
///
|
||||
virtual void Profile(FoldingSetNodeID &ID) {
|
||||
static void Profile(FoldingSetNodeID &ID, const std::string &Label) {
|
||||
ID.AddInteger(isAsIsLabel);
|
||||
ID.AddString(Label);
|
||||
}
|
||||
virtual void Profile(FoldingSetNodeID &ID) { Profile(ID, Label); }
|
||||
|
||||
#ifndef NDEBUG
|
||||
virtual void print(std::ostream &O) {
|
||||
@@ -586,11 +590,13 @@ public:
|
||||
|
||||
/// Profile - Used to gather unique data for the value folding set.
|
||||
///
|
||||
virtual void Profile(FoldingSetNodeID &ID){
|
||||
static void Profile(FoldingSetNodeID &ID, const DWLabel &LabelHi,
|
||||
const DWLabel &LabelLo) {
|
||||
ID.AddInteger(isDelta);
|
||||
LabelHi.Profile(ID);
|
||||
LabelLo.Profile(ID);
|
||||
}
|
||||
virtual void Profile(FoldingSetNodeID &ID) { Profile(ID, LabelHi, LabelLo); }
|
||||
|
||||
#ifndef NDEBUG
|
||||
virtual void print(std::ostream &O) {
|
||||
@@ -628,6 +634,10 @@ public:
|
||||
|
||||
/// Profile - Used to gather unique data for the value folding set.
|
||||
///
|
||||
static void Profile(FoldingSetNodeID &ID, DIE *Entry) {
|
||||
ID.AddInteger(isEntry);
|
||||
ID.AddPointer(Entry);
|
||||
}
|
||||
virtual void Profile(FoldingSetNodeID &ID) {
|
||||
ID.AddInteger(isEntry);
|
||||
|
||||
@@ -1145,7 +1155,7 @@ public:
|
||||
|
||||
if (Entry) {
|
||||
FoldingSetNodeID ID;
|
||||
ID.AddPointer(Entry);
|
||||
DIEntry::Profile(ID, Entry);
|
||||
void *Where;
|
||||
Value = static_cast<DIEntry *>(ValuesSet.FindNodeOrInsertPos(ID, Where));
|
||||
|
||||
@@ -1176,7 +1186,7 @@ public:
|
||||
if (!Form) Form = DIEInteger::BestForm(false, Integer);
|
||||
|
||||
FoldingSetNodeID ID;
|
||||
ID.AddInteger(Integer);
|
||||
DIEInteger::Profile(ID, Integer);
|
||||
void *Where;
|
||||
DIEValue *Value = ValuesSet.FindNodeOrInsertPos(ID, Where);
|
||||
if (!Value) {
|
||||
@@ -1194,7 +1204,7 @@ public:
|
||||
if (!Form) Form = DIEInteger::BestForm(true, Integer);
|
||||
|
||||
FoldingSetNodeID ID;
|
||||
ID.AddInteger((uint64_t)Integer);
|
||||
DIEInteger::Profile(ID, (uint64_t)Integer);
|
||||
void *Where;
|
||||
DIEValue *Value = ValuesSet.FindNodeOrInsertPos(ID, Where);
|
||||
if (!Value) {
|
||||
@@ -1211,7 +1221,7 @@ public:
|
||||
void AddString(DIE *Die, unsigned Attribute, unsigned Form,
|
||||
const std::string &String) {
|
||||
FoldingSetNodeID ID;
|
||||
ID.AddString(String);
|
||||
DIEString::Profile(ID, String);
|
||||
void *Where;
|
||||
DIEValue *Value = ValuesSet.FindNodeOrInsertPos(ID, Where);
|
||||
if (!Value) {
|
||||
@@ -1228,7 +1238,7 @@ public:
|
||||
void AddLabel(DIE *Die, unsigned Attribute, unsigned Form,
|
||||
const DWLabel &Label) {
|
||||
FoldingSetNodeID ID;
|
||||
Label.Profile(ID);
|
||||
DIEDwarfLabel::Profile(ID, Label);
|
||||
void *Where;
|
||||
DIEValue *Value = ValuesSet.FindNodeOrInsertPos(ID, Where);
|
||||
if (!Value) {
|
||||
@@ -1245,7 +1255,7 @@ public:
|
||||
void AddObjectLabel(DIE *Die, unsigned Attribute, unsigned Form,
|
||||
const std::string &Label) {
|
||||
FoldingSetNodeID ID;
|
||||
ID.AddString(Label);
|
||||
DIEObjectLabel::Profile(ID, Label);
|
||||
void *Where;
|
||||
DIEValue *Value = ValuesSet.FindNodeOrInsertPos(ID, Where);
|
||||
if (!Value) {
|
||||
@@ -1262,8 +1272,7 @@ public:
|
||||
void AddDelta(DIE *Die, unsigned Attribute, unsigned Form,
|
||||
const DWLabel &Hi, const DWLabel &Lo) {
|
||||
FoldingSetNodeID ID;
|
||||
Hi.Profile(ID);
|
||||
Lo.Profile(ID);
|
||||
DIEDelta::Profile(ID, Hi, Lo);
|
||||
void *Where;
|
||||
DIEValue *Value = ValuesSet.FindNodeOrInsertPos(ID, Where);
|
||||
if (!Value) {
|
||||
@@ -1717,7 +1726,7 @@ private:
|
||||
// Get the compile unit context.
|
||||
CompileUnitDesc *UnitDesc =
|
||||
static_cast<CompileUnitDesc *>(GVD->getContext());
|
||||
CompileUnit *Unit = FindCompileUnit(UnitDesc);
|
||||
CompileUnit *Unit = GetBaseCompileUnit();
|
||||
|
||||
// Check for pre-existence.
|
||||
DIE *&Slot = Unit->getDieMapSlotFor(GVD);
|
||||
@@ -1771,7 +1780,7 @@ private:
|
||||
// Get the compile unit context.
|
||||
CompileUnitDesc *UnitDesc =
|
||||
static_cast<CompileUnitDesc *>(SPD->getContext());
|
||||
CompileUnit *Unit = FindCompileUnit(UnitDesc);
|
||||
CompileUnit *Unit = GetBaseCompileUnit();
|
||||
|
||||
// Check for pre-existence.
|
||||
DIE *&Slot = Unit->getDieMapSlotFor(SPD);
|
||||
@@ -1903,9 +1912,7 @@ private:
|
||||
SubprogramDesc *SPD = cast<SubprogramDesc>(RootScope->getDesc());
|
||||
|
||||
// Get the compile unit context.
|
||||
CompileUnitDesc *UnitDesc =
|
||||
static_cast<CompileUnitDesc *>(SPD->getContext());
|
||||
CompileUnit *Unit = FindCompileUnit(UnitDesc);
|
||||
CompileUnit *Unit = GetBaseCompileUnit();
|
||||
|
||||
// Get the subprogram die.
|
||||
DIE *SPDie = Unit->getDieMapSlotFor(SPD);
|
||||
@@ -2066,18 +2073,14 @@ private:
|
||||
/// SizeAndOffsets - Compute the size and offset of all the DIEs.
|
||||
///
|
||||
void SizeAndOffsets() {
|
||||
// Process each compile unit.
|
||||
for (unsigned i = 0, N = CompileUnits.size(); i < N; ++i) {
|
||||
CompileUnit *Unit = CompileUnits[i];
|
||||
if (Unit->hasContent()) {
|
||||
// Process base compile unit.
|
||||
CompileUnit *Unit = GetBaseCompileUnit();
|
||||
// Compute size of compile unit header
|
||||
unsigned Offset = sizeof(int32_t) + // Length of Compilation Unit Info
|
||||
sizeof(int16_t) + // DWARF version number
|
||||
sizeof(int32_t) + // Offset Into Abbrev. Section
|
||||
sizeof(int8_t); // Pointer Size (in bytes)
|
||||
SizeAndOffsetDie(Unit->getDie(), Offset, (i + 1) == N);
|
||||
}
|
||||
}
|
||||
SizeAndOffsetDie(Unit->getDie(), Offset, true);
|
||||
}
|
||||
|
||||
/// EmitFrameMoves - Emit frame instructions to describe the layout of the
|
||||
@@ -2164,11 +2167,7 @@ private:
|
||||
// Start debug info section.
|
||||
Asm->SwitchToDataSection(TAI->getDwarfInfoSection());
|
||||
|
||||
// Process each compile unit.
|
||||
for (unsigned i = 0, N = CompileUnits.size(); i < N; ++i) {
|
||||
CompileUnit *Unit = CompileUnits[i];
|
||||
|
||||
if (Unit->hasContent()) {
|
||||
CompileUnit *Unit = GetBaseCompileUnit();
|
||||
DIE *Die = Unit->getDie();
|
||||
// Emit the compile units header.
|
||||
EmitLabel("info_begin", Unit->getID());
|
||||
@@ -2186,11 +2185,9 @@ private:
|
||||
|
||||
EmitDIE(Die);
|
||||
EmitLabel("info_end", Unit->getID());
|
||||
}
|
||||
|
||||
O << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
/// EmitAbbreviations - Emit the abbreviation section.
|
||||
///
|
||||
@@ -2455,11 +2452,8 @@ private:
|
||||
// Start the dwarf pubnames section.
|
||||
Asm->SwitchToDataSection(TAI->getDwarfPubNamesSection());
|
||||
|
||||
// Process each compile unit.
|
||||
for (unsigned i = 0, N = CompileUnits.size(); i < N; ++i) {
|
||||
CompileUnit *Unit = CompileUnits[i];
|
||||
CompileUnit *Unit = GetBaseCompileUnit();
|
||||
|
||||
if (Unit->hasContent()) {
|
||||
EmitDifference("pubnames_end", Unit->getID(),
|
||||
"pubnames_begin", Unit->getID());
|
||||
EOL("Length of Public Names Info");
|
||||
@@ -2491,8 +2485,6 @@ private:
|
||||
|
||||
O << "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// EmitDebugStr - Emit visible names into a debug str section.
|
||||
///
|
||||
@@ -2533,11 +2525,8 @@ private:
|
||||
|
||||
// FIXME - Mock up
|
||||
#if 0
|
||||
// Process each compile unit.
|
||||
for (unsigned i = 0, N = CompileUnits.size(); i < N; ++i) {
|
||||
CompileUnit *Unit = CompileUnits[i];
|
||||
CompileUnit *Unit = GetBaseCompileUnit();
|
||||
|
||||
if (Unit->hasContent()) {
|
||||
// Don't include size of length
|
||||
EmitInt32(0x1c); EOL("Length of Address Ranges Info");
|
||||
|
||||
@@ -2561,8 +2550,6 @@ private:
|
||||
EmitInt32(0); EOL("EOM (2)");
|
||||
|
||||
O << "\n";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user