[DebugInfo] generate btf_tag annotations for DIGlobalVariable
authorYonghong Song <yhs@fb.com>
Mon, 19 Jul 2021 16:33:55 +0000 (09:33 -0700)
committerYonghong Song <yhs@fb.com>
Thu, 26 Aug 2021 17:03:44 +0000 (10:03 -0700)
commit30c288489ae51a3e0819241f367eeae6df2b09e7
treeac633c6960ad10e6463c338b71ce78924c498d19
parentbe19aee4b26ea1e8672c61b1cfd520a5f8d9ba0e
[DebugInfo] generate btf_tag annotations for DIGlobalVariable

Generate btf_tag annotations for DIGlobalVariable.
A field "annotations" is introduced to DIGlobalVariable, and
annotations are represented as an DINodeArray, similar to
DIComposite elements. The following example illustrates how
annotations are encoded in IR:
    distinct !DIGlobalVariable(..., annotations: !10)
    !10 = !{!11, !12}
    !11 = !{!"btf_tag", !"a"}
    !12 = !{!"btf_tag", !"b"}

Differential Revision: https://reviews.llvm.org/D106619
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-diglobalvariable.ll [new file with mode: 0644]
llvm/unittests/IR/MetadataTest.cpp