[clang-tools-extra] r304154 - [clang-tidy] Use getLocalOrGlobal for the StrictMode option

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Mon May 29 06:59:27 PDT 2017


Author: alexfh
Date: Mon May 29 08:59:27 2017
New Revision: 304154

URL: http://llvm.org/viewvc/llvm-project?rev=304154&view=rev
Log:
[clang-tidy] Use getLocalOrGlobal for the StrictMode option

Modified:
    clang-tools-extra/trunk/clang-tidy/misc/SuspiciousEnumUsageCheck.cpp
    clang-tools-extra/trunk/clang-tidy/performance/InefficientStringConcatenationCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/misc/SuspiciousEnumUsageCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/SuspiciousEnumUsageCheck.cpp?rev=304154&r1=304153&r2=304154&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/SuspiciousEnumUsageCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/SuspiciousEnumUsageCheck.cpp Mon May 29 08:59:27 2017
@@ -108,7 +108,8 @@ static bool isPossiblyBitMask(const Enum
 
 SuspiciousEnumUsageCheck::SuspiciousEnumUsageCheck(StringRef Name,
                                                    ClangTidyContext *Context)
-    : ClangTidyCheck(Name, Context), StrictMode(Options.get("StrictMode", 0)) {}
+    : ClangTidyCheck(Name, Context),
+      StrictMode(Options.getLocalOrGlobal("StrictMode", 0)) {}
 
 void SuspiciousEnumUsageCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
   Options.store(Opts, "StrictMode", StrictMode);

Modified: clang-tools-extra/trunk/clang-tidy/performance/InefficientStringConcatenationCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/performance/InefficientStringConcatenationCheck.cpp?rev=304154&r1=304153&r2=304154&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/performance/InefficientStringConcatenationCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/performance/InefficientStringConcatenationCheck.cpp Mon May 29 08:59:27 2017
@@ -24,7 +24,8 @@ void InefficientStringConcatenationCheck
 
 InefficientStringConcatenationCheck::InefficientStringConcatenationCheck(
     StringRef Name, ClangTidyContext *Context)
-    : ClangTidyCheck(Name, Context), StrictMode(Options.get("StrictMode", 0)) {}
+    : ClangTidyCheck(Name, Context),
+      StrictMode(Options.getLocalOrGlobal("StrictMode", 0)) {}
 
 void InefficientStringConcatenationCheck::registerMatchers(
     MatchFinder *Finder) {




More information about the cfe-commits mailing list