changes to support createFunction() with DICompositeType argument in LLVM_3_4

This commit is contained in:
Ilia Filippov
2013-06-04 15:48:39 +04:00
parent 92f591b4bd
commit 560acd5017
2 changed files with 13 additions and 1 deletions

10
ctx.cpp
View File

@@ -344,6 +344,14 @@ FunctionEmitContext::FunctionEmitContext(Function *func, Symbol *funSym,
AssertPos(currentPos, diSubprogramType.Verify());
}
#if defined(LLVM_3_4)
Assert(diSubprogramType.isCompositeType());
llvm::DICompositeType diSubprogramType_n =
static_cast<llvm::DICompositeType>(diSubprogramType);
#else
llvm::DIType diSubprogramType_n = diSubprogramType;
#endif
std::string mangledName = llvmFunction->getName();
if (mangledName == funSym->name)
mangledName = "";
@@ -356,7 +364,7 @@ FunctionEmitContext::FunctionEmitContext(Function *func, Symbol *funSym,
diSubprogram =
m->diBuilder->createFunction(diFile /* scope */, funSym->name,
mangledName, diFile,
firstLine, diSubprogramType,
firstLine, diSubprogramType_n,
isStatic, true, /* is defn */
firstLine,
flags,