llvm.org GIT mirror llvm / 30cb836
Remove unnecessary instance variable and rework logic accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181227 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 7 years ago
2 changed file(s) with 5 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
113113
114114 /// Climb up the parent chain to get the compile unit DIE to which this DIE
115115 /// belongs.
116 DIE *DIE::getCompileUnit() const{
116 DIE *DIE::getCompileUnit() const {
117117 DIE *p = getParent();
118118 while (p) {
119119 if (p->getTag() == dwarf::DW_TAG_compile_unit)
124124 }
125125
126126 #ifndef NDEBUG
127 void DIE::print(raw_ostream &O, unsigned IncIndent) {
128 IndentCount += IncIndent;
127 void DIE::print(raw_ostream &O, unsigned IndentCount) const {
129128 const std::string Indent(IndentCount, ' ');
130129 bool isBlock = Abbrev.getTag() == 0;
131130
164163 IndentCount -= 2;
165164
166165 for (unsigned j = 0, M = Children.size(); j < M; ++j) {
167 Children[j]->print(O, 4);
166 Children[j]->print(O, IndentCount+4);
168167 }
169168
170169 if (!isBlock) O << "\n";
171 IndentCount -= IncIndent;
172170 }
173171
174172 void DIE::dump() {
138138 mutable unsigned IndentCount;
139139 public:
140140 explicit DIE(unsigned Tag)
141 : Offset(0), Size(0), Abbrev(Tag, dwarf::DW_CHILDREN_no), Parent(0),
142 IndentCount(0) {}
141 : Offset(0), Size(0), Abbrev(Tag, dwarf::DW_CHILDREN_no), Parent(0) {}
143142 virtual ~DIE();
144143
145144 // Accessors.
178177 }
179178
180179 #ifndef NDEBUG
181 void print(raw_ostream &O, unsigned IncIndent = 0);
180 void print(raw_ostream &O, unsigned IndentCount = 0) const;
182181 void dump();
183182 #endif
184183 };