BPF: Support btf_type_tag attribute
authorYonghong Song <yhs@fb.com>
Mon, 18 Oct 2021 04:26:15 +0000 (21:26 -0700)
committerYonghong Song <yhs@fb.com>
Fri, 5 Nov 2021 00:01:36 +0000 (17:01 -0700)
commit41860e602aaa94556ba996fae7b8baa268e25096
tree225359c7e4ddb96b6c8b81f9299066a088c6f892
parent07a029c0577864827bad472364145844dfaf2d24
BPF: Support btf_type_tag attribute

A new kind BTF_KIND_TYPE_TAG is defined. The tags associated
with a pointer type are emitted in their IR order as modifiers.
For example, for the following declaration:
  int __tag1 * __tag1 __tag2 *g;
The BTF type chain will look like
  VAR(g) -> __tag1 --> __tag2 -> pointer -> __tag1 -> pointer -> int
In the above "->" means BTF CommonType.Type which indicates
the point-to type.

Differential Revision: https://reviews.llvm.org/D113222
llvm/lib/Target/BPF/BTF.def
llvm/lib/Target/BPF/BTF.h
llvm/lib/Target/BPF/BTFDebug.cpp
llvm/lib/Target/BPF/BTFDebug.h
llvm/test/CodeGen/BPF/BTF/type-tag-var.ll [new file with mode: 0644]