[PATCH] D42983: [clang-tidy] Add readability-simd-intrinsics check.

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 6 15:35:21 PST 2018


Eugene.Zelenko added a comment.

Please mention this check in docs/ReleaseNotes.rst (in alphabetical order).



================
Comment at: clang-tidy/readability/SIMDIntrinsicsCheck.cpp:24
+
+StringRef CheckPPC(StringRef Name) {
+  if (Name.startswith("vec_"))
----------------
Please make function static instead of using anonymous namespace. See LLVM Coding Style.


================
Comment at: clang-tidy/readability/SIMDIntrinsicsCheck.cpp:28
+  else
+    return "";
+
----------------
I think returning {} will be better. Same for trailing return.


================
Comment at: clang-tidy/readability/SIMDIntrinsicsCheck.cpp:47
+
+StringRef CheckX86(StringRef Name) {
+  if (Name.startswith("_mm_"))
----------------
Please make function static instead of using anonymous namespace. See LLVM Coding Style.


================
Comment at: clang-tidy/readability/SIMDIntrinsicsCheck.cpp:55
+  else
+    return "";
+
----------------
I think returning {} will be better. Same for trailing return.


================
Comment at: clang-tidy/readability/SIMDIntrinsicsCheck.cpp:77
+void SIMDIntrinsicsCheck::registerMatchers(MatchFinder *Finder) {
+  Finder->addMatcher(
+      callExpr(callee(functionDecl(matchesName("^::(_mm_|_mm256_|_mm512_|vec_)"))),
----------------
You should enable this check only when compiling in appropriate C++ version. See getLangOpts() usage in other checks.


================
Comment at: clang-tidy/readability/SIMDIntrinsicsCheck.h:30
+
+ private:
+};
----------------
Please remove private section and empty line before it.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D42983





More information about the cfe-commits mailing list