mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Remove the intermediate AccelTypes maps in DWARF units.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207060 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e33575f577
commit
a0d6bcc183
@ -18,6 +18,7 @@
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/ADT/StringMap.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/Support/Compiler.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/Dwarf.h"
|
||||
@ -125,7 +126,8 @@ public:
|
||||
uint16_t type; // enum AtomType
|
||||
uint16_t form; // DWARF DW_FORM_ defines
|
||||
|
||||
Atom(uint16_t type, uint16_t form) : type(type), form(form) {}
|
||||
LLVM_CONSTEXPR Atom(uint16_t type, uint16_t form)
|
||||
: type(type), form(form) {}
|
||||
#ifndef NDEBUG
|
||||
void print(raw_ostream &O) {
|
||||
O << "Type: " << dwarf::AtomTypeString(type) << "\n"
|
||||
|
@ -164,6 +164,11 @@ DIType DbgVariable::getType() const {
|
||||
return Ty;
|
||||
}
|
||||
|
||||
static LLVM_CONSTEXPR DwarfAccelTable::Atom TypeAtoms[] = {
|
||||
DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4),
|
||||
DwarfAccelTable::Atom(dwarf::DW_ATOM_die_tag, dwarf::DW_FORM_data2),
|
||||
DwarfAccelTable::Atom(dwarf::DW_ATOM_type_flags, dwarf::DW_FORM_data1)};
|
||||
|
||||
DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
|
||||
: Asm(A), MMI(Asm->MMI), FirstCU(0), PrevLabel(NULL), GlobalRangeCount(0),
|
||||
InfoHolder(A, "info_string", DIEValueAllocator),
|
||||
@ -174,7 +179,8 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
|
||||
AccelObjC(DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset,
|
||||
dwarf::DW_FORM_data4)),
|
||||
AccelNamespace(DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset,
|
||||
dwarf::DW_FORM_data4)) {
|
||||
dwarf::DW_FORM_data4)),
|
||||
AccelTypes(TypeAtoms) {
|
||||
|
||||
DwarfInfoSectionSym = DwarfAbbrevSectionSym = DwarfStrSectionSym = 0;
|
||||
DwarfDebugRangeSectionSym = DwarfDebugLocSectionSym = DwarfLineSectionSym = 0;
|
||||
@ -1899,27 +1905,15 @@ void DwarfDebug::emitAccelNamespaces() {
|
||||
|
||||
// Emit type dies into a hashed accelerator table.
|
||||
void DwarfDebug::emitAccelTypes() {
|
||||
DwarfAccelTable::Atom Atoms[] = {
|
||||
DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4),
|
||||
DwarfAccelTable::Atom(dwarf::DW_ATOM_die_tag, dwarf::DW_FORM_data2),
|
||||
DwarfAccelTable::Atom(dwarf::DW_ATOM_type_flags, dwarf::DW_FORM_data1)};
|
||||
DwarfAccelTable AT(Atoms);
|
||||
for (const auto &TheU : getUnits()) {
|
||||
for (const auto &GI : TheU->getAccelTypes()) {
|
||||
StringRef Name = GI.getKey();
|
||||
for (const auto &DI : GI.second)
|
||||
AT.AddName(Name, DI.first, DI.second);
|
||||
}
|
||||
}
|
||||
|
||||
AT.FinalizeTable(Asm, "types");
|
||||
AccelTypes.FinalizeTable(Asm, "types");
|
||||
Asm->OutStreamer.SwitchSection(
|
||||
Asm->getObjFileLowering().getDwarfAccelTypesSection());
|
||||
MCSymbol *SectionBegin = Asm->GetTempSymbol("types_begin");
|
||||
Asm->OutStreamer.EmitLabel(SectionBegin);
|
||||
|
||||
// Emit the full data.
|
||||
AT.Emit(Asm, SectionBegin, &InfoHolder);
|
||||
AccelTypes.Emit(Asm, SectionBegin, &InfoHolder);
|
||||
}
|
||||
|
||||
// Public name handling.
|
||||
@ -2567,3 +2561,10 @@ void DwarfDebug::addAccelNamespace(StringRef Name, const DIE *Die) {
|
||||
InfoHolder.getStringPoolEntry(Name);
|
||||
AccelNamespace.AddName(Name, Die);
|
||||
}
|
||||
|
||||
void DwarfDebug::addAccelType(StringRef Name, const DIE *Die, char Flags) {
|
||||
if (!useDwarfAccelTables())
|
||||
return;
|
||||
InfoHolder.getStringPoolEntry(Name);
|
||||
AccelTypes.AddName(Name, Die, Flags);
|
||||
}
|
||||
|
@ -327,6 +327,7 @@ class DwarfDebug : public AsmPrinterHandler {
|
||||
DwarfAccelTable AccelNames;
|
||||
DwarfAccelTable AccelObjC;
|
||||
DwarfAccelTable AccelNamespace;
|
||||
DwarfAccelTable AccelTypes;
|
||||
|
||||
MCDwarfDwoLineTable *getDwoLineTable(const DwarfCompileUnit &);
|
||||
|
||||
@ -648,6 +649,8 @@ public:
|
||||
void addAccelObjC(StringRef Name, const DIE *Die);
|
||||
|
||||
void addAccelNamespace(StringRef Name, const DIE *Die);
|
||||
|
||||
void addAccelType(StringRef Name, const DIE *Die, char Flags);
|
||||
};
|
||||
} // End of namespace llvm
|
||||
|
||||
|
@ -1035,7 +1035,7 @@ void DwarfUnit::updateAcceleratorTables(DIScope Context, DIType Ty,
|
||||
IsImplementation = (CT.getRunTimeLang() == 0) || CT.isObjcClassComplete();
|
||||
}
|
||||
unsigned Flags = IsImplementation ? dwarf::DW_FLAG_type_implementation : 0;
|
||||
addAccelType(Ty.getName(), std::make_pair(TyDIE, Flags));
|
||||
DD->addAccelType(Ty.getName(), TyDIE, Flags);
|
||||
|
||||
if ((!Context || Context.isCompileUnit() || Context.isFile() ||
|
||||
Context.isNameSpace()) &&
|
||||
@ -1065,15 +1065,6 @@ void DwarfUnit::addType(DIE *Entity, DIType Ty, dwarf::Attribute Attribute) {
|
||||
addDIEEntry(Entity, Attribute, Entry);
|
||||
}
|
||||
|
||||
void DwarfUnit::addAccelType(StringRef Name,
|
||||
std::pair<const DIE *, unsigned> Die) {
|
||||
if (!DD->useDwarfAccelTables())
|
||||
return;
|
||||
DU->getStringPoolEntry(Name);
|
||||
std::vector<std::pair<const DIE *, unsigned> > &DIEs = AccelTypes[Name];
|
||||
DIEs.push_back(Die);
|
||||
}
|
||||
|
||||
/// addGlobalName - Add a new global name to the compile unit.
|
||||
void DwarfUnit::addGlobalName(StringRef Name, DIE *Die, DIScope Context) {
|
||||
if (getCUNode().getEmissionKind() == DIBuilder::LineTablesOnly)
|
||||
|
@ -102,9 +102,6 @@ protected:
|
||||
/// GlobalTypes - A map of globally visible types for this unit.
|
||||
StringMap<const DIE *> GlobalTypes;
|
||||
|
||||
/// AccelTypes - A map of names for the type accelerator table.
|
||||
StringMap<std::vector<std::pair<const DIE *, unsigned> > > AccelTypes;
|
||||
|
||||
/// DIEBlocks - A list of all the DIEBlocks in use.
|
||||
std::vector<DIEBlock *> DIEBlocks;
|
||||
|
||||
@ -222,11 +219,6 @@ public:
|
||||
const StringMap<const DIE *> &getGlobalNames() const { return GlobalNames; }
|
||||
const StringMap<const DIE *> &getGlobalTypes() const { return GlobalTypes; }
|
||||
|
||||
const StringMap<std::vector<std::pair<const DIE *, unsigned> > > &
|
||||
getAccelTypes() const {
|
||||
return AccelTypes;
|
||||
}
|
||||
|
||||
unsigned getDebugInfoOffset() const { return DebugInfoOffset; }
|
||||
void setDebugInfoOffset(unsigned DbgInfoOff) { DebugInfoOffset = DbgInfoOff; }
|
||||
|
||||
@ -260,9 +252,6 @@ public:
|
||||
/// addAccelNamespace - Add a new name to the namespace accelerator table.
|
||||
void addAccelNamespace(StringRef Name, const DIE *Die);
|
||||
|
||||
/// addAccelType - Add a new type to the type accelerator table.
|
||||
void addAccelType(StringRef Name, std::pair<const DIE *, unsigned> Die);
|
||||
|
||||
/// getDIE - Returns the debug information entry map slot for the
|
||||
/// specified debug variable. We delegate the request to DwarfDebug
|
||||
/// when the MDNode can be part of the type system, since DIEs for
|
||||
|
Loading…
Reference in New Issue
Block a user