From: Devang Patel Date: Wed, 8 Apr 2009 22:18:45 +0000 (+0000) Subject: If subprogram type is not tagged as DW_TAG_subroutine_type then use it directly as... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=75b2738d7397639490e6dca231335925f74b8fac;p=oota-llvm.git If subprogram type is not tagged as DW_TAG_subroutine_type then use it directly as a return value type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68647 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp index ab4fe728bf0..b96babf1d34 100644 --- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp @@ -1900,8 +1900,9 @@ private: DIArray Args = SPTy.getTypeArray(); // Add Return Type. + unsigned SPTag = SPTy.getTag(); if (!IsConstructor) { - if (Args.isNull()) + if (Args.isNull() || SPTag != DW_TAG_subroutine_type) AddType(DW_Unit, SPDie, SPTy); else AddType(DW_Unit, SPDie, DIType(Args.getElement(0).getGV())); @@ -1912,7 +1913,7 @@ private: // Add arguments. // Do not add arguments for subprogram definition. They will be // handled through RecordVariable. - if (!Args.isNull()) + if (SPTag == DW_TAG_subroutine_type) for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { DIE *Arg = new DIE(DW_TAG_formal_parameter); AddType(DW_Unit, Arg, DIType(Args.getElement(i).getGV()));