summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/AlignmentTest.cpp
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2019-08-02 23:16:44 +0000
committerYonghong Song <yhs@fb.com>2019-08-02 23:16:44 +0000
commit37d24a696bf74f4830f2582d2f36256ca1b6bb30 (patch)
treea1cf751fca4b32f1d8734900fab17828759e3fb5 /llvm/unittests/Support/AlignmentTest.cpp
parent748dac7389bd9834c4de4ee9cf3fc7937f30bf47 (diff)
downloadbcm5719-llvm-37d24a696bf74f4830f2582d2f36256ca1b6bb30.tar.gz
bcm5719-llvm-37d24a696bf74f4830f2582d2f36256ca1b6bb30.zip
[BPF] Handling type conversions correctly for CO-RE
With newly added debuginfo type metadata for preserve_array_access_index() intrinsic, this patch did the following two things: (1). checking validity before adding a new access index to the access chain. (2). calculating access byte offset in IR phase BPFAbstractMemberAccess instead of when BTF is emitted. For (1), the metadata provided by all preserve_*_access_index() intrinsics are used to check whether the to-be-added type is a proper struct/union member or array element. For (2), with all available metadata, calculating access byte offset becomes easier in BPFAbstractMemberAccess IR phase. This enables us to remove the unnecessary complexity in BTFDebug.cpp. New tests are added for . user explicit casting to array/structure/union . global variable (or its dereference) as the source of base . multi demensional arrays . array access given a base pointer . cases where we won't generate relocation if we cannot find type name. Differential Revision: https://reviews.llvm.org/D65618 llvm-svn: 367735
Diffstat (limited to 'llvm/unittests/Support/AlignmentTest.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud