llvm.org GIT mirror llvm / 4d7f2ce
Make getCompileUnit non-const and return the current DIE if it happens to be a compile unit. Noticed on inspection and tested via calling on a newly created compile unit. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181835 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 7 years ago
2 changed file(s) with 3 addition(s) and 3 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 {
117 DIE *p = getParent();
116 DIE *DIE::getCompileUnit() {
117 DIE *p = this;
118118 while (p) {
119119 if (p->getTag() == dwarf::DW_TAG_compile_unit)
120120 return p;
152152 DIE *getParent() const { return Parent; }
153153 /// Climb up the parent chain to get the compile unit DIE this DIE belongs
154154 /// to.
155 DIE *getCompileUnit() const;
155 DIE *getCompileUnit();
156156 void setTag(unsigned Tag) { Abbrev.setTag(Tag); }
157157 void setOffset(unsigned O) { Offset = O; }
158158 void setSize(unsigned S) { Size = S; }