summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-12-09 17:51:30 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-12-09 17:51:30 +0000
commitc3b96bacc8109c55ebf1fcee6c3af618e842349c (patch)
tree2d630442b30a532034e20349883d48bb6dfb74b9
parent1a803295d08f1d562b4cebcb830edd874ec16d79 (diff)
downloadllvm-c3b96bacc8109c55ebf1fcee6c3af618e842349c.tar.gz
llvm-c3b96bacc8109c55ebf1fcee6c3af618e842349c.tar.bz2
llvm-c3b96bacc8109c55ebf1fcee6c3af618e842349c.tar.xz
DwarfDebug/Unit: Remove another case of label recreation by storing the gnu_ranges label in the unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196793 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp10
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfUnit.h10
2 files changed, 14 insertions, 6 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 14d784e8a2..1032f941f2 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2901,10 +2901,9 @@ void DwarfDebug::emitDebugRanges() {
E = CUMap.end();
I != E; ++I) {
CompileUnit *TheCU = I->second;
- unsigned ID = TheCU->getUniqueID();
// Emit a symbol so we can find the beginning of our ranges.
- Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("gnu_ranges", ID));
+ Asm->OutStreamer.EmitLabel(TheCU->getLabelRange());
// Iterate over the misc ranges for the compile units in the module.
const SmallVectorImpl<RangeSpanList> &RangeLists = TheCU->getRangeLists();
@@ -2958,6 +2957,8 @@ CompileUnit *DwarfDebug::constructSkeletonCU(const CompileUnit *CU) {
DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
CompileUnit *NewCU = new CompileUnit(CU->getUniqueID(), Die, CU->getNode(),
Asm, this, &SkeletonHolder);
+ NewCU->initSection(Asm->getObjFileLowering().getDwarfInfoSection(),
+ DwarfInfoSectionSym);
NewCU->addLocalString(Die, dwarf::DW_AT_GNU_dwo_name,
CU->getNode().getSplitDebugFilename());
@@ -2992,11 +2993,8 @@ CompileUnit *DwarfDebug::constructSkeletonCU(const CompileUnit *CU) {
// unit.
if (!CU->getRangeLists().empty())
addSectionLabel(Asm, NewCU, Die, dwarf::DW_AT_GNU_ranges_base,
- Asm->GetTempSymbol("gnu_ranges", NewCU->getUniqueID()),
- DwarfDebugRangeSectionSym);
+ NewCU->getLabelRange(), DwarfDebugRangeSectionSym);
- NewCU->initSection(Asm->getObjFileLowering().getDwarfInfoSection(),
- DwarfInfoSectionSym);
SkeletonHolder.addUnit(NewCU);
return NewCU;
diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.h b/lib/CodeGen/AsmPrinter/DwarfUnit.h
index 0ffaacf02a..98415548fc 100644
--- a/lib/CodeGen/AsmPrinter/DwarfUnit.h
+++ b/lib/CodeGen/AsmPrinter/DwarfUnit.h
@@ -140,6 +140,9 @@ protected:
/// The end of the unit within its section.
MCSymbol *LabelEnd;
+ /// The label for the start of the range sets for the elements of this unit.
+ MCSymbol *LabelRange;
+
Unit(unsigned UID, DIE *D, DICompileUnit CU, AsmPrinter *A, DwarfDebug *DW,
DwarfFile *DWU);
@@ -157,7 +160,9 @@ public:
Asm->GetTempSymbol(Section->getLabelBeginName(), getUniqueID());
this->LabelEnd =
Asm->GetTempSymbol(Section->getLabelEndName(), getUniqueID());
+ this->LabelRange = Asm->GetTempSymbol("gnu_ranges", getUniqueID());
}
+
const MCSection *getSection() const {
assert(Section);
return Section;
@@ -178,6 +183,11 @@ public:
return LabelEnd;
}
+ MCSymbol *getLabelRange() const {
+ assert(Section);
+ return LabelRange;
+ }
+
// Accessors.
unsigned getUniqueID() const { return UniqueID; }
virtual uint16_t getLanguage() const = 0;