-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Attr] support btf_type_tag attribute
This patch added clang codegen and llvm support for btf_type_tag support. Currently, btf_type_tag attribute info is preserved in DebugInfo IR only for pointer types associated with typedef, global variable and function declaration. Eventually, such information is emitted to dwarf. The following is an example: $ cat test.c #define __tag __attribute__((btf_type_tag("tag"))) int __tag *g; $ clang -O2 -g -c test.c $ llvm-dwarfdump --debug-info test.o ... 0x0000001e: DW_TAG_variable DW_AT_name ("g") DW_AT_type (0x00000033 "int *") DW_AT_external (true) DW_AT_decl_file ("/home/yhs/test.c") DW_AT_decl_line (2) DW_AT_location (DW_OP_addr 0x0) 0x00000033: DW_TAG_pointer_type DW_AT_type (0x00000042 "int") 0x00000038: DW_TAG_LLVM_annotation DW_AT_name ("btf_type_tag") DW_AT_const_value ("tag") 0x00000041: NULL 0x00000042: DW_TAG_base_type DW_AT_name ("int") DW_AT_encoding (DW_ATE_signed) DW_AT_byte_size (0x04) 0x00000049: NULL Basically, a DW_TAG_LLVM_annotation tag will be inserted under DW_TAG_pointer_type tag if that pointer has a btf_type_tag associated with it. Differential Revision: https://reviews.llvm.org/D111199
- Loading branch information
1 parent
453fdeb
commit 737e421
Showing
9 changed files
with
361 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.