: Var(V), Expr(1, E), TheDIE(nullptr), DotDebugLocOffset(~0U),
MInsn(nullptr), DD(DD) {
FrameIndex.push_back(FI);
- assert(Var.Verify() && E.Verify());
+ assert(!E || E->isValid());
}
/// Construct a DbgVariable from a DEBUG_VALUE.
DIE *getDIE() const { return TheDIE; }
void setDotDebugLocOffset(unsigned O) { DotDebugLocOffset = O; }
unsigned getDotDebugLocOffset() const { return DotDebugLocOffset; }
- StringRef getName() const { return Var.getName(); }
+ StringRef getName() const { return Var->getName(); }
const MachineInstr *getMInsn() const { return MInsn; }
const ArrayRef<int> getFrameIndex() const { return FrameIndex; }
FrameIndex.append(FI.begin(), FI.end());
}
assert(Expr.size() > 1
- ? std::all_of(Expr.begin(), Expr.end(),
- [](DIExpression &E) { return E.isBitPiece(); })
- : (true && "conflicting locations for variable"));
+ ? std::all_of(Expr.begin(), Expr.end(),
+ [](DIExpression &E) { return E->isBitPiece(); })
+ : (true && "conflicting locations for variable"));
}
// Translate tag to proper Dwarf tag.
dwarf::Tag getTag() const {
- if (Var.getTag() == dwarf::DW_TAG_arg_variable)
+ if (Var->getTag() == dwarf::DW_TAG_arg_variable)
return dwarf::DW_TAG_formal_parameter;
return dwarf::DW_TAG_variable;
}
/// \brief Return true if DbgVariable is artificial.
bool isArtificial() const {
- if (Var.isArtificial())
+ if (Var->isArtificial())
return true;
if (getType().isArtificial())
return true;
}
bool isObjectPointer() const {
- if (Var.isObjectPointer())
+ if (Var->isObjectPointer())
return true;
if (getType().isObjectPointer())
return true;
}
bool variableHasComplexAddress() const {
- assert(Var.isVariable() && "Invalid complex DbgVariable!");
+ assert(Var && "Invalid complex DbgVariable!");
assert(Expr.size() == 1 &&
"variableHasComplexAddress() invoked on multi-FI variable");
- return Expr.back().getNumElements() > 0;
+ return Expr.back()->getNumElements() > 0;
}
bool isBlockByrefVariable() const;
DIType getType() const;
// table for the same directory as DW_AT_comp_dir.
StringRef CompilationDir;
- // Counter for assigning globally unique IDs for ranges.
- unsigned GlobalRangeCount;
-
// Holder for the file specific debug information.
DwarfFile InfoHolder;
/// \brief Construct a DIE for this abstract scope.
void constructAbstractSubprogramScopeDIE(LexicalScope *Scope);
- /// \brief Emit initial Dwarf sections with a label at the start of each one.
- void emitSectionLabels();
-
/// \brief Compute the size and offset of a DIE given an incoming Offset.
unsigned computeSizeAndOffset(DIE *Die, unsigned Offset);
/// \brief Emit the abbreviation section.
void emitAbbreviations();
- /// \brief Emit the last address of the section and the end of
- /// the line matrix.
- void emitEndOfLineMatrix(unsigned SectionEnd);
-
/// \brief Emit a specified accelerator table.
void emitAccel(DwarfAccelTable &Accel, const MCSection *Section,
StringRef TableName);
template <typename T> T resolve(DIRef<T> Ref) const {
return Ref.resolve(TypeIdentifierMap);
}
+ template <typename T> T *resolve(TypedDebugNodeRef<T> Ref) const {
+ return Ref.resolve(TypeIdentifierMap);
+ }
/// \brief Return the TypeIdentifierMap.
const DITypeIdentifierMap &getTypeIdentifierMap() const {
/// \brief Return Label immediately following the instruction.
MCSymbol *getLabelAfterInsn(const MachineInstr *MI);
- // FIXME: Consider rolling ranges up into DwarfDebug since we use a single
- // range_base anyway, so there's no need to keep them as separate per-CU range
- // lists. (though one day we might end up with a range.dwo section, in which
- // case it'd go to DwarfFile)
- unsigned getNextRangeNumber() { return GlobalRangeCount++; }
-
// FIXME: Sink these functions down into DwarfFile/Dwarf*Unit.
SmallPtrSet<const MDNode *, 16> &getProcessedSPNodes() {