[clang-tools-extra] r255765 - [clang-tidy] Don't use diag() for debug output

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 16 05:19:09 PST 2015


Author: alexfh
Date: Wed Dec 16 07:19:08 2015
New Revision: 255765

URL: http://llvm.org/viewvc/llvm-project?rev=255765&view=rev
Log:
[clang-tidy] Don't use diag() for debug output

Modified:
    clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp?rev=255765&r1=255764&r2=255765&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp Wed Dec 16 07:19:08 2015
@@ -176,8 +176,6 @@ BracesAroundStatementsCheck::findRParenL
   if (S->getLocStart().isMacroID())
     return SourceLocation();
 
-  static const char *const ErrorMessage =
-      "cannot find location of closing parenthesis ')'";
   SourceLocation CondEndLoc = S->getCond()->getLocEnd();
   if (const DeclStmt *CondVar = S->getConditionVariableDeclStmt())
     CondEndLoc = CondVar->getLocEnd();
@@ -185,21 +183,15 @@ BracesAroundStatementsCheck::findRParenL
   assert(CondEndLoc.isValid());
   SourceLocation PastCondEndLoc =
       Lexer::getLocForEndOfToken(CondEndLoc, 0, SM, Context->getLangOpts());
-  if (PastCondEndLoc.isInvalid()) {
-    diag(CondEndLoc, ErrorMessage);
+  if (PastCondEndLoc.isInvalid())
     return SourceLocation();
-  }
   SourceLocation RParenLoc =
       forwardSkipWhitespaceAndComments(PastCondEndLoc, SM, Context);
-  if (RParenLoc.isInvalid()) {
-    diag(PastCondEndLoc, ErrorMessage);
+  if (RParenLoc.isInvalid())
     return SourceLocation();
-  }
   tok::TokenKind TokKind = getTokenKind(RParenLoc, SM, Context);
-  if (TokKind != tok::r_paren) {
-    diag(RParenLoc, ErrorMessage);
+  if (TokKind != tok::r_paren)
     return SourceLocation();
-  }
   return RParenLoc;
 }
 




More information about the cfe-commits mailing list