summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-04-08 22:18:45 +0000
committerDevang Patel <dpatel@apple.com>2009-04-08 22:18:45 +0000
commit3396d7ef9d2fbebcf06552a517cdd1d86d777ac4 (patch)
tree0c871b5a4fd03da7ca911992a7abe809d2719f2f /llvm/lib/CodeGen
parent9c9f742ee250def58de0f79345b26584e89c54fa (diff)
downloadbcm5719-llvm-3396d7ef9d2fbebcf06552a517cdd1d86d777ac4.tar.gz
bcm5719-llvm-3396d7ef9d2fbebcf06552a517cdd1d86d777ac4.zip
If subprogram type is not tagged as DW_TAG_subroutine_type then use it directly as a return value type.
llvm-svn: 68647
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
index ab4fe728bf0..b96babf1d34 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
+++ b/llvm/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()));
OpenPOWER on IntegriCloud