diff options
author | Eric Christopher <echristo@gmail.com> | 2013-05-14 21:33:10 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-05-14 21:33:10 +0000 |
commit | 4d7f2ce93860bb587412c0d5bb572e7bdf7eaa96 (patch) | |
tree | 34fdc1a469bc984615fee66b5cbb71a351f84e45 /lib/CodeGen/AsmPrinter | |
parent | 95ab32667456b13ad56634cc7554cde8a50db95a (diff) | |
download | external_llvm-4d7f2ce93860bb587412c0d5bb572e7bdf7eaa96.zip external_llvm-4d7f2ce93860bb587412c0d5bb572e7bdf7eaa96.tar.gz external_llvm-4d7f2ce93860bb587412c0d5bb572e7bdf7eaa96.tar.bz2 |
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
Diffstat (limited to 'lib/CodeGen/AsmPrinter')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DIE.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DIE.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/AsmPrinter/DIE.cpp b/lib/CodeGen/AsmPrinter/DIE.cpp index 673867a..cc0cb56 100644 --- a/lib/CodeGen/AsmPrinter/DIE.cpp +++ b/lib/CodeGen/AsmPrinter/DIE.cpp @@ -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; diff --git a/lib/CodeGen/AsmPrinter/DIE.h b/lib/CodeGen/AsmPrinter/DIE.h index d8fa1f5..550d873 100644 --- a/lib/CodeGen/AsmPrinter/DIE.h +++ b/lib/CodeGen/AsmPrinter/DIE.h @@ -153,7 +153,7 @@ namespace llvm { DIE *getParent() const { return Parent; } /// Climb up the parent chain to get the compile unit DIE this DIE belongs /// to. - DIE *getCompileUnit() const; + DIE *getCompileUnit(); void setTag(unsigned Tag) { Abbrev.setTag(Tag); } void setOffset(unsigned O) { Offset = O; } void setSize(unsigned S) { Size = S; } |