aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2020-02-02 14:54:16 -0800
committerYonghong Song <yhs@fb.com>2020-02-04 09:28:30 -0800
commit9271cab270a52b5200ef45a16f1a9d9baaccaba0 (patch)
treedfed5be9e3c5d275d58d4016dff227c528948c52 /llvm/lib/CodeGen/MachineFunction.cpp
parent2eaa9d991d0afd3945e177d3ca0d42af04996f2c (diff)
downloadllvm-9271cab270a52b5200ef45a16f1a9d9baaccaba0.zip
llvm-9271cab270a52b5200ef45a16f1a9d9baaccaba0.tar.gz
llvm-9271cab270a52b5200ef45a16f1a9d9baaccaba0.tar.bz2
[BPF] use base lvalue type for preserve_{struct,union}_access_index metadata
Linux commit https://github.com/torvalds/linux/commit/1cf5b23988ea0086a252a5c8b005b075f1e9b030#diff-289313b9fec99c6f0acfea19d9cfd949 uses "#pragma clang attribute push (__attribute__((preserve_access_index)), apply_to = record)" to apply CO-RE relocations to all records including the following pattern: #pragma clang attribute push (__attribute__((preserve_access_index)), apply_to = record) typedef struct { int a; } __t; #pragma clang attribute pop int test(__t *arg) { return arg->a; } The current approach to use struct type in the relocation record will result in an anonymous struct, which make later type matching difficult in bpf loader. In fact, current BPF backend will fail the above program with assertion: clang: ../lib/Target/BPF/BPFAbstractMemberAccess.cpp:796: ... Assertion `TypeName.size()' failed. The patch use the base lvalue type for the "base" value to annotate preservee_{struct,union}_access_index intrinsics. In the above example, the type will be "__t" which preserved the type name. Differential Revision: https://reviews.llvm.org/D73900
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions