summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-23 23:37:35 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-23 23:37:35 +0000
commit2406a0627c15514085678527db7db0972b9f5a74 (patch)
treef5263eba6345592eee97bec9a268ef78e0047104 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parentbd5d3082c419c6996a5ce50d027689ebff0bcbd1 (diff)
downloadbcm5719-llvm-2406a0627c15514085678527db7db0972b9f5a74.tar.gz
bcm5719-llvm-2406a0627c15514085678527db7db0972b9f5a74.zip
Remove intermediate accelerator table for names.
(similar changes coming for the other accelerator tables) llvm-svn: 207049
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 61c853f0614..19a37c0a7a1 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -15,7 +15,6 @@
#include "DwarfDebug.h"
#include "DIE.h"
#include "DIEHash.h"
-#include "DwarfAccelTable.h"
#include "DwarfUnit.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Statistic.h"
@@ -169,7 +168,9 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
: Asm(A), MMI(Asm->MMI), FirstCU(0), PrevLabel(NULL), GlobalRangeCount(0),
InfoHolder(A, "info_string", DIEValueAllocator),
UsedNonDefaultText(false),
- SkeletonHolder(A, "skel_string", DIEValueAllocator) {
+ SkeletonHolder(A, "skel_string", DIEValueAllocator),
+ AccelNames(DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset,
+ dwarf::DW_FORM_data4)) {
DwarfInfoSectionSym = DwarfAbbrevSectionSym = DwarfStrSectionSym = 0;
DwarfDebugRangeSectionSym = DwarfDebugLocSectionSym = DwarfLineSectionSym = 0;
@@ -260,15 +261,15 @@ static bool SectionSort(const MCSection *A, const MCSection *B) {
// TODO: Determine whether or not we should add names for programs
// that do not have a DW_AT_name or DW_AT_linkage_name field - this
// is only slightly different than the lookup of non-standard ObjC names.
-static void addSubprogramNames(DwarfUnit &TheU, DISubprogram SP, DIE *Die) {
+void DwarfDebug::addSubprogramNames(DwarfUnit &TheU, DISubprogram SP, DIE *Die) {
if (!SP.isDefinition())
return;
- TheU.addAccelName(SP.getName(), Die);
+ addAccelName(SP.getName(), Die);
// If the linkage name is different than the name, go ahead and output
// that as well into the name table.
if (SP.getLinkageName() != "" && SP.getName() != SP.getLinkageName())
- TheU.addAccelName(SP.getLinkageName(), Die);
+ addAccelName(SP.getLinkageName(), Die);
// If this is an Objective-C selector name add it to the ObjC accelerator
// too.
@@ -279,7 +280,7 @@ static void addSubprogramNames(DwarfUnit &TheU, DISubprogram SP, DIE *Die) {
if (Category != "")
TheU.addAccelObjC(Category, Die);
// Also add the base method name to the name table.
- TheU.addAccelName(getObjCMethodName(SP.getName()), Die);
+ addAccelName(getObjCMethodName(SP.getName()), Die);
}
}
@@ -2566,3 +2567,14 @@ void DwarfDebug::attachLowHighPC(DwarfCompileUnit &Unit, DIE *D,
else
Unit.addLabelDelta(D, dwarf::DW_AT_high_pc, End, Begin);
}
+
+// Accelerator table mutators - add each name along with its companion
+// DIE to the proper table while ensuring that the name that we're going
+// to reference is in the string table. We do this since the names we
+// add may not only be identical to the names in the DIE.
+void DwarfDebug::addAccelName(StringRef Name, const DIE *Die) {
+ if (!useDwarfAccelTables())
+ return;
+ InfoHolder.getStringPoolEntry(Name);
+ AccelNames.AddName(Name, Die);
+}
OpenPOWER on IntegriCloud