[PATCH] D16183: Added CheckName field to YAML report
Alexander Kornienko via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 14 05:14:20 PST 2016
alexfh added a comment.
I'm not sure `tooling::Replacement` is the best place to store check name. Maybe create a separate wrapper class and serialize it instead (clang-apply-replacements will have to be changed to support this format as well). This could be `ClangTidyDiagnostic` or just `Diagnostic`, and we could also store the message and other useful information in it.
================
Comment at: tools/clang/include/clang/Tooling/Core/Replacement.h:93
@@ +92,3 @@
+ const LangOptions &LangOpts = LangOptions(),
+ StringRef CheckName = ""
+ );
----------------
Please clang-format the code.
================
Comment at: tools/clang/tools/extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:80
@@ -79,3 +79,3 @@
- Error.Fix.insert(tooling::Replacement(SM, Range, FixIt.CodeToInsert));
+ Error.Fix.insert(tooling::Replacement(SM, Range, FixIt.CodeToInsert, LangOptions(), StringRef(Error.CheckName)));
}
----------------
Doesn't it compile without `StringRef()` around `Error.CheckName`?
http://reviews.llvm.org/D16183
More information about the cfe-commits
mailing list