[PATCH] D42983: [clang-tidy] Add readability-simd-intrinsics check.
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 6 16:11:59 PST 2018
MaskRay marked an inline comment as done.
MaskRay added inline comments.
================
Comment at: clang-tidy/readability/SIMDIntrinsicsCheck.cpp:77
+void SIMDIntrinsicsCheck::registerMatchers(MatchFinder *Finder) {
+ Finder->addMatcher(
+ callExpr(callee(functionDecl(matchesName("^::(_mm_|_mm256_|_mm512_|vec_)"))),
----------------
Eugene.Zelenko wrote:
> You should enable this check only when compiling in appropriate C++ version. See getLangOpts() usage in other checks.
Thx, I didn't know getLangOpts() before.
I think even in `-x c` mode, `::` is still the prefix of an identifier.
matchesName("^(_mm_|_mm256_|_mm512_|vec_)")
doesn't match anything but
matchesName("^::(_mm_|_mm256_|_mm512_|vec_)")
matches.
verified via `clang-tidy -checks='-*,readability-simd-intrinsics' a.c -- -xc`
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D42983
More information about the cfe-commits
mailing list