diff options
| author | Alexander Kornienko <alexfh@google.com> | 2016-05-20 13:42:40 +0000 |
|---|---|---|
| committer | Alexander Kornienko <alexfh@google.com> | 2016-05-20 13:42:40 +0000 |
| commit | 5d08bb72d91a1f0873d2286f9f3514cf8607ff7f (patch) | |
| tree | 94355dfb738ffafee5be29908c5131282821e876 /clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp | |
| parent | 216963a723b45f88723863796a6255a4868d4ff9 (diff) | |
| download | bcm5719-llvm-5d08bb72d91a1f0873d2286f9f3514cf8607ff7f.tar.gz bcm5719-llvm-5d08bb72d91a1f0873d2286f9f3514cf8607ff7f.zip | |
[clang-tidy] Switch to a more common way of customizing check behavior.
This should have been done this way from the start, however I somehow missed
r257177.
llvm-svn: 270215
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp')
| -rw-r--r-- | clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp b/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp index 79973990f0e..acb6de47697 100644 --- a/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp @@ -44,7 +44,7 @@ MoveConstructorInitCheck::MoveConstructorInitCheck(StringRef Name, : ClangTidyCheck(Name, Context), IncludeStyle(utils::IncludeSorter::parseIncludeStyle( Options.get("IncludeStyle", "llvm"))), - UseCERTSemantics(Context->isCheckEnabled("cert-oop11-cpp")) {} + UseCERTSemantics(Options.get("UseCERTSemantics", 0) != 0) {} void MoveConstructorInitCheck::registerMatchers(MatchFinder *Finder) { // Only register the matchers for C++11; the functionality currently does not @@ -72,7 +72,7 @@ void MoveConstructorInitCheck::registerMatchers(MatchFinder *Finder) { // This checker is also used to implement cert-oop11-cpp, but when using that // form of the checker, we do not want to diagnose movable parameters. - if (!UseCERTSemantics) + if (!UseCERTSemantics) { Finder->addMatcher( cxxConstructorDecl( allOf( @@ -89,6 +89,7 @@ void MoveConstructorInitCheck::registerMatchers(MatchFinder *Finder) { .bind("init-arg"))))))) .bind("ctor-decl"), this); + } } void MoveConstructorInitCheck::check(const MatchFinder::MatchResult &Result) { @@ -176,6 +177,7 @@ void MoveConstructorInitCheck::registerPPCallbacks(CompilerInstance &Compiler) { void MoveConstructorInitCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { Options.store(Opts, "IncludeStyle", utils::IncludeSorter::toString(IncludeStyle)); + Options.store(Opts, "UseCERTSemantics", UseCERTSemantics ? 1 : 0); } } // namespace misc |

