summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp b/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp
index 4dea41dfb4a..6f35fe210a8 100644
--- a/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp
@@ -39,7 +39,7 @@ SourceLocation forwardSkipWhitespaceAndComments(SourceLocation Loc,
const ASTContext *Context) {
assert(Loc.isValid());
for (;;) {
- while (isWhitespace(*FullSourceLoc(Loc, SM).getCharacterData()))
+ while (isWhitespace(*SM.getCharacterData(Loc)))
Loc = Loc.getLocWithOffset(1);
tok::TokenKind TokKind = getTokenKind(Loc, SM, Context);
@@ -69,7 +69,6 @@ SourceLocation findEndLocation(SourceLocation LastTokenLoc,
Loc = Lexer::getLocForEndOfToken(Loc, 0, SM, Context->getLangOpts());
// Loc points past the last token before end or after ';'.
-
if (SkipEndWhitespaceAndComments) {
Loc = forwardSkipWhitespaceAndComments(Loc, SM, Context);
tok::TokenKind TokKind = getTokenKind(Loc, SM, Context);
@@ -79,10 +78,11 @@ SourceLocation findEndLocation(SourceLocation LastTokenLoc,
for (;;) {
assert(Loc.isValid());
- while (isHorizontalWhitespace(*FullSourceLoc(Loc, SM).getCharacterData()))
+ while (isHorizontalWhitespace(*SM.getCharacterData(Loc))) {
Loc = Loc.getLocWithOffset(1);
+ }
- if (isVerticalWhitespace(*FullSourceLoc(Loc, SM).getCharacterData())) {
+ if (isVerticalWhitespace(*SM.getCharacterData(Loc))) {
// EOL, insert brace before.
break;
}
@@ -159,7 +159,7 @@ void BracesAroundStatementsCheck::check(
ForceBracesStmts.insert(Else);
if (Else && !isa<IfStmt>(Else)) {
// Omit 'else if' statements here, they will be handled directly.
- checkStmt(Result, Else, S->getElseLoc(), SourceLocation());
+ checkStmt(Result, Else, S->getElseLoc());
}
} else {
llvm_unreachable("Invalid match");
OpenPOWER on IntegriCloud