[PATCH] D70257: [BPF] Restrict preserve_access_index attribute to C only

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 14 12:43:38 PST 2019


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM aside from a small nit. Thank you!



================
Comment at: clang/lib/CodeGen/CGExpr.cpp:3431
 
-    const auto *RecT = dyn_cast<RecordType>(ElaborateT->desugar().getTypePtr());
-    if (!RecT)
-      return false;
-
-    return RecT->getDecl()->hasAttr<BPFPreserveAccessIndexAttr>();
+    const auto *PointeeT = PtrT->getPointeeType().getTypePtr()
+                             ->getUnqualifiedDesugaredType();
----------------
You can drop the `getTypePtr()` here and just use the magic `->` overload.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70257/new/

https://reviews.llvm.org/D70257





More information about the cfe-commits mailing list