Fix generation of DWARF debug information in LLVM 3.6.

The creation of complex expressions (e.g. address calculations) was extended in LLVM 3.6.
This commit is contained in:
kai 2014-10-12 12:40:31 +02:00
parent cb320d9a3f
commit b3e239a527
3 changed files with 60 additions and 8 deletions

View file

@ -79,7 +79,11 @@ DValue* DtoNestedVariable(Loc& loc, Type* astype, VarDeclaration* vd, bool byref
}
LLValue *dwarfValue = 0;
#if LDC_LLVM_VER >= 306
std::vector<int64_t> dwarfAddr;
#else
std::vector<LLValue*> dwarfAddr;
#endif
// get the nested context
LLValue* ctx = 0;
@ -497,7 +501,11 @@ void DtoCreateNestedContext(FuncDeclaration* fd) {
}
if (global.params.symdebug) {
#if LDC_LLVM_VER >= 306
LLSmallVector<int64_t, 2> addr;
#else
LLSmallVector<LLValue*, 2> addr;
#endif
gIR->DBuilder.OpOffset(addr, frameType, irLocal->nestedIndex);
gIR->DBuilder.EmitLocalVariable(frame, vd, addr);
}