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
- Repository
- rL LLVM
Event Timeline
clang-tidy/ClangTidyDiagnosticConsumer.h | ||
---|---|---|
66 ↗ | (On Diff #67137) | Use llvm::StringMap here? |
clang-tidy/ClangTidy.cpp | ||
---|---|---|
129 ↗ | (On Diff #67137) | s/Fixes/Replacements/ |
clang-tidy/ClangTidyDiagnosticConsumer.cpp | ||
80 ↗ | (On Diff #67137) | 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 ↗ | (On Diff #67137) | 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 | ||
---|---|---|
1 ↗ | (On Diff #67164) | 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 | ||
---|---|---|
1 ↗ | (On Diff #67164) | 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 | ||
---|---|---|
519 ↗ | (On Diff #67193) | Please add braces for the outer loop. |
clang-tidy/ClangTidyDiagnosticConsumer.cpp | ||
81 ↗ | (On Diff #67193) | 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 ↗ | (On Diff #67193) | Please add braces around the outer loop. |
506 ↗ | (On Diff #67193) | Please add braces for both outer loops. |
unittests/clang-tidy/ClangTidyTest.h | ||
122 ↗ | (On Diff #67193) | 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!