mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
Move the string pools down into the units. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171905 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -155,15 +155,14 @@ DIType DbgVariable::getType() const {
|
|||||||
DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
|
DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
|
||||||
: Asm(A), MMI(Asm->MMI), FirstCU(0),
|
: Asm(A), MMI(Asm->MMI), FirstCU(0),
|
||||||
AbbreviationsSet(InitAbbreviationsSetSize),
|
AbbreviationsSet(InitAbbreviationsSetSize),
|
||||||
SourceIdMap(DIEValueAllocator), InfoStringPool(DIEValueAllocator),
|
SourceIdMap(DIEValueAllocator),
|
||||||
PrevLabel(NULL), GlobalCUIndexCount(0),
|
PrevLabel(NULL), GlobalCUIndexCount(0),
|
||||||
InfoHolder(A, &AbbreviationsSet, &Abbreviations,
|
InfoHolder(A, &AbbreviationsSet, &Abbreviations, "info_string",
|
||||||
&InfoStringPool, "info_string"),
|
DIEValueAllocator),
|
||||||
SkeletonCU(0),
|
SkeletonCU(0),
|
||||||
SkeletonAbbrevSet(InitAbbreviationsSetSize),
|
SkeletonAbbrevSet(InitAbbreviationsSetSize),
|
||||||
SkeletonStringPool(DIEValueAllocator),
|
SkeletonHolder(A, &SkeletonAbbrevSet, &SkeletonAbbrevs, "skel_string",
|
||||||
SkeletonHolder(A, &SkeletonAbbrevSet, &SkeletonAbbrevs,
|
DIEValueAllocator) {
|
||||||
&SkeletonStringPool, "skel_string") {
|
|
||||||
|
|
||||||
DwarfInfoSectionSym = DwarfAbbrevSectionSym = 0;
|
DwarfInfoSectionSym = DwarfAbbrevSectionSym = 0;
|
||||||
DwarfStrSectionSym = TextSectionSym = 0;
|
DwarfStrSectionSym = TextSectionSym = 0;
|
||||||
@ -221,7 +220,7 @@ MCSymbol *DwarfUnits::getStringPoolSym() {
|
|||||||
|
|
||||||
MCSymbol *DwarfUnits::getStringPoolEntry(StringRef Str) {
|
MCSymbol *DwarfUnits::getStringPoolEntry(StringRef Str) {
|
||||||
std::pair<MCSymbol*, unsigned> &Entry =
|
std::pair<MCSymbol*, unsigned> &Entry =
|
||||||
StringPool->GetOrCreateValue(Str).getValue();
|
StringPool.GetOrCreateValue(Str).getValue();
|
||||||
if (Entry.first) return Entry.first;
|
if (Entry.first) return Entry.first;
|
||||||
|
|
||||||
Entry.second = NextStringPoolNumber++;
|
Entry.second = NextStringPoolNumber++;
|
||||||
@ -230,7 +229,7 @@ MCSymbol *DwarfUnits::getStringPoolEntry(StringRef Str) {
|
|||||||
|
|
||||||
unsigned DwarfUnits::getStringPoolIndex(StringRef Str) {
|
unsigned DwarfUnits::getStringPoolIndex(StringRef Str) {
|
||||||
std::pair<MCSymbol*, unsigned> &Entry =
|
std::pair<MCSymbol*, unsigned> &Entry =
|
||||||
StringPool->GetOrCreateValue(Str).getValue();
|
StringPool.GetOrCreateValue(Str).getValue();
|
||||||
if (Entry.first) return Entry.second;
|
if (Entry.first) return Entry.second;
|
||||||
|
|
||||||
Entry.second = NextStringPoolNumber++;
|
Entry.second = NextStringPoolNumber++;
|
||||||
@ -2130,7 +2129,7 @@ void DwarfUnits::emitStrings(const MCSection *StrSection,
|
|||||||
const MCSection *OffsetSection = NULL,
|
const MCSection *OffsetSection = NULL,
|
||||||
const MCSymbol *StrSecSym = NULL) {
|
const MCSymbol *StrSecSym = NULL) {
|
||||||
|
|
||||||
if (StringPool->empty()) return;
|
if (StringPool.empty()) return;
|
||||||
|
|
||||||
// Start the dwarf str section.
|
// Start the dwarf str section.
|
||||||
Asm->OutStreamer.SwitchSection(StrSection);
|
Asm->OutStreamer.SwitchSection(StrSection);
|
||||||
@ -2141,7 +2140,7 @@ void DwarfUnits::emitStrings(const MCSection *StrSection,
|
|||||||
StringMapEntry<std::pair<MCSymbol*, unsigned> >*>, 64> Entries;
|
StringMapEntry<std::pair<MCSymbol*, unsigned> >*>, 64> Entries;
|
||||||
|
|
||||||
for (StringMap<std::pair<MCSymbol*, unsigned> >::iterator
|
for (StringMap<std::pair<MCSymbol*, unsigned> >::iterator
|
||||||
I = StringPool->begin(), E = StringPool->end();
|
I = StringPool.begin(), E = StringPool.end();
|
||||||
I != E; ++I)
|
I != E; ++I)
|
||||||
Entries.push_back(std::make_pair(I->second.second, &*I));
|
Entries.push_back(std::make_pair(I->second.second, &*I));
|
||||||
|
|
||||||
|
@ -211,16 +211,16 @@ class DwarfUnits {
|
|||||||
SmallVector<CompileUnit *, 1> CUs;
|
SmallVector<CompileUnit *, 1> CUs;
|
||||||
|
|
||||||
// Collection of strings for this unit and assorted symbols.
|
// Collection of strings for this unit and assorted symbols.
|
||||||
StrPool *StringPool;
|
StrPool StringPool;
|
||||||
unsigned NextStringPoolNumber;
|
unsigned NextStringPoolNumber;
|
||||||
std::string StringPref;
|
std::string StringPref;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DwarfUnits(AsmPrinter *AP, FoldingSet<DIEAbbrev> *AS,
|
DwarfUnits(AsmPrinter *AP, FoldingSet<DIEAbbrev> *AS,
|
||||||
std::vector<DIEAbbrev *> *A,
|
std::vector<DIEAbbrev *> *A, const char *Pref,
|
||||||
StrPool *SP, const char *Pref) :
|
BumpPtrAllocator &DA) :
|
||||||
Asm(AP), AbbreviationsSet(AS), Abbreviations(A),
|
Asm(AP), AbbreviationsSet(AS), Abbreviations(A),
|
||||||
StringPool(SP), NextStringPoolNumber(0), StringPref(Pref) {}
|
StringPool(DA), NextStringPoolNumber(0), StringPref(Pref) {}
|
||||||
|
|
||||||
/// \brief Compute the size and offset of a DIE given an incoming Offset.
|
/// \brief Compute the size and offset of a DIE given an incoming Offset.
|
||||||
unsigned computeSizeAndOffset(DIE *Die, unsigned Offset);
|
unsigned computeSizeAndOffset(DIE *Die, unsigned Offset);
|
||||||
@ -254,7 +254,7 @@ public:
|
|||||||
unsigned getStringPoolIndex(StringRef Str);
|
unsigned getStringPoolIndex(StringRef Str);
|
||||||
|
|
||||||
/// \brief Returns the string pool.
|
/// \brief Returns the string pool.
|
||||||
StrPool *getStringPool() { return StringPool; }
|
StrPool *getStringPool() { return &StringPool; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \brief Collects and handles dwarf debug information.
|
/// \brief Collects and handles dwarf debug information.
|
||||||
@ -290,10 +290,6 @@ class DwarfDebug {
|
|||||||
// separated by a zero byte, mapped to a unique id.
|
// separated by a zero byte, mapped to a unique id.
|
||||||
StringMap<unsigned, BumpPtrAllocator&> SourceIdMap;
|
StringMap<unsigned, BumpPtrAllocator&> SourceIdMap;
|
||||||
|
|
||||||
// A String->Symbol mapping of strings used by indirect
|
|
||||||
// references.
|
|
||||||
StrPool InfoStringPool;
|
|
||||||
|
|
||||||
// Provides a unique id per text section.
|
// Provides a unique id per text section.
|
||||||
SetVector<const MCSection*> SectionMap;
|
SetVector<const MCSection*> SectionMap;
|
||||||
|
|
||||||
@ -409,9 +405,6 @@ class DwarfDebug {
|
|||||||
// A list of all the unique abbreviations in use.
|
// A list of all the unique abbreviations in use.
|
||||||
std::vector<DIEAbbrev *> SkeletonAbbrevs;
|
std::vector<DIEAbbrev *> SkeletonAbbrevs;
|
||||||
|
|
||||||
// List of strings used in the skeleton.
|
|
||||||
StrPool SkeletonStringPool;
|
|
||||||
|
|
||||||
// Holder for the skeleton information.
|
// Holder for the skeleton information.
|
||||||
DwarfUnits SkeletonHolder;
|
DwarfUnits SkeletonHolder;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user