tooling::Replacements only holds replacements for a single file, so
this patch makes Fix a map from file paths to tooling::Replacements so that it
can be applied on multiple files.
Details
Diff Detail
Event Timeline
clang-tidy/ClangTidyDiagnosticConsumer.h | ||
---|---|---|
66 | Use llvm::StringMap here? |
clang-tidy/ClangTidy.cpp | ||
---|---|---|
129 | s/Fixes/Replacements/ | |
clang-tidy/ClangTidyDiagnosticConsumer.cpp | ||
80 | nit: 1. replace is a verb; 2. variable names should start with a capital. Replacement would be better. | |
test/clang-tidy/modernize-pass-by-value-multi-fixes.cpp | ||
1 | I think, cat x > y is preferred over cp x y in lit tests as a more platform-agnostic way of copying files. |
test/clang-tidy/Inputs/modernize-pass-by-value/header-with-fix.h | ||
---|---|---|
2 | Usually test should not use STL headers as it relies on the system headers. You don't have to use std::string to reproduce the crash, IMO. |
test/clang-tidy/Inputs/modernize-pass-by-value/header-with-fix.h | ||
---|---|---|
2 | Yep, just a class with a user-defined move constructor should be fine. // .h file: struct S { S(S&&); S(const S&); }; struct Foo { Foo(const S &s); S s; }; // .cpp file: #include "a.h" Foo::Foo(const S &s) : s(s) {} |
A bunch of nits. Otherwise looks good.
Thank you for the fix!
clang-tidy/ClangTidy.cpp | ||
---|---|---|
517–518 | Please add braces for the outer loop. | |
clang-tidy/ClangTidyDiagnosticConsumer.cpp | ||
81 | I was kind of intrigued by what auto stands for here. I think, llvm::Error is a less mysterious way of storing an error here ;) | |
498–500 | Please add braces around the outer loop. | |
506–519 | Please add braces for both outer loops. | |
unittests/clang-tidy/ClangTidyTest.h | ||
122–129 | Please add braces here as well. |
I remember that it was pissing me off when I used clang-tidy first time. Thanks for fixing that!
s/Fixes/Replacements/