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.
This commit is contained in:
kai 2013-05-24 07:01:58 +02:00
parent 6e57b6c213
commit 1af71fa536

View file

@ -525,7 +525,12 @@ llvm::DISubprogram DtoDwarfSubProgram(FuncDeclaration* fd)
llvm::SmallVector<llvm::Value*, 16> 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<llvm::Value*, 1> 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(