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/.
You can drop the getTypePtr() here and just use the magic -> overload.