[PATCH] D46271: [CodeView] Improve debbuging of virtual base class member variables

Brock Wyma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 30 09:43:53 PDT 2018


bwyma created this revision.
bwyma added reviewers: smerritt, rnk, zturner.
Herald added subscribers: hiraditya, eraman, mehdi_amini.

Right now the virtual base pointer offset for virtual bases is not implemented and hard-coded to zero in CodeViewDebug.cpp.  This patch passes the offset from clang to CodeView where it can be emitted.  The crux of the patch looks like this:

- // FIXME: Emit VBPtrOffset when the frontend provides it.
- unsigned VBPtrOffset = 0; +      unsigned VBPtrOffset = I->getVBPtrOffset();

The rest of the source changes support embedding this single field in the IR and reading/writing it to bitcode.

Inheritance is currently encoded in the IR as a DIDerivedType which is currently reused for several other purposes.  Four tests which have bitcode files containing a DIDerivedType needed to have the bitcode file updated.  Three of these bitcode files were not marked in subversion as a binary file, so I also set the mime-type accordingly.

The diglobalvariable.ll file did not appear to get updated to match changes made to diglobalvariable.bc when DIGlobalVariableExpression was added.  Since I had to regenerate the bitcode file anyways I also updated the ".ll" file accordingly.


https://reviews.llvm.org/D46271

Files:
  llvm/include/llvm/IR/DIBuilder.h
  llvm/include/llvm/IR/DebugInfoMetadata.h
  llvm/lib/AsmParser/LLParser.cpp
  llvm/lib/Bitcode/Reader/MetadataLoader.cpp
  llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
  llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
  llvm/lib/IR/AsmWriter.cpp
  llvm/lib/IR/DIBuilder.cpp
  llvm/lib/IR/DebugInfoMetadata.cpp
  llvm/lib/IR/LLVMContextImpl.h
  llvm/test/Bitcode/diglobalvariable-3.8.ll
  llvm/test/Bitcode/diglobalvariable-3.8.ll.bc
  llvm/test/Bitcode/dityperefs-3.8.ll
  llvm/test/Bitcode/dityperefs-3.8.ll.bc
  llvm/test/Bitcode/upgrade-pointer-address-space.ll.bc
  llvm/test/DebugInfo/COFF/inheritance.ll
  llvm/test/ThinLTO/X86/Inputs/drop-debug-info.bc
  llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
  llvm/tools/clang/test/CodeGenCXX/debug-info-ms-vbase.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46271.144569.patch
Type: text/x-patch
Size: 42323 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180430/9d81b720/attachment-0001.bin>


More information about the llvm-commits mailing list