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())
|
if (S->getLocStart().isMacroID())
|
||||||
return SourceLocation();
|
return SourceLocation();
|
||||||
|
|
||||||
static const char *const ErrorMessage =
|
|
||||||
"cannot find location of closing parenthesis ')'";
|
|
||||||
SourceLocation CondEndLoc = S->getCond()->getLocEnd();
|
SourceLocation CondEndLoc = S->getCond()->getLocEnd();
|
||||||
if (const DeclStmt *CondVar = S->getConditionVariableDeclStmt())
|
if (const DeclStmt *CondVar = S->getConditionVariableDeclStmt())
|
||||||
CondEndLoc = CondVar->getLocEnd();
|
CondEndLoc = CondVar->getLocEnd();
|
||||||
|
@ -185,21 +183,15 @@ BracesAroundStatementsCheck::findRParenLoc(const IfOrWhileStmt *S,
|
||||||
assert(CondEndLoc.isValid());
|
assert(CondEndLoc.isValid());
|
||||||
SourceLocation PastCondEndLoc =
|
SourceLocation PastCondEndLoc =
|
||||||
Lexer::getLocForEndOfToken(CondEndLoc, 0, SM, Context->getLangOpts());
|
Lexer::getLocForEndOfToken(CondEndLoc, 0, SM, Context->getLangOpts());
|
||||||
if (PastCondEndLoc.isInvalid()) {
|
if (PastCondEndLoc.isInvalid())
|
||||||
diag(CondEndLoc, ErrorMessage);
|
|
||||||
return SourceLocation();
|
return SourceLocation();
|
||||||
}
|
|
||||||
SourceLocation RParenLoc =
|
SourceLocation RParenLoc =
|
||||||
forwardSkipWhitespaceAndComments(PastCondEndLoc, SM, Context);
|
forwardSkipWhitespaceAndComments(PastCondEndLoc, SM, Context);
|
||||||
if (RParenLoc.isInvalid()) {
|
if (RParenLoc.isInvalid())
|
||||||
diag(PastCondEndLoc, ErrorMessage);
|
|
||||||
return SourceLocation();
|
return SourceLocation();
|
||||||
}
|
|
||||||
tok::TokenKind TokKind = getTokenKind(RParenLoc, SM, Context);
|
tok::TokenKind TokKind = getTokenKind(RParenLoc, SM, Context);
|
||||||
if (TokKind != tok::r_paren) {
|
if (TokKind != tok::r_paren)
|
||||||
diag(RParenLoc, ErrorMessage);
|
|
||||||
return SourceLocation();
|
return SourceLocation();
|
||||||
}
|
|
||||||
return RParenLoc;
|
return RParenLoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue