summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-11-01 18:18:07 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-11-01 18:18:07 +0000
commit7cbf58af15ec656bd885cddec1349759870601b7 (patch)
tree5028bece64b70c2fe6837f60b442cddd8e69a81e /llvm/lib/CodeGen
parent853c2435b69b5348120d458da46973f0130c767c (diff)
downloadbcm5719-llvm-7cbf58af15ec656bd885cddec1349759870601b7.tar.gz
bcm5719-llvm-7cbf58af15ec656bd885cddec1349759870601b7.zip
Sink DwarfUnit::Skeleton down into DwarfCompileUnit
Type units no longer have skeletons and it's misleading to be able to query for a type unit's skeleton (it might incorrectly lead one to conclude that if a unit doesn't have a skeleton it's not in a .dwo file... ). llvm-svn: 221055
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp3
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h22
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp3
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h22
4 files changed, 25 insertions, 25 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 6571b54cfcf..d214e36677f 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -18,7 +18,8 @@ namespace llvm {
DwarfCompileUnit::DwarfCompileUnit(unsigned UID, DICompileUnit Node,
AsmPrinter *A, DwarfDebug *DW,
DwarfFile *DWU)
- : DwarfUnit(UID, dwarf::DW_TAG_compile_unit, Node, A, DW, DWU) {
+ : DwarfUnit(UID, dwarf::DW_TAG_compile_unit, Node, A, DW, DWU),
+ Skeleton(nullptr) {
insertDIE(Node, &getUnitDie());
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
index 9805fb4874e..0fb3bb47379 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
@@ -33,6 +33,9 @@ class DwarfCompileUnit : public DwarfUnit {
/// the need to search for it in applyStmtList.
unsigned stmtListIndex;
+ /// Skeleton unit associated with this unit.
+ DwarfUnit *Skeleton;
+
/// \brief Construct a DIE for the given DbgVariable without initializing the
/// DbgVariable's DIE reference.
std::unique_ptr<DIE> constructVariableDIEImpl(const DbgVariable &DV,
@@ -134,6 +137,25 @@ public:
void finishSubprogramDefinition(DISubprogram SP);
void collectDeadVariables(DISubprogram SP);
+
+ /// If there's a skeleton then return the begin label for the skeleton unit,
+ /// otherwise return the local label for this unit.
+ MCSymbol *getLocalLabelBegin() const {
+ if (Skeleton)
+ return Skeleton->getLabelBegin();
+ return getLabelBegin();
+ }
+
+ /// If there's a skeleton then return the section symbol for the skeleton
+ /// unit, otherwise return the section symbol for this unit.
+ MCSymbol *getLocalSectionSym() const {
+ if (Skeleton)
+ return Skeleton->getSectionSym();
+ return getSectionSym();
+ }
+
+ /// Set the skeleton unit associated with this unit.
+ void setSkeleton(DwarfUnit &Skel) { Skeleton = &Skel; }
};
} // end llvm namespace
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index 65ec21c92f3..902c9c248c5 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -47,8 +47,7 @@ GenerateDwarfTypeUnits("generate-type-units", cl::Hidden,
DwarfUnit::DwarfUnit(unsigned UID, dwarf::Tag UnitTag, DICompileUnit Node,
AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
: UniqueID(UID), CUNode(Node), UnitDie(UnitTag), DebugInfoOffset(0), Asm(A),
- DD(DW), DU(DWU), IndexTyDie(nullptr), Section(nullptr),
- Skeleton(nullptr) {
+ DD(DW), DU(DWU), IndexTyDie(nullptr), Section(nullptr) {
assert(UnitTag == dwarf::DW_TAG_compile_unit ||
UnitTag == dwarf::DW_TAG_type_unit);
DIEIntegerOne = new (DIEValueAllocator) DIEInteger(1);
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
index e5e4c64edc3..5c05ca0b428 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
@@ -138,18 +138,12 @@ protected:
/// The end of the unit within its section.
MCSymbol *LabelEnd;
- /// Skeleton unit associated with this unit.
- DwarfUnit *Skeleton;
-
DwarfUnit(unsigned UID, dwarf::Tag, DICompileUnit CU, AsmPrinter *A,
DwarfDebug *DW, DwarfFile *DWU);
public:
virtual ~DwarfUnit();
- /// Set the skeleton unit associated with this unit.
- void setSkeleton(DwarfUnit &Skel) { Skeleton = &Skel; }
-
/// Pass in the SectionSym even though we could recreate it in every compile
/// unit (type units will have actually distinct symbols once they're in
/// comdat sections).
@@ -168,27 +162,11 @@ public:
return Section;
}
- /// If there's a skeleton then return the section symbol for the skeleton
- /// unit, otherwise return the section symbol for this unit.
- MCSymbol *getLocalSectionSym() const {
- if (Skeleton)
- return Skeleton->getSectionSym();
- return getSectionSym();
- }
-
MCSymbol *getSectionSym() const {
assert(Section);
return SectionSym;
}
- /// If there's a skeleton then return the begin label for the skeleton unit,
- /// otherwise return the local label for this unit.
- MCSymbol *getLocalLabelBegin() const {
- if (Skeleton)
- return Skeleton->getLabelBegin();
- return getLabelBegin();
- }
-
MCSymbol *getLabelBegin() const {
assert(Section);
return LabelBegin;
OpenPOWER on IntegriCloud