[llvm-commits] [llvm] r68647 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
Devang Patel
dpatel at apple.com
Wed Apr 8 15:18:46 PDT 2009
Author: dpatel
Date: Wed Apr 8 17:18:45 2009
New Revision: 68647
URL: http://llvm.org/viewvc/llvm-project?rev=68647&view=rev
Log:
If subprogram type is not tagged as DW_TAG_subroutine_type then use it directly as a return value type.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=68647&r1=68646&r2=68647&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Wed Apr 8 17:18:45 2009
@@ -1900,8 +1900,9 @@
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 @@
// 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()));
More information about the llvm-commits
mailing list