This is an archive of the discontinued LLVM Phabricator instance.

[BPF] Restrict preserve_access_index attribute to C only
ClosedPublic

Authored by yonghong-song on Nov 14 2019, 10:54 AM.

Details

Summary

This patch is a follow-up for commit 4e2ce228ae79

[BPF] Add preserve_access_index attribute for record definition

to restrict attribute for C only. A new test case is added
to check for this restriction.

Additional code polishing is done based on
Aaron Ballman's suggestion in https://reviews.llvm.org/D69759/new/.

Diff Detail

Event Timeline

yonghong-song created this revision.Nov 14 2019, 10:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 14 2019, 10:54 AM
yonghong-song retitled this revision from [BPF] Restrict preserve_access_index to C only to [BPF] Restrict preserve_access_index attribute to C only.Nov 14 2019, 10:54 AM
aaron.ballman accepted this revision.Nov 14 2019, 12:35 PM

LGTM aside from a small nit. Thank you!

clang/lib/CodeGen/CGExpr.cpp
3431

You can drop the getTypePtr() here and just use the magic -> overload.

This revision is now accepted and ready to land.Nov 14 2019, 12:35 PM
yonghong-song marked an inline comment as done.Nov 14 2019, 2:12 PM
yonghong-song added inline comments.
clang/lib/CodeGen/CGExpr.cpp
3431

Thanks! This indeed better:

+    const auto *PointeeT = PtrT->getPointeeType()
+                             ->getUnqualifiedDesugaredType();
This revision was automatically updated to reflect the committed changes.