[PATCH] D74812: [Sema] Teach -Warm-interrupt-safety about func ptrs

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 20 10:38:28 PST 2020


efriedma added inline comments.


================
Comment at: clang/lib/Sema/SemaExpr.cpp:5931
+      if (Caller->hasAttr<ARMInterruptAttr>()) {
+        const Decl *CalleeDecl = FDecl;
+        if (const auto *UO = dyn_cast<UnaryOperator>(Fn->IgnoreParens())) {
----------------
jroelofs wrote:
> This feels very fragile, and I know is missing at least one case. Is there a better way to reliably get at the typedef's attributes from here?
Fundamentally, the way canonical types work in C and C++ means that you shouldn't be trying to dig attributes out of typedefs.  If it's a property of the type, it should be stored as a member of the FunctionType, like we do with calling conventions etc.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74812





More information about the cfe-commits mailing list