git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181227
91177308-0d34-0410-b5e6-
96231b3b80d8
/// Climb up the parent chain to get the compile unit DIE to which this DIE
/// belongs.
/// Climb up the parent chain to get the compile unit DIE to which this DIE
/// belongs.
-DIE *DIE::getCompileUnit() const{
+DIE *DIE::getCompileUnit() const {
DIE *p = getParent();
while (p) {
if (p->getTag() == dwarf::DW_TAG_compile_unit)
DIE *p = getParent();
while (p) {
if (p->getTag() == dwarf::DW_TAG_compile_unit)
-void DIE::print(raw_ostream &O, unsigned IncIndent) {
- IndentCount += IncIndent;
+void DIE::print(raw_ostream &O, unsigned IndentCount) const {
const std::string Indent(IndentCount, ' ');
bool isBlock = Abbrev.getTag() == 0;
const std::string Indent(IndentCount, ' ');
bool isBlock = Abbrev.getTag() == 0;
IndentCount -= 2;
for (unsigned j = 0, M = Children.size(); j < M; ++j) {
IndentCount -= 2;
for (unsigned j = 0, M = Children.size(); j < M; ++j) {
- Children[j]->print(O, 4);
+ Children[j]->print(O, IndentCount+4);
}
if (!isBlock) O << "\n";
}
if (!isBlock) O << "\n";
- IndentCount -= IncIndent;
mutable unsigned IndentCount;
public:
explicit DIE(unsigned Tag)
mutable unsigned IndentCount;
public:
explicit DIE(unsigned Tag)
- : Offset(0), Size(0), Abbrev(Tag, dwarf::DW_CHILDREN_no), Parent(0),
- IndentCount(0) {}
+ : Offset(0), Size(0), Abbrev(Tag, dwarf::DW_CHILDREN_no), Parent(0) {}
virtual ~DIE();
// Accessors.
virtual ~DIE();
// Accessors.
- void print(raw_ostream &O, unsigned IncIndent = 0);
+ void print(raw_ostream &O, unsigned IndentCount = 0) const;