llvm/lib/Target/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
..
AsmParser Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Disassembler bpf: disassembler support for XADD under sub-register mode 2019-02-28 19:22:34 +00:00
InstPrinter Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MCTargetDesc Use bitset for assembler predicates 2019-03-11 17:04:35 +00:00
TargetInfo Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPF.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPF.td [BPF] add code-gen support for JMP32 instructions 2019-02-07 10:43:09 +00:00
BPFAsmPrinter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFCallingConv.td Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFFrameLowering.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFFrameLowering.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFInstrFormats.td [BPF] add code-gen support for JMP32 instructions 2019-02-07 10:43:09 +00:00
BPFInstrInfo.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFInstrInfo.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFInstrInfo.td bpf: enable sub-register code-gen for XADD 2019-02-28 19:21:28 +00:00
BPFISelDAGToDAG.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFISelLowering.cpp [BPF] add code-gen support for JMP32 instructions 2019-02-07 10:43:09 +00:00
BPFISelLowering.h [BPF] add code-gen support for JMP32 instructions 2019-02-07 10:43:09 +00:00
BPFMCInstLower.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFMCInstLower.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFMIChecking.cpp bpf: enable sub-register code-gen for XADD 2019-02-28 19:21:28 +00:00
BPFMIPeephole.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFRegisterInfo.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFRegisterInfo.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFRegisterInfo.td Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFSelectionDAGInfo.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFSelectionDAGInfo.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFSubtarget.cpp [BPF] add code-gen support for JMP32 instructions 2019-02-07 10:43:09 +00:00
BPFSubtarget.h [BPF] add code-gen support for JMP32 instructions 2019-02-07 10:43:09 +00:00
BPFTargetMachine.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFTargetMachine.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BTF.def [BPF] Add BTF Var and DataSec Support 2019-03-16 15:36:31 +00:00
BTF.h [BPF] Add BTF Var and DataSec Support 2019-03-16 15:36:31 +00:00
BTFDebug.cpp [BPF] add proper multi-dimensional array support 2019-03-28 21:59:49 +00:00
BTFDebug.h [BPF] add proper multi-dimensional array support 2019-03-28 21:59:49 +00:00
CMakeLists.txt [BPF] Generate BTF DebugInfo under BPF target 2018-12-19 16:40:25 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00