mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
09dda61130
Currently, the CO-RE offset relocation does not work if any struct/union member or array element is a typedef. For example, typedef const int arr_t[7]; struct input { arr_t a; }; func(...) { struct input *in = ...; ... __builtin_preserve_access_index(&in->a[1]) ... } The BPF backend calculated default offset is 0 while 4 is the correct answer. Similar issues exist for struct/union typedef's. When getting struct/union member or array element type, we should trace down to the type by skipping typedef and qualifiers const/volatile as this is what clang did to generate getelementptr instructions. (const/volatile member type qualifiers are already ignored by clang.) This patch fixed this issue, for each access index, skipping typedef and const/volatile/restrict BTF types. Signed-off-by: Yonghong Song <yhs@fb.com> Differential Revision: https://reviews.llvm.org/D65259 llvm-svn: 367062 |
||
---|---|---|
.. | ||
AsmParser | ||
Disassembler | ||
MCTargetDesc | ||
TargetInfo | ||
BPF.h | ||
BPF.td | ||
BPFAbstractMemberAccess.cpp | ||
BPFAsmPrinter.cpp | ||
BPFCallingConv.td | ||
BPFCORE.h | ||
BPFFrameLowering.cpp | ||
BPFFrameLowering.h | ||
BPFInstrFormats.td | ||
BPFInstrInfo.cpp | ||
BPFInstrInfo.h | ||
BPFInstrInfo.td | ||
BPFISelDAGToDAG.cpp | ||
BPFISelLowering.cpp | ||
BPFISelLowering.h | ||
BPFMCInstLower.cpp | ||
BPFMCInstLower.h | ||
BPFMIChecking.cpp | ||
BPFMIPeephole.cpp | ||
BPFMISimplifyPatchable.cpp | ||
BPFRegisterInfo.cpp | ||
BPFRegisterInfo.h | ||
BPFRegisterInfo.td | ||
BPFSelectionDAGInfo.cpp | ||
BPFSelectionDAGInfo.h | ||
BPFSubtarget.cpp | ||
BPFSubtarget.h | ||
BPFTargetMachine.cpp | ||
BPFTargetMachine.h | ||
BTF.def | ||
BTF.h | ||
BTFDebug.cpp | ||
BTFDebug.h | ||
CMakeLists.txt | ||
LLVMBuild.txt |