3 ms·
Clang-tidy has similar checks, e.g.: https://clang.llvm.org/extra/clang-tidy/checks/performance/for-range-copy.html https://clang.llvm.org/extra/clang-tidy/che
by nemetroid 3y ago
Clang-tidy has similar checks, e.g.:
https://clang.llvm.org/extra/clang-tidy/checks/performance/for-range-copy.html https://clang.llvm.org/extra/clang-tidy/checks/performance/f...
https://clang.llvm.org/extra/clang-tidy/checks/performance/unnecessary-value-param.html https://clang.llvm.org/extra/clang-tidy/checks/performance/u...
https://clang.llvm.org/extra/clang-tidy/checks/performance/unnecessary-copy-initialization.html https://clang.llvm.org/extra/clang-tidy/checks/performance/u...
- loeg 3y agoThanks! Clang-tidy is another tool we use on diffs at Facebook.
- ot 3y agoClang-tidy only supports AST-based matchers, you get type resolution but you still can only match simple patterns that only need local reasoning. Infer does whole-program analysis, so it can for example detect whether it is safe to move an object instead of copying it, because nothing touches it afterwards.