mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 16:41:06 +03:00
Fix debuginfo generation for the local variable frame for a function with nested functions.
Declare debuginfo directly on the GEP instead of on the frame alloca+offset, . An explicit DW_OP_deref is necessary (tested in LLDB). Resolves an ICE introduced by PR #1598.
This commit is contained in:
parent
6b647bfb0a
commit
197b63a04f
4 changed files with 7 additions and 5 deletions
|
@ -507,8 +507,10 @@ void DtoCreateNestedContext(FuncDeclaration *fd) {
|
|||
#else
|
||||
LLSmallVector<LLValue *, 2> addr;
|
||||
#endif
|
||||
gIR->DBuilder.OpOffset(addr, frameType, irLocal->nestedIndex);
|
||||
gIR->DBuilder.EmitLocalVariable(frame, vd, nullptr, false, false, addr);
|
||||
// Because we are passing a GEP instead of an alloca to
|
||||
// llvm.dbg.declare, we have to make the address dereference explicit.
|
||||
gIR->DBuilder.OpDeref(addr);
|
||||
gIR->DBuilder.EmitLocalVariable(gep, vd, nullptr, false, false, addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue