It is possible that subprgoram definition is only encoding return value directly...
authorDevang Patel <dpatel@apple.com>
Fri, 27 Feb 2009 18:05:21 +0000 (18:05 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 27 Feb 2009 18:05:21 +0000 (18:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65643 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfWriter.cpp

index cab631524fc3d3f250060c219398c0dea1fc19ff..5c4957aba113f198b0a4a75ea50ca6a98292582e 100644 (file)
@@ -1888,8 +1888,12 @@ private:
     DIArray Args = SPTy.getTypeArray();
     
     // Add Return Type.
-    if (!IsConstructor) 
-      AddType(DW_Unit, SPDie, DIType(Args.getElement(0).getGV()));
+    if (!IsConstructor) {
+      if (Args.isNull()) 
+        AddType(DW_Unit, SPDie, SPTy);
+      else
+        AddType(DW_Unit, SPDie, DIType(Args.getElement(0).getGV()));
+    }
 
     if (!SP.isDefinition()) {
       AddUInt(SPDie, DW_AT_declaration, DW_FORM_flag, 1);