Eugene.Zelenko 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_)"))),
----------------
MaskRay wrote:
> 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`
>
Check should be enabled only for C++ version which has std::experimental::simd
implementation, so this is why you need to use getLangOpts().
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D42983
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits