diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc')
9 files changed, 12 insertions, 15 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.cpp b/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.cpp index 7bfbd3bcd59..0b63c0d33a4 100644 --- a/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.cpp @@ -101,7 +101,7 @@ void AssertSideEffectCheck::registerMatchers(MatchFinder *Finder) { void AssertSideEffectCheck::check(const MatchFinder::MatchResult &Result) { const SourceManager &SM = *Result.SourceManager; - const LangOptions LangOpts = Result.Context->getLangOpts(); + const LangOptions LangOpts = getLangOpts(); SourceLocation Loc = Result.Nodes.getNodeAs<Stmt>("condStmt")->getLocStart(); StringRef AssertMacroName; diff --git a/clang-tools-extra/clang-tidy/misc/InaccurateEraseCheck.cpp b/clang-tools-extra/clang-tidy/misc/InaccurateEraseCheck.cpp index 7c8a132e5e5..8b0f8fd0002 100644 --- a/clang-tools-extra/clang-tidy/misc/InaccurateEraseCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/InaccurateEraseCheck.cpp @@ -57,10 +57,9 @@ void InaccurateEraseCheck::check(const MatchFinder::MatchResult &Result) { const auto *AlgCall = Result.Nodes.getNodeAs<CallExpr>("InaccAlgCall"); std::string ReplacementText = Lexer::getSourceText( CharSourceRange::getTokenRange(EndExpr->getSourceRange()), - *Result.SourceManager, Result.Context->getLangOpts()); + *Result.SourceManager, getLangOpts()); const SourceLocation EndLoc = Lexer::getLocForEndOfToken( - AlgCall->getLocEnd(), 0, *Result.SourceManager, - Result.Context->getLangOpts()); + AlgCall->getLocEnd(), 0, *Result.SourceManager, getLangOpts()); Hint = FixItHint::CreateInsertion(EndLoc, ", " + ReplacementText); } diff --git a/clang-tools-extra/clang-tidy/misc/InefficientAlgorithmCheck.cpp b/clang-tools-extra/clang-tidy/misc/InefficientAlgorithmCheck.cpp index 810118608da..a5a5b2b4ff8 100644 --- a/clang-tools-extra/clang-tidy/misc/InefficientAlgorithmCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/InefficientAlgorithmCheck.cpp @@ -117,7 +117,7 @@ void InefficientAlgorithmCheck::check(const MatchFinder::MatchResult &Result) { FixItHint Hint; SourceManager &SM = *Result.SourceManager; - LangOptions LangOpts = Result.Context->getLangOpts(); + LangOptions LangOpts = getLangOpts(); CharSourceRange CallRange = CharSourceRange::getTokenRange(AlgCall->getSourceRange()); diff --git a/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.cpp b/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.cpp index 69166860345..4e8c488d0c9 100644 --- a/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.cpp @@ -62,8 +62,7 @@ void StringIntegerAssignmentCheck::check( } SourceLocation EndLoc = Lexer::getLocForEndOfToken( - Argument->getLocEnd(), 0, *Result.SourceManager, - Result.Context->getLangOpts()); + Argument->getLocEnd(), 0, *Result.SourceManager, getLangOpts()); if (IsOneDigit) { Diag << FixItHint::CreateInsertion(Loc, IsWideCharType ? "L'" : "'") << FixItHint::CreateInsertion(EndLoc, "'"); diff --git a/clang-tools-extra/clang-tidy/misc/SuspiciousStringCompareCheck.cpp b/clang-tools-extra/clang-tidy/misc/SuspiciousStringCompareCheck.cpp index 9315ff5fb2f..7e01e6479b8 100644 --- a/clang-tools-extra/clang-tidy/misc/SuspiciousStringCompareCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/SuspiciousStringCompareCheck.cpp @@ -177,7 +177,7 @@ void SuspiciousStringCompareCheck::check( if (Result.Nodes.getNodeAs<Stmt>("missing-comparison")) { SourceLocation EndLoc = Lexer::getLocForEndOfToken( Call->getRParenLoc(), 0, Result.Context->getSourceManager(), - Result.Context->getLangOpts()); + getLangOpts()); diag(Call->getLocStart(), "function %0 is called without explicitly comparing result") @@ -187,7 +187,7 @@ void SuspiciousStringCompareCheck::check( if (const auto *E = Result.Nodes.getNodeAs<Expr>("logical-not-comparison")) { SourceLocation EndLoc = Lexer::getLocForEndOfToken( Call->getRParenLoc(), 0, Result.Context->getSourceManager(), - Result.Context->getLangOpts()); + getLangOpts()); SourceLocation NotLoc = E->getLocStart(); diag(Call->getLocStart(), diff --git a/clang-tools-extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp b/clang-tools-extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp index 9d500697f1a..78dba5a9f99 100644 --- a/clang-tools-extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp @@ -107,10 +107,10 @@ void UniqueptrResetReleaseCheck::check(const MatchFinder::MatchResult &Result) { std::string LeftText = clang::Lexer::getSourceText( CharSourceRange::getTokenRange(Left->getSourceRange()), - *Result.SourceManager, Result.Context->getLangOpts()); + *Result.SourceManager, getLangOpts()); std::string RightText = clang::Lexer::getSourceText( CharSourceRange::getTokenRange(Right->getSourceRange()), - *Result.SourceManager, Result.Context->getLangOpts()); + *Result.SourceManager, getLangOpts()); if (ResetMember->isArrow()) LeftText = "*" + LeftText; diff --git a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp index fb18059b90c..07165d65d72 100644 --- a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp @@ -37,7 +37,7 @@ void UnusedAliasDeclsCheck::check(const MatchFinder::MatchResult &Result) { AliasDecl->getLocStart(), Lexer::findLocationAfterToken( AliasDecl->getLocEnd(), tok::semi, *Result.SourceManager, - Result.Context->getLangOpts(), + getLangOpts(), /*SkipTrailingWhitespaceAndNewLine=*/true)); return; } diff --git a/clang-tools-extra/clang-tidy/misc/UnusedRAIICheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedRAIICheck.cpp index 1786627d127..8350d533df7 100644 --- a/clang-tools-extra/clang-tidy/misc/UnusedRAIICheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UnusedRAIICheck.cpp @@ -85,7 +85,7 @@ void UnusedRAIICheck::check(const MatchFinder::MatchResult &Result) { const auto *TL = selectFirst<TypeLoc>("t", Matches); D << FixItHint::CreateInsertion( Lexer::getLocForEndOfToken(TL->getLocEnd(), 0, *Result.SourceManager, - Result.Context->getLangOpts()), + getLangOpts()), Replacement); } diff --git a/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp index 3e4bb397dfc..8e4ed5a4a11 100644 --- a/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp @@ -64,8 +64,7 @@ void UnusedUsingDeclsCheck::check(const MatchFinder::MatchResult &Result) { Context.UsingDeclRange = CharSourceRange::getCharRange( Using->getLocStart(), Lexer::findLocationAfterToken( - Using->getLocEnd(), tok::semi, *Result.SourceManager, - Result.Context->getLangOpts(), + Using->getLocEnd(), tok::semi, *Result.SourceManager, getLangOpts(), /*SkipTrailingWhitespaceAndNewLine=*/true)); for (const auto *UsingShadow : Using->shadows()) { const auto *TargetDecl = UsingShadow->getTargetDecl()->getCanonicalDecl(); |

