[PATCH] D110129: [DebugInfo] Support typedef with btf_tag attributes

Yonghong Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 20 23:31:56 PDT 2021


yonghong-song created this revision.
yonghong-song added a reviewer: dblaikie.
yonghong-song added a project: debug-info.
Herald added subscribers: dexonsmith, ormris, hiraditya.
yonghong-song requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

Clang patch ([1]) added support for btf_tag attributes with typedef
types. This patch added llvm support including dwarf generation.
For example, for typedef

  typedef unsigned __attribute__((btf_tag("tag1"))) * __u;
  __u u;

the following shows llvm-dwarfdump result:

   0x00000033:   DW_TAG_typedef
                   DW_AT_type      (0x00000048 "unsigned int *") 
                   DW_AT_name      ("__u")
                   DW_AT_decl_file ("/home/yhs/work/tests/llvm/btf_tag/t.c")
                   DW_AT_decl_line (1) 
  
   0x0000003e:     DW_TAG_LLVM_annotation
                     DW_AT_name    ("btf_tag")
                     DW_AT_const_value     ("tag1")
  
   0x00000047:     NULL
  
  [1] https://reviews.llvm.org/D110127


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110129

Files:
  clang/lib/CodeGen/CGDebugInfo.cpp
  clang/test/CodeGen/attr-btf_tag-typedef.c
  llvm/include/llvm/IR/DIBuilder.h
  llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
  llvm/lib/IR/DIBuilder.cpp
  llvm/test/Bitcode/attr-btf_tag-typedef.ll
  llvm/test/DebugInfo/attr-btf_tag-typedef.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110129.373785.patch
Type: text/x-patch
Size: 10264 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210921/53bf5892/attachment.bin>


More information about the llvm-commits mailing list