Make getCompileUnit non-const and return the current DIE if it
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DIE.cpp
index 673867ada1a24a3e4199a054dd3940fce0a9dca1..cc0cb56e8b366400b127af0b1941f6b08b6c9174 100644 (file)
@@ -114,8 +114,8 @@ DIE::~DIE() {
 
 /// Climb up the parent chain to get the compile unit DIE to which this DIE
 /// belongs.
-DIE *DIE::getCompileUnit() const {
-  DIE *p = getParent();
+DIE *DIE::getCompileUnit() {
+  DIE *p = this;
   while (p) {
     if (p->getTag() == dwarf::DW_TAG_compile_unit)
       return p;