[DebugInfo] generate btf_tag annotations for DIComposite types
authorYonghong Song <yhs@fb.com>
Mon, 19 Jul 2021 06:43:48 +0000 (23:43 -0700)
committerYonghong Song <yhs@fb.com>
Thu, 19 Aug 2021 22:37:44 +0000 (15:37 -0700)
commit2fded193e7a8fb5bd8fb339f00fd9de686390530
treeafd5b44042ab762c8c088fceaf4d9917b7baf8e2
parentfd0557dbf13198ddd6a17bd120a7b2bb97bfbd0a
[DebugInfo] generate btf_tag annotations for DIComposite types

Clang patch D106614 added attribute btf_tag support. This patch
generates btf_tag annotations for DIComposite types.
A field "annotations" is introduced to DIComposite, and the
annotations are represented as an DINodeArray, similar to
DIComposite elements. The following example illustrates
how annotations are encoded in IR:
  distinct !DICompositeType(..., annotations: !10)
  !10 = !{!11, !12}
  !11 = !{!"btf_tag", !"a"}
  !12 = !{!"btf_tag", !"b"}
Each btf_tag annotation is represented as a 2D array of
meta strings. Each record may have more than one
btf_tag annotations, as in the above example.

Differential Revision: https://reviews.llvm.org/D106615
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/IR/AsmWriter.cpp
llvm/lib/IR/DIBuilder.cpp
llvm/lib/IR/DebugInfoMetadata.cpp
llvm/lib/IR/LLVMContextImpl.h
llvm/test/Bitcode/attr-btf_tag-dicomposite.ll [new file with mode: 0644]