[PATCH] D126984: [clang] Add initial support for gcc's optimize function attribute

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 8 12:34:03 PDT 2022


aaron.ballman added a comment.

Two final (I hope) nits! One is in the code, the other is that this should have a release note for the new attribute. Assuming precommit CI pipeline passes, then I think this is all set.



================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:4860
+  if (It != StrToKind.end()) {
+    D->addAttr(::new (S.Context) OptimizeAttr(S.Context, AL, "", It->second));
+    return;
----------------
Sorry for missing this before, but on both of the calls to `Create` here, you should be passing in `Arg` so that the AST retains full source fidelity (this matters for things like pretty printing).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126984



More information about the cfe-commits mailing list