[all-commits] [llvm/llvm-project] f6811c: [DebugInfo] Support typedef with btf_decl_tag attr...

yonghong-song via All-commits all-commits at lists.llvm.org
Thu Oct 21 08:50:21 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f6811cec84218912d1c7c9b0b8d308834e6e24e3
      https://github.com/llvm/llvm-project/commit/f6811cec84218912d1c7c9b0b8d308834e6e24e3
  Author: Yonghong Song <yhs at fb.com>
  Date:   2021-10-21 (Thu, 21 Oct 2021)

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

  Log Message:
  -----------
  [DebugInfo] Support typedef with btf_decl_tag attributes

Clang patch ([1]) added support for btf_decl_tag attributes with typedef
types. This patch added llvm support including dwarf generation.
For example, for typedef
   typedef unsigned * __u __attribute__((btf_decl_tag("tag1")));
   __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_decl_tag")
                     DW_AT_const_value     ("tag1")

   0x00000047:     NULL

  [1] https://reviews.llvm.org/D110127

Differential Revision: https://reviews.llvm.org/D110129




More information about the All-commits mailing list