Skip to content

Commit

Permalink
[debug info] Minor cleanup from D27170/r288399
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288421 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dwblaikie committed Dec 1, 2016
1 parent bc7dc48 commit e348b77
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
5 changes: 0 additions & 5 deletions include/llvm/CodeGen/DIE.h
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,6 @@ class DIE : IntrusiveBackListNode, public DIEValueList {
DIE() = delete;
explicit DIE(dwarf::Tag Tag) : Offset(0), Size(0), Tag(Tag) {}

protected:
void setUnit(DIEUnit *U) {
Owner = U;
}
public:
static DIE *get(BumpPtrAllocator &Alloc, dwarf::Tag Tag) {
return new (Alloc) DIE(Tag);
Expand Down Expand Up @@ -706,7 +702,6 @@ class DIE : IntrusiveBackListNode, public DIEValueList {
//===--------------------------------------------------------------------===//
/// Represents a compile or type unit.
class DIEUnit {
protected:
/// The compile unit or type unit DIE. This variable must be an instance of
/// DIE so that we can calculate the DIEUnit from any DIE by traversing the
/// parent backchain and getting the Unit DIE, and then casting itself to a
Expand Down
2 changes: 1 addition & 1 deletion lib/CodeGen/AsmPrinter/DIE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ DIEUnit::DIEUnit(uint16_t V, uint8_t A, dwarf::Tag UnitTag)
: Die(UnitTag), Section(nullptr), Offset(0), Length(0), Version(V),
AddrSize(A)
{
Die.setUnit(this);
Die.Owner = this;
assert((UnitTag == dwarf::DW_TAG_compile_unit ||
UnitTag == dwarf::DW_TAG_type_unit ||
UnitTag == dwarf::DW_TAG_partial_unit) && "expected a unit TAG");
Expand Down
2 changes: 1 addition & 1 deletion lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class DwarfCompileUnit : public DwarfUnit {
void emitHeader(bool UseOffsets) override;

MCSymbol *getLabelBegin() const {
assert(Section);
assert(getSection());
return LabelBegin;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/CodeGen/AsmPrinter/DwarfUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class RangeSpanList {
const DICompileUnit *getCUNode() const { return CUNode; }

/// Return true if this compile unit has something to write out.
bool hasContent() const { return Die.hasChildren(); }
bool hasContent() const { return getUnitDie().hasChildren(); }

/// Get string containing language specific context for a global name.
///
Expand Down

0 comments on commit e348b77

Please sign in to comment.