From dce378ba75021e16413edbf7e5b16a0122dec76f Mon Sep 17 00:00:00 2001 From: kai Date: Sat, 23 Mar 2013 16:21:21 +0100 Subject: [PATCH] Return type must be of type DIComposite. --- gen/todebug.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gen/todebug.cpp b/gen/todebug.cpp index d5e5488d..0ca88df6 100644 --- a/gen/todebug.cpp +++ b/gen/todebug.cpp @@ -558,6 +558,12 @@ llvm::DISubprogram DtoDwarfSubProgramInternal(const char* prettyname, const char llvm::DIFile file(DtoDwarfFile(Loc(gIR->dmodule, 0))); + // Create "dummy" subroutine type for the return type + llvm::SmallVector Elts; + Elts.push_back(llvm::DIType(NULL)); + llvm::DIArray EltTypeArray = gIR->dibuilder.getOrCreateArray(Elts); + llvm::DIType DIFnType = gIR->dibuilder.createSubroutineType(file, EltTypeArray); + // FIXME: duplicates ? return gIR->dibuilder.createFunction( llvm::DIDescriptor(file), // context @@ -565,7 +571,7 @@ llvm::DISubprogram DtoDwarfSubProgramInternal(const char* prettyname, const char mangledname, // linkage name file, // file 0, // line no - llvm::DIType(NULL), // return type. TODO: fill it up + DIFnType, // return type. TODO: fill it up true, // is local to unit true // isdefinition #if LDC_LLVM_VER >= 301