summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/google
diff options
context:
space:
mode:
authorGabor Horvath <xazax.hun@gmail.com>2016-09-24 02:13:45 +0000
committerGabor Horvath <xazax.hun@gmail.com>2016-09-24 02:13:45 +0000
commitafad84c04b4a6a7ec2d5ac56cf9022e488f875bb (patch)
treecafef3310ddba5b0c76486a67acb748b4509ec5d /clang-tools-extra/clang-tidy/google
parent96cbe7b9a715a3515466492b9bb9df226f2ae095 (diff)
downloadbcm5719-llvm-afad84c04b4a6a7ec2d5ac56cf9022e488f875bb.tar.gz
bcm5719-llvm-afad84c04b4a6a7ec2d5ac56cf9022e488f875bb.zip
[clang-tidy] Cleaning up language options.
Differential Revision: https://reviews.llvm.org/D24881 llvm-svn: 282319
Diffstat (limited to 'clang-tools-extra/clang-tidy/google')
-rw-r--r--clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp7
-rw-r--r--clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp2
2 files changed, 4 insertions, 5 deletions
diff --git a/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp b/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp
index 34353b35a18..d118db58b4f 100644
--- a/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp
@@ -85,9 +85,8 @@ void AvoidCStyleCastsCheck::check(const MatchFinder::MatchResult &Result) {
return;
}
-
// The rest of this check is only relevant to C++.
- if (!Result.Context->getLangOpts().CPlusPlus)
+ if (!getLangOpts().CPlusPlus)
return;
// Ignore code inside extern "C" {} blocks.
if (!match(expr(hasAncestor(linkageSpecDecl())), *CastExpr, *Result.Context)
@@ -109,7 +108,7 @@ void AvoidCStyleCastsCheck::check(const MatchFinder::MatchResult &Result) {
Lexer::getSourceText(CharSourceRange::getTokenRange(
CastExpr->getLParenLoc().getLocWithOffset(1),
CastExpr->getRParenLoc().getLocWithOffset(-1)),
- SM, Result.Context->getLangOpts());
+ SM, getLangOpts());
auto diag_builder =
diag(CastExpr->getLocStart(), "C-style casts are discouraged; use %0");
@@ -123,7 +122,7 @@ void AvoidCStyleCastsCheck::check(const MatchFinder::MatchResult &Result) {
CastText.push_back('(');
diag_builder << FixItHint::CreateInsertion(
Lexer::getLocForEndOfToken(SubExpr->getLocEnd(), 0, SM,
- Result.Context->getLangOpts()),
+ getLangOpts()),
")");
}
diag_builder << FixItHint::CreateReplacement(ParenRange, CastText);
diff --git a/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp b/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp
index 0714516edf5..e79001793c4 100644
--- a/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp
@@ -92,7 +92,7 @@ void ExplicitConstructorCheck::check(const MatchFinder::MatchResult &Result) {
Tok.getRawIdentifier() == "explicit";
};
SourceRange ExplicitTokenRange =
- FindToken(*Result.SourceManager, Result.Context->getLangOpts(),
+ FindToken(*Result.SourceManager, getLangOpts(),
Ctor->getOuterLocStart(), Ctor->getLocEnd(), isKWExplicit);
StringRef ConstructorDescription;
if (Ctor->isMoveConstructor())
OpenPOWER on IntegriCloud