[clang-tools-extra] r200142 - Fix another invalid getCustomDiagID() use to unbreak the build

Alp Toker alp at nuanti.com
Sun Jan 26 00:36:04 PST 2014


Author: alp
Date: Sun Jan 26 02:36:03 2014
New Revision: 200142

URL: http://llvm.org/viewvc/llvm-project?rev=200142&view=rev
Log:
Fix another invalid getCustomDiagID() use to unbreak the build

It was calling the utility wrapper that now requires a constant string
following clang r200132. The StringRef version on DiagnosticIDs appears to have
been what was intended so change to that.

Modified:
    clang-tools-extra/trunk/clang-tidy/ClangTidy.h
    clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp

Modified: clang-tools-extra/trunk/clang-tidy/ClangTidy.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidy.h?rev=200142&r1=200141&r2=200142&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidy.h (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidy.h Sun Jan 26 02:36:03 2014
@@ -76,7 +76,7 @@ public:
   void setContext(ClangTidyContext *Ctx) { Context = Ctx; }
 
   /// \brief Add a diagnostic with the check's name.
-  DiagnosticBuilder diag(SourceLocation Loc, StringRef Message);
+  DiagnosticBuilder diag(SourceLocation Loc, StringRef Description);
 
   /// \brief Sets the check name. Intended to be used by the clang-tidy
   /// framework. Can be called only once.

Modified: clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp?rev=200142&r1=200141&r2=200142&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp Sun Jan 26 02:36:03 2014
@@ -39,9 +39,9 @@ ClangTidyError::ClangTidyError(StringRef
 
 DiagnosticBuilder ClangTidyContext::diag(StringRef CheckName,
                                          SourceLocation Loc,
-                                         StringRef Message) {
-  unsigned ID =
-      DiagEngine->getCustomDiagID(DiagnosticsEngine::Warning, Message);
+                                         StringRef Description) {
+  unsigned ID = DiagEngine->getDiagnosticIDs()->getCustomDiagID(
+      DiagnosticIDs::Warning, Description);
   if (CheckNamesByDiagnosticID.count(ID) == 0)
     CheckNamesByDiagnosticID.insert(std::make_pair(ID, CheckName.str()));
   return DiagEngine->Report(Loc, ID);





More information about the cfe-commits mailing list