Debuginfo: Fix nested variables (primarily for CodeView) (#2909)

We've been going back and forth between GEPs and complex DWARF
expressions based on the context pointer; this goes back to the latter,
as that fixes simple nested variables for CodeView with LLVM >= 6.

I guess it also helps for debuginfos of nested vars with enabled
optimizations.
This commit is contained in:
Martin Kinkelin 2018-11-20 20:44:47 +01:00 committed by GitHub
parent 78d6fb3bb8
commit 32b6e49a65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 54 deletions

View file

@ -206,7 +206,11 @@ public:
uint64_t offset =
gDataLayout->getStructLayout(type)->getElementOffset(index);
#if LDC_LLVM_VER >= 500
addr.push_back(llvm::dwarf::DW_OP_plus_uconst);
#else
addr.push_back(llvm::dwarf::DW_OP_plus);
#endif
addr.push_back(offset);
}