From 4dc211ae399343312137f0391f5e7d235ab15f24 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Wed, 4 Sep 2013 19:53:21 +0000 Subject: [PATCH] Unify and clean up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189977 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 3e1877dc951..6835f40cd8e 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -143,17 +143,12 @@ DIType DbgVariable::getType() const { DIType subType = Ty; uint16_t tag = Ty.getTag(); - if (tag == dwarf::DW_TAG_pointer_type) { - DIDerivedType DTy = DIDerivedType(Ty); - subType = DTy.getTypeDerivedFrom(); - } - - DICompositeType blockStruct = DICompositeType(subType); - DIArray Elements = blockStruct.getTypeArray(); + if (tag == dwarf::DW_TAG_pointer_type) + subType = DIDerivedType(Ty).getTypeDerivedFrom(); + DIArray Elements = DICompositeType(subType).getTypeArray(); for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { - DIDescriptor Element = Elements.getElement(i); - DIDerivedType DT = DIDerivedType(Element); + DIDerivedType DT = DIDerivedType(Elements.getElement(i)); if (getName() == DT.getName()) return (DT.getTypeDerivedFrom()); }