llvm-project/llvm/test/CodeGen/BPF/BTF
Yonghong Song 89648eb16d [BPF] fix a bug for BTF pointee type pruning
In BTF, pointee type pruning is used to reduce cluttering
too many unused types into prog BTF. For example,
   struct task_struct {
      ...
      struct mm_struct *mm;
      ...
   }
If bpf program does not access members of "struct mm_struct",
there is no need to bring types for "struct mm_struct" to BTF.

This patch fixed a bug where an incorrect pruning happened.
The test case like below:
    struct t;
    typedef struct t _t;
    struct s1 { _t *c; };
    int test1(struct s1 *arg) { ... }

    struct t { int a; int b; };
    struct s2 { _t c; }
    int test2(struct s2 *arg) { ... }

After processing test1(), among others, BPF backend generates BTF types for
    "struct s1", "_t" and a placeholder for "struct t".
Note that "struct t" is not really generated. If later a direct access
to "struct t" member happened, "struct t" BTF type will be generated
properly.

During processing test2(), when processing member type "_t c",
BPF backend sees type "_t" already generated, so returned.
This caused the problem that "struct t" BTF type is never generated and
eventually causing incorrect type definition for "struct s2".

To fix the issue, during DebugInfo type traversal, even if a
typedef/const/volatile/restrict derived type has been recorded in BTF,
if it is not a type pruning candidate, type traversal of its base type continues.

Differential Revision: https://reviews.llvm.org/D82041
2020-06-17 15:13:46 -07:00
..
array-1d-char.ll
array-1d-int.ll
array-2d-int.ll
array-size-0.ll [BPF] Generate array dimension size properly for zero-size elements 2019-09-24 22:38:43 +00:00
array-typedef.ll
binary-format.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
builtin-btf-type-id.ll [BPF] preserve debuginfo types for builtin __builtin__btf_type_id() 2020-05-15 08:00:44 -07:00
char-no-debuginfo.ll Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
char.ll
empty-btf.ll
enum-basic.ll
extern-builtin.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-func-arg.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-global-var.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-var-func-weak-section.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-var-func-weak.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-var-func.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-var-section.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-var-struct-weak.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-var-struct.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-var-weak-section.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
filename.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
func-func-ptr.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
func-non-void.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
func-source.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
func-typedef.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
func-unused-arg.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
func-void.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
fwd-no-define.ll
fwd-with-define.ll
global-var-inited.ll [BPF] generate BTF_KIND_VARs for all non-static globals 2019-11-12 14:34:08 -08:00
global-var-sec-readonly.ll
global-var-sec.ll
int.ll
local-var.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
longlong.ll
map-def.ll
pruning-const.ll [BPF] fix a bug for BTF pointee type pruning 2020-06-17 15:13:46 -07:00
pruning-typedef.ll [BPF] fix a bug for BTF pointee type pruning 2020-06-17 15:13:46 -07:00
ptr-const-void.ll
ptr-func-1.ll
ptr-func-2.ll
ptr-func-3.ll
ptr-int.ll
ptr-prune-type.ll
ptr-void.ll
ptr-volatile-const-void.ll
ptr-volatile-void.ll
restrict-ptr.ll
short.ll
static-func.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var-derived-type.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var-inited-sec.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var-inited.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var-readonly-sec.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var-readonly.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var-sec.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var-zerolen-array.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
struct-anon.ll
struct-basic.ll
struct-bitfield-typedef.ll
struct-enum.ll
uchar.ll
uint.ll
ulonglong.ll
union-array-typedef.ll
ushort.ll
weak-global-2.ll [BPF] Support weak global variables for BTF 2019-12-07 08:58:19 -08:00
weak-global.ll [BPF] Support weak global variables for BTF 2019-12-07 08:58:19 -08:00