[PATCH] D14209: CodeView type info support preview (LLVM portion)

Dave Bartolomeo via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 30 11:09:40 PDT 2015


DaveBartolomeo created this revision.
DaveBartolomeo added a reviewer: majnemer.
DaveBartolomeo added a subscriber: llvm-commits.

This diff is a preview of the implementation of the LLVM portion of the CodeView RFC being discussed on the llvm-dev and cfe-dev lists. The code isn't ready for detailed code review yet. There will likely be some changes to the design based on feedback, plus there's still a bit of code clean-up to do. Once the design is settled and I've got the code finalized, I'll break it up into more easily-digestible patches for official code review. For now, though, this diff should be useful to anyone who has read the RFC and wants to see some concrete details.

The new LLVMCodeView library under lib\CodeView and the corresponding include directory implements support for emitting debug info in the CodeView format. This phase of the design only includes support for CodeView type records. Clients that need to emit type records will use a class derived from TypeTableBuilder. TypeTableBuilder provides member functions for writing each kind of type record; each of these functions eventually calls the writeRecord virtual function to emit the actual bits of the record. Derived classes override writeRecord to implement the folding of duplicate records and the actual emission to the appropriate destination. LLVMCodeView provides MemoryTypeTableBuilder, which creates the table in memory. When Clang emits type records, it uses MDTypeTableBuilder, which emits to LLVM metadata.
The rest of the types in LLVMCodeView define the actual CodeView type records and all of the supporting enums and other types used in the type records. The TypeIndex class is of particular interest, because it is used by clients as a handle to a type in the type table.

The remaining changes are mostly in lib\IR, where the debug info metadata, DIBuilder, and the readers and writers thereof needed to be updated to support CodeView. I added the new DICodeViewTypes and DICodeViewUDT nodes, added a DICodeViewTypes field to DICompileUnit, and added TypeIndex fields to DISubprogram and DIVariable.



http://reviews.llvm.org/D14209

Files:
  examples/Kaleidoscope/Chapter8/toy.cpp
  include/llvm/Bitcode/LLVMBitCodes.h
  include/llvm/CodeView/CodeView.h
  include/llvm/CodeView/CodeViewOStream.h
  include/llvm/CodeView/FieldListRecordBuilder.h
  include/llvm/CodeView/FunctionId.h
  include/llvm/CodeView/Line.h
  include/llvm/CodeView/ListRecordBuilder.h
  include/llvm/CodeView/MemoryTypeTableBuilder.h
  include/llvm/CodeView/MethodListRecordBuilder.h
  include/llvm/CodeView/TypeIndex.h
  include/llvm/CodeView/TypeRecord.h
  include/llvm/CodeView/TypeRecordBuilder.h
  include/llvm/CodeView/TypeSymbolEmitter.h
  include/llvm/CodeView/TypeTableBuilder.h
  include/llvm/IR/DIBuilder.h
  include/llvm/IR/DebugInfoMetadata.h
  include/llvm/IR/MDTypeTableBuilder.h
  include/llvm/IR/Metadata.def
  include/llvm/IR/Metadata.h
  lib/AsmParser/LLParser.cpp
  lib/Bitcode/Reader/BitcodeReader.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  lib/CMakeLists.txt
  lib/CodeView/CMakeLists.txt
  lib/CodeView/CodeViewOStream.cpp
  lib/CodeView/FieldListRecordBuilder.cpp
  lib/CodeView/FunctionId.cpp
  lib/CodeView/LLVMBuild.txt
  lib/CodeView/Line.cpp
  lib/CodeView/ListRecordBuilder.cpp
  lib/CodeView/MemoryTypeTableBuilder.cpp
  lib/CodeView/MethodListRecordBuilder.cpp
  lib/CodeView/TypeIndex.cpp
  lib/CodeView/TypeRecordBuilder.cpp
  lib/CodeView/TypeTableBuilder.cpp
  lib/IR/AsmWriter.cpp
  lib/IR/CMakeLists.txt
  lib/IR/DIBuilder.cpp
  lib/IR/DebugInfoMetadata.cpp
  lib/IR/LLVMBuild.txt
  lib/IR/LLVMContextImpl.h
  lib/IR/MDTypeTableBuilder.cpp
  lib/IR/Verifier.cpp
  lib/LLVMBuild.txt
  unittests/IR/IRBuilderTest.cpp
  unittests/IR/MetadataTest.cpp
  unittests/Transforms/Utils/Cloning.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14209.38826.patch
Type: text/x-patch
Size: 179366 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151030/50f3a1be/attachment-0001.bin>


More information about the llvm-commits mailing list