forked from OSchip/llvm-project
[clang-tidy] Don't use diag() for debug output
llvm-svn: 255765
This commit is contained in:
parent
2de8c16913
commit
d819364e81
|
@ -176,8 +176,6 @@ BracesAroundStatementsCheck::findRParenLoc(const IfOrWhileStmt *S,
|
|||
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::findRParenLoc(const IfOrWhileStmt *S,
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue