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
This commit is contained in:
Devang Patel 2009-04-08 22:18:45 +00:00
parent 094fad37b9
commit 75b2738d73

View File

@ -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()));