From 1af71fa536c244c5dff4d8b39c99379d992d1068 Mon Sep 17 00:00:00 2001 From: kai Date: Fri, 24 May 2013 07:01:58 +0200 Subject: [PATCH] Fix LLVM 3.4 change to DIBuilder.createFunction(). DIBuilder.createFunction() now requires the return type to be of subroutine type and consequently needs a DICompositeType. --- gen/todebug.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gen/todebug.cpp b/gen/todebug.cpp index 0ca88df6..95223de6 100644 --- a/gen/todebug.cpp +++ b/gen/todebug.cpp @@ -525,7 +525,12 @@ llvm::DISubprogram DtoDwarfSubProgram(FuncDeclaration* fd) llvm::SmallVector Elts; Elts.push_back(dwarfTypeDescription(retType, NULL)); llvm::DIArray EltTypeArray = gIR->dibuilder.getOrCreateArray(Elts); - llvm::DIType DIFnType = gIR->dibuilder.createSubroutineType(file, EltTypeArray); +#if LDC_LLVM_VER >= 304 + llvm::DICompositeType +#else + llvm::DIType +#endif + DIFnType = gIR->dibuilder.createSubroutineType(file, EltTypeArray); // FIXME: duplicates ? return gIR->dibuilder.createFunction( @@ -562,7 +567,12 @@ llvm::DISubprogram DtoDwarfSubProgramInternal(const char* prettyname, const char llvm::SmallVector Elts; Elts.push_back(llvm::DIType(NULL)); llvm::DIArray EltTypeArray = gIR->dibuilder.getOrCreateArray(Elts); - llvm::DIType DIFnType = gIR->dibuilder.createSubroutineType(file, EltTypeArray); +#if LDC_LLVM_VER >= 304 + llvm::DICompositeType +#else + llvm::DIType +#endif + DIFnType = gIR->dibuilder.createSubroutineType(file, EltTypeArray); // FIXME: duplicates ? return gIR->dibuilder.createFunction(