[PATCH] D106621: [DWARF] Support new TAG DW_TAG_LLVM_annotation

Yonghong Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 22 17:35:57 PDT 2021


yonghong-song created this revision.
yonghong-song added reviewers: dblaikie, probinson, aprantl, aaron.ballman.
yonghong-song added a project: debug-info.
Herald added subscribers: ormris, hiraditya.
yonghong-song requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

A new LLVM specific TAG DW_TAG_LLVM_annotation is added.
This tag is used to output __attribute__((btf_tag("string")))
annotations in dwarf. The following is an example for a global
variable with two btf_tag attributes:

  0x0000002a:   DW_TAG_variable
                  DW_AT_name      ("g1")
                  DW_AT_type      (0x00000052 "int")
                  DW_AT_external  (true)
                  DW_AT_decl_file ("/tmp/home/yhs/work/tests/llvm/btf_tag/t.c")
                  DW_AT_decl_line (8) 
                  DW_AT_location  (DW_OP_addr 0x0)
  
  0x0000003f:     DW_TAG_LLVM_annotation
                    DW_AT_name    ("btf_tag")
                    DW_AT_const_value     ("tag1")
  
  0x00000048:     DW_TAG_LLVM_annotation
                    DW_AT_name    ("btf_tag")
                    DW_AT_const_value     ("tag2")
  
  0x00000051:     NULL


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106621

Files:
  llvm/include/llvm/BinaryFormat/Dwarf.def
  llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
  llvm/test/DebugInfo/attr-btf_tag.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106621.361044.patch
Type: text/x-patch
Size: 9964 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210723/0aeae638/attachment.bin>


More information about the llvm-commits mailing list