[PATCH] D26137: [clang-tidy] Add check name to YAML export

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 3 06:42:16 PST 2017


alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

Looks good.

Fixed the issues myself and running tests before committing this.

Thank you for working on this!



================
Comment at: tools/extra/clang-tidy/ClangTidy.cpp:106
   void reportDiagnostic(const ClangTidyError &Error) {
-    const ClangTidyMessage &Message = Error.Message;
+    const ClangTidyMessage Message = Error.Message;
     SourceLocation Loc = getLocation(Message.FilePath, Message.FileOffset);
----------------
alexfh wrote:
> Why this change?
Assuming, it was unintentional, changing back to reference.


================
Comment at: tools/extra/clang-tidy/ClangTidyDiagnosticConsumer.h:36
 
-/// \brief A message from a clang-tidy check.
-///
-/// Note that this is independent of a \c SourceManager.
-struct ClangTidyMessage {
-  ClangTidyMessage(StringRef Message = "");
-  ClangTidyMessage(StringRef Message, const SourceManager &Sources,
-                   SourceLocation Loc);
-  std::string Message;
-  std::string FilePath;
-  unsigned FileOffset;
-};
+typedef clang::tooling::DiagnosticMessage ClangTidyMessage;
 
----------------
alexfh wrote:
> Do we actually need this typedef? How much is the old type name used?
Removed.


Repository:
  rL LLVM

https://reviews.llvm.org/D26137





More information about the cfe-commits mailing list