llvm-project/llvm/test/CodeGen/BPF/BTF
Yonghong Song 360a4e2ca6 [BPF] add proper multi-dimensional array support
For multi-dimensional array like below
  int a[2][3];
the previous implementation generates BTF_KIND_ARRAY type
like below:
  . element_type: int
  . index_type: unsigned int
  . number of elements: 6

This is not the best way to represent arrays, esp.,
when converting BTF back to headers and users will see
  int a[6];
instead.

This patch generates proper support for multi-dimensional arrays.
For "int a[2][3]", the two BTF_KIND_ARRAY types will be
generated:
  Type #n:
    . element_type: int
    . index_type: unsigned int
    . number of elements: 3
  Type #(n+1):
    . element_type: #n
    . index_type: unsigned int
    . number of elements: 2

The linux kernel already supports such a multi-dimensional
array representation properly.

Signed-off-by: Yonghong Song <yhs@fb.com>

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

llvm-svn: 357215
2019-03-28 21:59:49 +00:00
..
array-1d-char.ll [BPF] add proper multi-dimensional array support 2019-03-28 21:59:49 +00:00
array-1d-int.ll [BPF] add proper multi-dimensional array support 2019-03-28 21:59:49 +00:00
array-2d-int.ll [BPF] add proper multi-dimensional array support 2019-03-28 21:59:49 +00:00
array-size-0.ll [BPF] add proper multi-dimensional array support 2019-03-28 21:59:49 +00:00
array-typedef.ll [BPF] add proper multi-dimensional array support 2019-03-28 21:59:49 +00:00
binary-format.ll
char.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
empty-btf.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
enum-basic.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
extern-global-var.ll [BPF] do not generate unused local/global types 2019-03-15 05:51:25 +00:00
filename.ll [BPF] [BTF] Process FileName with absolute path correctly 2019-02-02 05:54:59 +00:00
func-func-ptr.ll
func-non-void.ll
func-source.ll
func-typedef.ll
func-unused-arg.ll
func-void.ll
fwd-no-define.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
fwd-with-define.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
global-var-inited.ll [BPF] handle external global properly 2019-03-15 17:39:10 +00:00
global-var-sec-readonly.ll [BPF] handle derived type properly for computing type id 2019-03-22 01:30:50 +00:00
global-var-sec.ll [BPF] Add BTF Var and DataSec Support 2019-03-16 15:36:31 +00:00
int.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
local-var.ll [BPF] do not generate unused local/global types 2019-03-15 05:51:25 +00:00
longlong.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
ptr-const-void.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
ptr-func-1.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
ptr-func-2.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
ptr-func-3.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
ptr-int.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
ptr-void.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
ptr-volatile-const-void.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
ptr-volatile-void.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
restrict-ptr.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
short.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
static-var-derived-type.ll [BPF] use std::map to ensure consistent output 2019-03-27 15:45:27 +00:00
static-var-inited-sec.ll [BPF] handle derived type properly for computing type id 2019-03-22 01:30:50 +00:00
static-var-inited.ll [BPF] handle derived type properly for computing type id 2019-03-22 01:30:50 +00:00
static-var-readonly-sec.ll [BPF] handle derived type properly for computing type id 2019-03-22 01:30:50 +00:00
static-var-readonly.ll [BPF] handle derived type properly for computing type id 2019-03-22 01:30:50 +00:00
static-var-sec.ll [BPF] handle derived type properly for computing type id 2019-03-22 01:30:50 +00:00
static-var-zerolen-array.ll [BPF] add proper multi-dimensional array support 2019-03-28 21:59:49 +00:00
static-var.ll [BPF] handle derived type properly for computing type id 2019-03-22 01:30:50 +00:00
struct-anon.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
struct-basic.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
struct-bitfield-typedef.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
struct-enum.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
uchar.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
uint.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
ulonglong.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00
union-array-typedef.ll [BPF] add proper multi-dimensional array support 2019-03-28 21:59:49 +00:00
ushort.ll [BPF] Do not generate BTF sections unnecessarily 2019-03-05 01:01:21 +00:00