diff options
author | Manman Ren <manman.ren@gmail.com> | 2013-10-08 19:07:44 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2013-10-08 19:07:44 +0000 |
commit | 8199f0bc7722a4d93099cafdb30fa465a2746ce8 (patch) | |
tree | aec6a3916e12dccc7ea2b8ee1f469b568d0bc676 /lib/CodeGen | |
parent | 43251008c2ce836f47a6e4c8a64947069d6b268e (diff) | |
download | external_llvm-8199f0bc7722a4d93099cafdb30fa465a2746ce8.zip external_llvm-8199f0bc7722a4d93099cafdb30fa465a2746ce8.tar.gz external_llvm-8199f0bc7722a4d93099cafdb30fa465a2746ce8.tar.bz2 |
Add DbgVariable::resolve per Eric's suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192218 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 11 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.h | 5 |
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 71838bd..cfe4ea6 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -116,6 +116,13 @@ static const unsigned InitAbbreviationsSetSize = 9; // log2(512) namespace llvm { +/// resolve - Look in the DwarfDebug map for the MDNode that +/// corresponds to the reference. +template <typename T> +T DbgVariable::resolve(DIRef<T> Ref) const { + return DD->resolve(Ref); +} + DIType DbgVariable::getType() const { DIType Ty = Var.getType(); // FIXME: isBlockByrefVariable should be reformulated in terms of complex @@ -149,13 +156,13 @@ DIType DbgVariable::getType() const { uint16_t tag = Ty.getTag(); if (tag == dwarf::DW_TAG_pointer_type) - subType = DD->resolve(DIDerivedType(Ty).getTypeDerivedFrom()); + subType = resolve(DIDerivedType(Ty).getTypeDerivedFrom()); DIArray Elements = DICompositeType(subType).getTypeArray(); for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { DIDerivedType DT = DIDerivedType(Elements.getElement(i)); if (getName() == DT.getName()) - return (DD->resolve(DT.getTypeDerivedFrom())); + return (resolve(DT.getTypeDerivedFrom())); } } return Ty; diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index e8ca9d2..6d22f27 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -209,6 +209,11 @@ public: return Var.getAddrElement(i); } DIType getType() const; + +private: + /// resolve - Look in the DwarfDebug map for the MDNode that + /// corresponds to the reference. + template <typename T> T resolve(DIRef<T> Ref) const; }; /// \brief Collects and handles information specific to a particular |