[PATCH] D137570: [Clang][Sema] Refactor category declaration under CheckForIncompatibleAttributes. NFC

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 11 05:32:28 PST 2022


aaron.ballman added a reviewer: erichkeane.
aaron.ballman added a comment.

This seems reasonable to me, but I'll leave the final sign-off to Erich.



================
Comment at: clang/lib/Sema/SemaStmtAttr.cpp:331-332
     const LoopHintAttr *NumericAttr;
-  } HintAttrs[] = {{nullptr, nullptr}, {nullptr, nullptr}, {nullptr, nullptr},
-                   {nullptr, nullptr}, {nullptr, nullptr}, {nullptr, nullptr},
-                   {nullptr, nullptr}};
+  } HintAttrs[CategoryType::NumberOfCategories];
+  memset(HintAttrs, 0, sizeof(HintAttrs));
 
----------------
Might as well rely on value initalization instead of a runtime call to memset.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137570



More information about the cfe-commits mailing list