summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp b/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
index ba8e5b42cca..97243a9d18d 100644
--- a/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
@@ -62,7 +62,7 @@ const char SimplifyConditionalReturnDiagnostic[] =
const CXXBoolLiteralExpr *getBoolLiteral(const MatchFinder::MatchResult &Result,
StringRef Id) {
const auto *Literal = Result.Nodes.getNodeAs<CXXBoolLiteralExpr>(Id);
- return (Literal && Literal->getLocStart().isMacroID()) ? nullptr : Literal;
+ return (Literal && Literal->getBeginLoc().isMacroID()) ? nullptr : Literal;
}
internal::Matcher<Stmt> returnsBool(bool Value, StringRef Id = "ignored") {
@@ -372,7 +372,7 @@ void SimplifyBooleanExprCheck::reportBinOp(
else
return;
- if (Bool->getLocStart().isMacroID())
+ if (Bool->getBeginLoc().isMacroID())
return;
// FIXME: why do we need this?
@@ -385,8 +385,8 @@ void SimplifyBooleanExprCheck::reportBinOp(
const Expr *ReplaceWith, bool Negated) {
std::string Replacement =
replacementExpression(Result, Negated, ReplaceWith);
- SourceRange Range(LHS->getLocStart(), RHS->getLocEnd());
- issueDiag(Result, Bool->getLocStart(), SimplifyOperatorDiagnostic, Range,
+ SourceRange Range(LHS->getBeginLoc(), RHS->getLocEnd());
+ issueDiag(Result, Bool->getBeginLoc(), SimplifyOperatorDiagnostic, Range,
Replacement);
};
@@ -577,7 +577,7 @@ void SimplifyBooleanExprCheck::replaceWithThenStatement(
const MatchFinder::MatchResult &Result,
const CXXBoolLiteralExpr *TrueConditionRemoved) {
const auto *IfStatement = Result.Nodes.getNodeAs<IfStmt>(IfStmtId);
- issueDiag(Result, TrueConditionRemoved->getLocStart(),
+ issueDiag(Result, TrueConditionRemoved->getBeginLoc(),
SimplifyConditionDiagnostic, IfStatement->getSourceRange(),
getText(Result, *IfStatement->getThen()));
}
@@ -587,7 +587,7 @@ void SimplifyBooleanExprCheck::replaceWithElseStatement(
const CXXBoolLiteralExpr *FalseConditionRemoved) {
const auto *IfStatement = Result.Nodes.getNodeAs<IfStmt>(IfStmtId);
const Stmt *ElseStatement = IfStatement->getElse();
- issueDiag(Result, FalseConditionRemoved->getLocStart(),
+ issueDiag(Result, FalseConditionRemoved->getBeginLoc(),
SimplifyConditionDiagnostic, IfStatement->getSourceRange(),
ElseStatement ? getText(Result, *ElseStatement) : "");
}
@@ -597,7 +597,7 @@ void SimplifyBooleanExprCheck::replaceWithCondition(
bool Negated) {
std::string Replacement =
replacementExpression(Result, Negated, Ternary->getCond());
- issueDiag(Result, Ternary->getTrueExpr()->getLocStart(),
+ issueDiag(Result, Ternary->getTrueExpr()->getBeginLoc(),
"redundant boolean literal in ternary expression result",
Ternary->getSourceRange(), Replacement);
}
@@ -608,7 +608,7 @@ void SimplifyBooleanExprCheck::replaceWithReturnCondition(
std::string Condition = replacementExpression(Result, Negated, If->getCond());
std::string Replacement = ("return " + Condition + Terminator).str();
SourceLocation Start =
- Result.Nodes.getNodeAs<CXXBoolLiteralExpr>(ThenLiteralId)->getLocStart();
+ Result.Nodes.getNodeAs<CXXBoolLiteralExpr>(ThenLiteralId)->getBeginLoc();
issueDiag(Result, Start, SimplifyConditionalReturnDiagnostic,
If->getSourceRange(), Replacement);
}
@@ -640,8 +640,8 @@ void SimplifyBooleanExprCheck::replaceCompoundReturnWithCondition(
std::string Replacement =
"return " + replacementExpression(Result, Negated, Condition);
issueDiag(
- Result, Lit->getLocStart(), SimplifyConditionalReturnDiagnostic,
- SourceRange(If->getLocStart(), Ret->getLocEnd()), Replacement);
+ Result, Lit->getBeginLoc(), SimplifyConditionalReturnDiagnostic,
+ SourceRange(If->getBeginLoc(), Ret->getLocEnd()), Replacement);
return;
}
@@ -665,7 +665,7 @@ void SimplifyBooleanExprCheck::replaceWithAssignment(
std::string Replacement =
(VariableName + " = " + Condition + Terminator).str();
SourceLocation Location =
- Result.Nodes.getNodeAs<CXXBoolLiteralExpr>(IfAssignLocId)->getLocStart();
+ Result.Nodes.getNodeAs<CXXBoolLiteralExpr>(IfAssignLocId)->getBeginLoc();
issueDiag(Result, Location,
"redundant boolean literal in conditional assignment", Range,
Replacement);
OpenPOWER on IntegriCloud