[PATCH] D19014: [clang-tidy] Add new checker for suspicious sizeof expressions

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 12 12:58:54 PDT 2016


alexfh added inline comments.

================
Comment at: clang-tidy/misc/SizeofExpressionCheck.cpp:198
@@ +197,3 @@
+}
+
+void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) {
----------------
I'm probably wrong about "a more effective approach in general", but for `sizeof` case it might be more effective, if we assume that `sizeof` doesn't have large subtrees under it.

A separate concern is that the matchers looking up the tree are somewhat more difficult to understand (at least to me).

Ultimately, I'm not sure what's the best approach here. Maybe find a huge file and measure runtime of both implementations? ;)


http://reviews.llvm.org/D19014





More information about the cfe-commits mailing list