Files
archived-llvm/test/CodeGen/BPF
Yonghong Song 97a1792e12 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357215 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-28 21:59:49 +00:00
..
2016-11-20 02:25:00 +00:00
2018-04-03 03:56:37 +00:00
2017-09-18 23:29:36 +00:00
2016-11-20 02:25:00 +00:00