Index: clang/include/clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h =================================================================== --- clang/include/clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h +++ clang/include/clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h @@ -19,6 +19,7 @@ namespace clang { class LangOptions; +class AnalyzerOptions; namespace ento { @@ -28,7 +29,8 @@ #define GET_CHECKERS #define CHECKER(FULLNAME, CLASS, HELPTEXT, DOC_URI, IS_HIDDEN) \ void register##CLASS(CheckerManager &mgr); \ - bool shouldRegister##CLASS(const LangOptions &LO); + bool shouldRegister##CLASS(const LangOptions &LO, \ + const AnalyzerOptions &Opts); #include "clang/StaticAnalyzer/Checkers/Checkers.inc" #undef CHECKER #undef GET_CHECKERS Index: clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h =================================================================== --- clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h +++ clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h @@ -89,7 +89,8 @@ /// Initialization functions perform any necessary setup for a checker. /// They should include a call to CheckerManager::registerChecker. using InitializationFunction = void (*)(CheckerManager &); - using ShouldRegisterFunction = bool (*)(const LangOptions &); + using ShouldRegisterFunction = bool (*)(const LangOptions &, + const AnalyzerOptions &); /// Specifies a command line option. It may either belong to a checker or a /// package. @@ -161,12 +162,14 @@ ConstCheckerInfoList Dependencies; - bool isEnabled(const LangOptions &LO) const { - return State == StateFromCmdLine::State_Enabled && ShouldRegister(LO); + bool isEnabled(const LangOptions &LO, const AnalyzerOptions &Opt) const { + return State == StateFromCmdLine::State_Enabled && + ShouldRegister(LO, Opt); } - bool isDisabled(const LangOptions &LO) const { - return State == StateFromCmdLine::State_Disabled && ShouldRegister(LO); + bool isDisabled(const LangOptions &LO, const AnalyzerOptions &Opt) const { + return State == StateFromCmdLine::State_Disabled && + ShouldRegister(LO, Opt); } // Since each checker must have a different full name, we can identify @@ -209,7 +212,8 @@ mgr.registerChecker(); } - template static bool returnTrue(const LangOptions &LO) { + template static bool returnTrue(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandling.cpp =================================================================== --- clang/lib/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandling.cpp +++ clang/lib/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandling.cpp @@ -21,7 +21,8 @@ << '\n'; } -bool shouldRegisterMyChecker(const LangOptions &LO) { return true; } +bool shouldRegisterMyChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } } // end anonymous namespace Index: clang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp @@ -186,6 +186,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterAnalysisOrderChecker(const LangOptions &LO) { +bool ento::shouldRegisterAnalysisOrderChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp @@ -140,6 +140,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterAnalyzerStatsChecker(const LangOptions &LO) { +bool ento::shouldRegisterAnalyzerStatsChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp @@ -92,6 +92,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterArrayBoundChecker(const LangOptions &LO) { +bool ento::shouldRegisterArrayBoundChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp +++ clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp @@ -356,6 +356,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterArrayBoundCheckerV2(const LangOptions &LO) { +bool ento::shouldRegisterArrayBoundCheckerV2(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp +++ clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp @@ -1243,7 +1243,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterNilArgChecker(const LangOptions &LO) { +bool ento::shouldRegisterNilArgChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -1251,7 +1252,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterCFNumberChecker(const LangOptions &LO) { +bool ento::shouldRegisterCFNumberChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -1259,7 +1261,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterCFRetainReleaseChecker(const LangOptions &LO) { +bool ento::shouldRegisterCFRetainReleaseChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -1267,7 +1270,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterClassReleaseChecker(const LangOptions &LO) { +bool ento::shouldRegisterClassReleaseChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -1275,7 +1279,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterVariadicMethodTypeChecker(const LangOptions &LO) { +bool ento::shouldRegisterVariadicMethodTypeChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } @@ -1283,7 +1288,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterObjCLoopChecker(const LangOptions &LO) { +bool ento::shouldRegisterObjCLoopChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -1291,6 +1297,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterObjCNonNilReturnValueChecker(const LangOptions &LO) { +bool ento::shouldRegisterObjCNonNilReturnValueChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp @@ -184,6 +184,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterBlockInCriticalSectionChecker(const LangOptions &LO) { +bool ento::shouldRegisterBlockInCriticalSectionChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp @@ -96,6 +96,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterBoolAssignmentChecker(const LangOptions &LO) { +bool ento::shouldRegisterBoolAssignmentChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp @@ -135,6 +135,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterBuiltinFunctionChecker(const LangOptions &LO) { +bool ento::shouldRegisterBuiltinFunctionChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp @@ -2430,7 +2430,8 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterCStringModeling(const LangOptions &LO) { +bool ento::shouldRegisterCStringModeling(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -2441,7 +2442,10 @@ checker->Filter.CheckName##name = mgr.getCurrentCheckerName(); \ } \ \ - bool ento::shouldRegister##name(const LangOptions &LO) { return true; } + bool ento::shouldRegister##name(const LangOptions &LO, \ + const AnalyzerOptions &Opts) { \ + return true; \ + } REGISTER_CHECKER(CStringNullArg) REGISTER_CHECKER(CStringOutOfBounds) Index: clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp @@ -291,6 +291,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterCStringSyntaxChecker(const LangOptions &LO) { +bool ento::shouldRegisterCStringSyntaxChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/CXXSelfAssignmentChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CXXSelfAssignmentChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/CXXSelfAssignmentChecker.cpp @@ -76,6 +76,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterCXXSelfAssignmentChecker(const LangOptions &LO) { +bool ento::shouldRegisterCXXSelfAssignmentChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp @@ -605,7 +605,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterCallAndMessageChecker(const LangOptions &LO) { +bool ento::shouldRegisterCallAndMessageChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -615,6 +616,7 @@ Checker->CheckName_CallAndMessageUnInitRefArg = mgr.getCurrentCheckerName(); } -bool ento::shouldRegisterCallAndMessageUnInitRefArg(const LangOptions &LO) { +bool ento::shouldRegisterCallAndMessageUnInitRefArg( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/CastSizeChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CastSizeChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/CastSizeChecker.cpp @@ -146,7 +146,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterCastSizeChecker(const LangOptions &LO) { +bool ento::shouldRegisterCastSizeChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { // PR31226: C++ is more complicated than what this checker currently supports. // There are derived-to-base casts, there are different rules for 0-size // structures, no flexible arrays, etc. Index: clang/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp @@ -120,6 +120,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterCastToStructChecker(const LangOptions &LO) { +bool ento::shouldRegisterCastToStructChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp @@ -436,6 +436,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterCastValueChecker(const LangOptions &LO) { +bool ento::shouldRegisterCastValueChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp +++ clang/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp @@ -1088,7 +1088,8 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterObjCDeallocChecker(const LangOptions &LO) { +bool ento::shouldRegisterObjCDeallocChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { // These checker only makes sense under MRR. return LO.getGC() != LangOptions::GCOnly && !LO.ObjCAutoRefCount; } Index: clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp +++ clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp @@ -138,6 +138,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterObjCMethSigsChecker(const LangOptions &LO) { +bool ento::shouldRegisterObjCMethSigsChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp +++ clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp @@ -117,6 +117,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterPlacementNewChecker(const LangOptions &LO) { +bool ento::shouldRegisterPlacementNewChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp +++ clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp @@ -1076,7 +1076,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterSecuritySyntaxChecker(const LangOptions &LO) { +bool ento::shouldRegisterSecuritySyntaxChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -1087,7 +1088,10 @@ checker->filter.checkName_##name = mgr.getCurrentCheckerName(); \ } \ \ - bool ento::shouldRegister##name(const LangOptions &LO) { return true; } + bool ento::shouldRegister##name(const LangOptions &LO, \ + const AnalyzerOptions &Opts) { \ + return true; \ + } REGISTER_CHECKER(bcmp) REGISTER_CHECKER(bcopy) Index: clang/lib/StaticAnalyzer/Checkers/CheckSizeofPointer.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CheckSizeofPointer.cpp +++ clang/lib/StaticAnalyzer/Checkers/CheckSizeofPointer.cpp @@ -91,6 +91,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterSizeofPointerChecker(const LangOptions &LO) { +bool ento::shouldRegisterSizeofPointerChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp @@ -136,6 +136,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterChrootChecker(const LangOptions &LO) { +bool ento::shouldRegisterChrootChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp @@ -208,6 +208,7 @@ .getCheckerStringOption(Checker, "IgnoredFilesPattern"); } -bool ento::shouldRegisterCloneChecker(const LangOptions &LO) { +bool ento::shouldRegisterCloneChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp +++ clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp @@ -1035,6 +1035,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterContainerModeling(const LangOptions &LO) { +bool ento::shouldRegisterContainerModeling(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ConversionChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ConversionChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ConversionChecker.cpp @@ -196,6 +196,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterConversionChecker(const LangOptions &LO) { +bool ento::shouldRegisterConversionChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp @@ -540,6 +540,7 @@ AnOpts.getCheckerBooleanOption(Chk, "ShowFixIts"); } -bool ento::shouldRegisterDeadStoresChecker(const LangOptions &LO) { +bool ento::shouldRegisterDeadStoresChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp +++ clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp @@ -47,7 +47,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterDominatorsTreeDumper(const LangOptions &LO) { +bool ento::shouldRegisterDominatorsTreeDumper(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -73,7 +74,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterPostDominatorsTreeDumper(const LangOptions &LO) { +bool ento::shouldRegisterPostDominatorsTreeDumper(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -98,7 +100,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterControlDependencyTreeDumper(const LangOptions &LO) { +bool ento::shouldRegisterControlDependencyTreeDumper(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -122,7 +125,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterLiveVariablesDumper(const LangOptions &LO) { +bool ento::shouldRegisterLiveVariablesDumper(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -145,7 +149,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterLiveStatementsDumper(const LangOptions &LO) { +bool ento::shouldRegisterLiveStatementsDumper(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -169,7 +174,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterCFGViewer(const LangOptions &LO) { +bool ento::shouldRegisterCFGViewer(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -199,7 +205,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterCFGDumper(const LangOptions &LO) { +bool ento::shouldRegisterCFGDumper(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -223,7 +230,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterCallGraphViewer(const LangOptions &LO) { +bool ento::shouldRegisterCallGraphViewer(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -247,7 +255,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterCallGraphDumper(const LangOptions &LO) { +bool ento::shouldRegisterCallGraphDumper(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -291,7 +300,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterConfigDumper(const LangOptions &LO) { +bool ento::shouldRegisterConfigDumper(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -314,7 +324,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterExplodedGraphViewer(const LangOptions &LO) { +bool ento::shouldRegisterExplodedGraphViewer(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -346,6 +357,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterReportStmts(const LangOptions &LO) { +bool ento::shouldRegisterReportStmts(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/DebugContainerModeling.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/DebugContainerModeling.cpp +++ clang/lib/StaticAnalyzer/Checkers/DebugContainerModeling.cpp @@ -133,6 +133,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterDebugContainerModeling(const LangOptions &LO) { +bool ento::shouldRegisterDebugContainerModeling(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/DebugIteratorModeling.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/DebugIteratorModeling.cpp +++ clang/lib/StaticAnalyzer/Checkers/DebugIteratorModeling.cpp @@ -139,6 +139,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterDebugIteratorModeling(const LangOptions &LO) { +bool ento::shouldRegisterDebugIteratorModeling(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/DeleteWithNonVirtualDtorChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/DeleteWithNonVirtualDtorChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/DeleteWithNonVirtualDtorChecker.cpp @@ -148,6 +148,6 @@ } bool ento::shouldRegisterDeleteWithNonVirtualDtorChecker( - const LangOptions &LO) { + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp @@ -304,6 +304,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterDereferenceChecker(const LangOptions &LO) { +bool ento::shouldRegisterDereferenceChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp +++ clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp @@ -222,7 +222,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterDirectIvarAssignment(const LangOptions &LO) { +bool ento::shouldRegisterDirectIvarAssignment(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -232,6 +233,6 @@ } bool ento::shouldRegisterDirectIvarAssignmentForAnnotatedFunctions( - const LangOptions &LO) { + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp @@ -101,6 +101,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterDivZeroChecker(const LangOptions &LO) { +bool ento::shouldRegisterDivZeroChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/DynamicTypeChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/DynamicTypeChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/DynamicTypeChecker.cpp @@ -203,6 +203,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterDynamicTypeChecker(const LangOptions &LO) { +bool ento::shouldRegisterDynamicTypeChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp +++ clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp @@ -981,7 +981,8 @@ checker->CheckGenerics = true; } -bool ento::shouldRegisterObjCGenericsChecker(const LangOptions &LO) { +bool ento::shouldRegisterObjCGenericsChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -989,6 +990,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterDynamicTypePropagation(const LangOptions &LO) { +bool ento::shouldRegisterDynamicTypePropagation(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/EnumCastOutOfRangeChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/EnumCastOutOfRangeChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/EnumCastOutOfRangeChecker.cpp @@ -142,6 +142,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterEnumCastOutOfRangeChecker(const LangOptions &LO) { +bool ento::shouldRegisterEnumCastOutOfRangeChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp @@ -416,6 +416,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterExprInspectionChecker(const LangOptions &LO) { +bool ento::shouldRegisterExprInspectionChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp @@ -66,6 +66,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterFixedAddressChecker(const LangOptions &LO) { +bool ento::shouldRegisterFixedAddressChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp @@ -565,7 +565,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterFuchsiaHandleChecker(const LangOptions &LO) { +bool ento::shouldRegisterFuchsiaHandleChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/GCDAntipatternChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/GCDAntipatternChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/GCDAntipatternChecker.cpp @@ -225,6 +225,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterGCDAntipattern(const LangOptions &LO) { +bool ento::shouldRegisterGCDAntipattern(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/GTestChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/GTestChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/GTestChecker.cpp @@ -291,7 +291,8 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterGTestChecker(const LangOptions &LO) { +bool ento::shouldRegisterGTestChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { // gtest is a C++ API so there is no sense running the checker // if not compiling for C++. return LO.CPlusPlus; Index: clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp @@ -942,6 +942,7 @@ Checker->parseConfiguration(Mgr, Option, std::move(Config.getValue())); } -bool ento::shouldRegisterGenericTaintChecker(const LangOptions &LO) { +bool ento::shouldRegisterGenericTaintChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/IdenticalExprChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/IdenticalExprChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/IdenticalExprChecker.cpp @@ -513,6 +513,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterIdenticalExprChecker(const LangOptions &LO) { +bool ento::shouldRegisterIdenticalExprChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/InnerPointerChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/InnerPointerChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/InnerPointerChecker.cpp @@ -307,6 +307,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterInnerPointerChecker(const LangOptions &LO) { +bool ento::shouldRegisterInnerPointerChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/InvalidatedIteratorChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/InvalidatedIteratorChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/InvalidatedIteratorChecker.cpp @@ -90,6 +90,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterInvalidatedIteratorChecker(const LangOptions &LO) { +bool ento::shouldRegisterInvalidatedIteratorChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp +++ clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp @@ -590,6 +590,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterIteratorModeling(const LangOptions &LO) { +bool ento::shouldRegisterIteratorModeling(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/IteratorRangeChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/IteratorRangeChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/IteratorRangeChecker.cpp @@ -268,6 +268,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterIteratorRangeChecker(const LangOptions &LO) { +bool ento::shouldRegisterIteratorRangeChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp @@ -739,7 +739,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterIvarInvalidationModeling(const LangOptions &LO) { +bool ento::shouldRegisterIvarInvalidationModeling(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -751,7 +752,10 @@ checker->Filter.checkName_##name = mgr.getCurrentCheckerName(); \ } \ \ - bool ento::shouldRegister##name(const LangOptions &LO) { return true; } + bool ento::shouldRegister##name(const LangOptions &LO, \ + const AnalyzerOptions &Opts) { \ + return true; \ + } REGISTER_CHECKER(InstanceVariableInvalidation) REGISTER_CHECKER(MissingInvalidationMethod) Index: clang/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp @@ -314,6 +314,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterLLVMConventionsChecker(const LangOptions &LO) { +bool ento::shouldRegisterLLVMConventionsChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp @@ -1403,7 +1403,8 @@ checker, "AggressiveReport"); } -bool ento::shouldRegisterNonLocalizedStringChecker(const LangOptions &LO) { +bool ento::shouldRegisterNonLocalizedStringChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } @@ -1412,7 +1413,7 @@ } bool ento::shouldRegisterEmptyLocalizationContextChecker( - const LangOptions &LO) { + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } @@ -1420,6 +1421,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterPluralMisuseChecker(const LangOptions &LO) { +bool ento::shouldRegisterPluralMisuseChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp @@ -292,6 +292,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterMIGChecker(const LangOptions &LO) { +bool ento::shouldRegisterMIGChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIChecker.cpp @@ -190,6 +190,7 @@ MGR.registerChecker(); } -bool clang::ento::shouldRegisterMPIChecker(const LangOptions &LO) { +bool clang::ento::shouldRegisterMPIChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp @@ -662,11 +662,11 @@ } } - void ento::registerMacOSKeychainAPIChecker(CheckerManager &mgr) { mgr.registerChecker(); } -bool ento::shouldRegisterMacOSKeychainAPIChecker(const LangOptions &LO) { +bool ento::shouldRegisterMacOSKeychainAPIChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp @@ -176,6 +176,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterMacOSXAPIChecker(const LangOptions &LO) { +bool ento::shouldRegisterMacOSXAPIChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp @@ -3368,7 +3368,8 @@ mgr.getAnalyzerOptions().getCheckerBooleanOption(checker, "Optimistic"); } -bool ento::shouldRegisterDynamicMemoryModeling(const LangOptions &LO) { +bool ento::shouldRegisterDynamicMemoryModeling(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -3380,7 +3381,10 @@ mgr.getCurrentCheckerName(); \ } \ \ - bool ento::shouldRegister##name(const LangOptions &LO) { return true; } + bool ento::shouldRegister##name(const LangOptions &LO, \ + const AnalyzerOptions &Opts) { \ + return true; \ + } REGISTER_CHECKER(MallocChecker) REGISTER_CHECKER(NewDeleteChecker) Index: clang/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp @@ -337,6 +337,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterMallocOverflowSecurityChecker(const LangOptions &LO) { +bool ento::shouldRegisterMallocOverflowSecurityChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp @@ -250,6 +250,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterMallocSizeofChecker(const LangOptions &LO) { +bool ento::shouldRegisterMallocSizeofChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/MismatchedIteratorChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/MismatchedIteratorChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/MismatchedIteratorChecker.cpp @@ -290,6 +290,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterMismatchedIteratorChecker(const LangOptions &LO) { +bool ento::shouldRegisterMismatchedIteratorChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp @@ -88,6 +88,7 @@ .getCheckerIntegerOption(Mwec, "MmapProtRead"); } -bool ento::shouldRegisterMmapWriteExecChecker(const LangOptions &LO) { +bool ento::shouldRegisterMmapWriteExecChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp @@ -757,6 +757,7 @@ mgr.getAnalyzerOptions().getCheckerStringOption(chk, "WarnOn"), mgr); } -bool ento::shouldRegisterMoveChecker(const LangOptions &LO) { +bool ento::shouldRegisterMoveChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp @@ -80,6 +80,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterNSAutoreleasePoolChecker(const LangOptions &LO) { +bool ento::shouldRegisterNSAutoreleasePoolChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return LO.getGC() != LangOptions::NonGC; } Index: clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp @@ -312,7 +312,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterNSOrCFErrorDerefChecker(const LangOptions &LO) { +bool ento::shouldRegisterNSOrCFErrorDerefChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -322,7 +323,8 @@ checker->ShouldCheckNSError = true; } -bool ento::shouldRegisterNSErrorChecker(const LangOptions &LO) { +bool ento::shouldRegisterNSErrorChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -332,6 +334,7 @@ checker->ShouldCheckCFError = true; } -bool ento::shouldRegisterCFErrorChecker(const LangOptions &LO) { +bool ento::shouldRegisterCFErrorChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp @@ -143,6 +143,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterNoReturnFunctionChecker(const LangOptions &LO) { +bool ento::shouldRegisterNoReturnFunctionChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp @@ -226,6 +226,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterNonNullParamChecker(const LangOptions &LO) { +bool ento::shouldRegisterNonNullParamChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/NonnullGlobalConstantsChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/NonnullGlobalConstantsChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/NonnullGlobalConstantsChecker.cpp @@ -147,6 +147,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterNonnullGlobalConstantsChecker(const LangOptions &LO) { +bool ento::shouldRegisterNonnullGlobalConstantsChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp @@ -1188,7 +1188,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterNullabilityBase(const LangOptions &LO) { +bool ento::shouldRegisterNullabilityBase(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -1204,7 +1205,8 @@ checker, "NoDiagnoseCallsToSystemHeaders", true); \ } \ \ - bool ento::shouldRegister##name##Checker(const LangOptions &LO) { \ + bool ento::shouldRegister##name##Checker(const LangOptions &LO, \ + const AnalyzerOptions &Opts) { \ return true; \ } Index: clang/lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp @@ -349,6 +349,7 @@ Mgr.getAnalyzerOptions().getCheckerBooleanOption(Chk, "Pedantic"); } -bool ento::shouldRegisterNumberObjectConversionChecker(const LangOptions &LO) { +bool ento::shouldRegisterNumberObjectConversionChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/OSObjectCStyleCast.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/OSObjectCStyleCast.cpp +++ clang/lib/StaticAnalyzer/Checkers/OSObjectCStyleCast.cpp @@ -84,6 +84,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterOSObjectCStyleCast(const LangOptions &LO) { +bool ento::shouldRegisterOSObjectCStyleCast(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp @@ -91,6 +91,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterObjCAtSyncChecker(const LangOptions &LO) { +bool ento::shouldRegisterObjCAtSyncChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return LO.ObjC; } Index: clang/lib/StaticAnalyzer/Checkers/ObjCAutoreleaseWriteChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ObjCAutoreleaseWriteChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ObjCAutoreleaseWriteChecker.cpp @@ -206,6 +206,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterAutoreleaseWriteChecker(const LangOptions &LO) { +bool ento::shouldRegisterAutoreleaseWriteChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp @@ -172,6 +172,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterObjCContainersASTChecker(const LangOptions &LO) { +bool ento::shouldRegisterObjCContainersASTChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp @@ -188,6 +188,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterObjCContainersChecker(const LangOptions &LO) { +bool ento::shouldRegisterObjCContainersChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ObjCMissingSuperCallChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ObjCMissingSuperCallChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ObjCMissingSuperCallChecker.cpp @@ -221,7 +221,8 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterObjCSuperCallChecker(const LangOptions &LO) { +bool ento::shouldRegisterObjCSuperCallChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ObjCPropertyChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ObjCPropertyChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ObjCPropertyChecker.cpp @@ -79,6 +79,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterObjCPropertyChecker(const LangOptions &LO) { +bool ento::shouldRegisterObjCPropertyChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp @@ -437,6 +437,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterObjCSelfInitChecker(const LangOptions &LO) { +bool ento::shouldRegisterObjCSelfInitChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp @@ -284,6 +284,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterObjCSuperDeallocChecker(const LangOptions &LO) { +bool ento::shouldRegisterObjCSuperDeallocChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp @@ -180,12 +180,13 @@ checkObjCUnusedIvar(D, BR, this); } }; -} +} // namespace void ento::registerObjCUnusedIvarsChecker(CheckerManager &mgr) { mgr.registerChecker(); } -bool ento::shouldRegisterObjCUnusedIvarsChecker(const LangOptions &LO) { +bool ento::shouldRegisterObjCUnusedIvarsChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp @@ -353,6 +353,7 @@ Checker, "AllowedPad", "a non-negative value"); } -bool ento::shouldRegisterPaddingChecker(const LangOptions &LO) { +bool ento::shouldRegisterPaddingChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp @@ -343,6 +343,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterPointerArithChecker(const LangOptions &LO) { +bool ento::shouldRegisterPointerArithChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/PointerIterationChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/PointerIterationChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/PointerIterationChecker.cpp @@ -95,6 +95,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterPointerIterationChecker(const LangOptions &LO) { +bool ento::shouldRegisterPointerIterationChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return LO.CPlusPlus; } Index: clang/lib/StaticAnalyzer/Checkers/PointerSortingChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/PointerSortingChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/PointerSortingChecker.cpp @@ -108,6 +108,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterPointerSortingChecker(const LangOptions &LO) { +bool ento::shouldRegisterPointerSortingChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return LO.CPlusPlus; } Index: clang/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp @@ -74,6 +74,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterPointerSubChecker(const LangOptions &LO) { +bool ento::shouldRegisterPointerSubChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp @@ -725,7 +725,10 @@ mgr.registerChecker(); } -bool ento::shouldRegisterPthreadLockBase(const LangOptions &LO) { return true; } +bool ento::shouldRegisterPthreadLockBase(const LangOptions &LO, + const AnalyzerOptions &Opts) { + return true; +} #define REGISTER_CHECKER(name) \ void ento::register##name(CheckerManager &mgr) { \ @@ -735,7 +738,10 @@ mgr.getCurrentCheckerName(); \ } \ \ - bool ento::shouldRegister##name(const LangOptions &LO) { return true; } + bool ento::shouldRegister##name(const LangOptions &LO, \ + const AnalyzerOptions &Opts) { \ + return true; \ + } REGISTER_CHECKER(PthreadLockChecker) REGISTER_CHECKER(FuchsiaLockChecker) Index: clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp @@ -1477,7 +1477,8 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterRetainCountBase(const LangOptions &LO) { +bool ento::shouldRegisterRetainCountBase(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -1503,7 +1504,8 @@ "true"); } -bool ento::shouldRegisterRetainCountChecker(const LangOptions &LO) { +bool ento::shouldRegisterRetainCountChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -1515,6 +1517,7 @@ Chk->TrackOSObjects = true; } -bool ento::shouldRegisterOSObjectRetainCountChecker(const LangOptions &LO) { +bool ento::shouldRegisterOSObjectRetainCountChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ReturnPointerRangeChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ReturnPointerRangeChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ReturnPointerRangeChecker.cpp @@ -91,6 +91,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterReturnPointerRangeChecker(const LangOptions &LO) { +bool ento::shouldRegisterReturnPointerRangeChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp @@ -122,6 +122,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterReturnUndefChecker(const LangOptions &LO) { +bool ento::shouldRegisterReturnUndefChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ReturnValueChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ReturnValueChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ReturnValueChecker.cpp @@ -165,6 +165,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterReturnValueChecker(const LangOptions &LO) { +bool ento::shouldRegisterReturnValueChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/RunLoopAutoreleaseLeakChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/RunLoopAutoreleaseLeakChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/RunLoopAutoreleaseLeakChecker.cpp @@ -203,6 +203,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterRunLoopAutoreleaseLeakChecker(const LangOptions &LO) { +bool ento::shouldRegisterRunLoopAutoreleaseLeakChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/STLAlgorithmModeling.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/STLAlgorithmModeling.cpp +++ clang/lib/StaticAnalyzer/Checkers/STLAlgorithmModeling.cpp @@ -174,7 +174,7 @@ "AggressiveStdFindModeling"); } -bool ento::shouldRegisterSTLAlgorithmModeling(const LangOptions &LO) { +bool ento::shouldRegisterSTLAlgorithmModeling(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } - Index: clang/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp @@ -271,6 +271,7 @@ } // This checker should be enabled regardless of how language options are set. -bool ento::shouldRegisterSimpleStreamChecker(const LangOptions &LO) { +bool ento::shouldRegisterSimpleStreamChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp +++ clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp @@ -67,6 +67,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterSmartPtrModeling(const LangOptions &LO) { +bool ento::shouldRegisterSmartPtrModeling(const LangOptions &LO, + const AnalyzerOptions &Opts) { return LO.CPlusPlus; } Index: clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp @@ -365,7 +365,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterStackAddrEscapeBase(const LangOptions &LO) { +bool ento::shouldRegisterStackAddrEscapeBase(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -376,7 +377,8 @@ Chk->ChecksEnabled[StackAddrEscapeChecker::CK_##name] = true; \ } \ \ - bool ento::shouldRegister##name(const LangOptions &LO) { \ + bool ento::shouldRegister##name(const LangOptions &LO, \ + const AnalyzerOptions &Opts) { \ return true; \ } Index: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp @@ -795,6 +795,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterStdCLibraryFunctionsChecker(const LangOptions &LO) { +bool ento::shouldRegisterStdCLibraryFunctionsChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp @@ -353,6 +353,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterStreamChecker(const LangOptions &LO) { +bool ento::shouldRegisterStreamChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp @@ -63,6 +63,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterTaintTesterChecker(const LangOptions &LO) { +bool ento::shouldRegisterTaintTesterChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/TestAfterDivZeroChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/TestAfterDivZeroChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/TestAfterDivZeroChecker.cpp @@ -261,6 +261,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterTestAfterDivZeroChecker(const LangOptions &LO) { +bool ento::shouldRegisterTestAfterDivZeroChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/TraversalChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/TraversalChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/TraversalChecker.cpp @@ -64,7 +64,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterTraversalDumper(const LangOptions &LO) { +bool ento::shouldRegisterTraversalDumper(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -116,6 +117,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterCallDumper(const LangOptions &LO) { +bool ento::shouldRegisterCallDumper(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/TrustNonnullChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/TrustNonnullChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/TrustNonnullChecker.cpp @@ -252,6 +252,7 @@ Mgr.registerChecker(Mgr.getASTContext()); } -bool ento::shouldRegisterTrustNonnullChecker(const LangOptions &LO) { +bool ento::shouldRegisterTrustNonnullChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp @@ -110,6 +110,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterUndefBranchChecker(const LangOptions &LO) { +bool ento::shouldRegisterUndefBranchChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp @@ -101,6 +101,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterUndefCapturedBlockVarChecker(const LangOptions &LO) { +bool ento::shouldRegisterUndefCapturedBlockVarChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp @@ -187,6 +187,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterUndefResultChecker(const LangOptions &LO) { +bool ento::shouldRegisterUndefResultChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp @@ -62,6 +62,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterUndefinedArraySubscriptChecker(const LangOptions &LO) { +bool ento::shouldRegisterUndefinedArraySubscriptChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp @@ -120,6 +120,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterUndefinedAssignmentChecker(const LangOptions &LO) { +bool ento::shouldRegisterUndefinedAssignmentChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp @@ -628,6 +628,7 @@ "\"" + ErrorMsg + "\""); } -bool ento::shouldRegisterUninitializedObjectChecker(const LangOptions &LO) { +bool ento::shouldRegisterUninitializedObjectChecker( + const LangOptions &LO, const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp @@ -503,7 +503,8 @@ mgr.registerChecker(); \ } \ \ - bool ento::shouldRegister##CHECKERNAME(const LangOptions &LO) { \ + bool ento::shouldRegister##CHECKERNAME(const LangOptions &LO, \ + const AnalyzerOptions &Opts) { \ return true; \ } Index: clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp @@ -257,6 +257,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterUnreachableCodeChecker(const LangOptions &LO) { +bool ento::shouldRegisterUnreachableCodeChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp @@ -187,6 +187,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterVLASizeChecker(const LangOptions &LO) { +bool ento::shouldRegisterVLASizeChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp @@ -404,7 +404,8 @@ mgr.registerChecker(); } -bool ento::shouldRegisterValistBase(const LangOptions &LO) { +bool ento::shouldRegisterValistBase(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } @@ -416,7 +417,8 @@ mgr.getCurrentCheckerName(); \ } \ \ - bool ento::shouldRegister##name##Checker(const LangOptions &LO) { \ + bool ento::shouldRegister##name##Checker(const LangOptions &LO, \ + const AnalyzerOptions &Opts) { \ return true; \ } Index: clang/lib/StaticAnalyzer/Checkers/VforkChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/VforkChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/VforkChecker.cpp @@ -217,6 +217,7 @@ mgr.registerChecker(); } -bool ento::shouldRegisterVforkChecker(const LangOptions &LO) { +bool ento::shouldRegisterVforkChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return true; } Index: clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp @@ -224,14 +224,17 @@ } } -bool ento::shouldRegisterVirtualCallModeling(const LangOptions &LO) { +bool ento::shouldRegisterVirtualCallModeling(const LangOptions &LO, + const AnalyzerOptions &Opts) { return LO.CPlusPlus; } -bool ento::shouldRegisterPureVirtualCallChecker(const LangOptions &LO) { +bool ento::shouldRegisterPureVirtualCallChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return LO.CPlusPlus; } -bool ento::shouldRegisterVirtualCallChecker(const LangOptions &LO) { +bool ento::shouldRegisterVirtualCallChecker(const LangOptions &LO, + const AnalyzerOptions &Opts) { return LO.CPlusPlus; } Index: clang/lib/StaticAnalyzer/Checkers/cert/PutenvWithAutoChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/cert/PutenvWithAutoChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/cert/PutenvWithAutoChecker.cpp @@ -61,4 +61,7 @@ Mgr.registerChecker(); } -bool ento::shouldRegisterPutenvWithAuto(const LangOptions &) { return true; } +bool ento::shouldRegisterPutenvWithAuto(const LangOptions &, + const AnalyzerOptions &) { + return true; +} Index: clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp =================================================================== --- clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp +++ clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp @@ -219,18 +219,19 @@ static bool collectDependenciesImpl(const CheckerRegistry::ConstCheckerInfoList &Deps, const LangOptions &LO, + const AnalyzerOptions &Opts, CheckerRegistry::CheckerInfoSet &Ret); /// Collects dependenies in \p enabledCheckers. Return None on failure. LLVM_NODISCARD static llvm::Optional collectDependencies(const CheckerRegistry::CheckerInfo &checker, - const LangOptions &LO) { + const LangOptions &LO, const AnalyzerOptions &Opts) { CheckerRegistry::CheckerInfoSet Ret; // Add dependencies to the enabled checkers only if all of them can be // enabled. - if (!collectDependenciesImpl(checker.Dependencies, LO, Ret)) + if (!collectDependenciesImpl(checker.Dependencies, LO, Opts, Ret)) return None; return Ret; @@ -239,15 +240,16 @@ static bool collectDependenciesImpl(const CheckerRegistry::ConstCheckerInfoList &Deps, const LangOptions &LO, + const AnalyzerOptions &Opts, CheckerRegistry::CheckerInfoSet &Ret) { for (const CheckerRegistry::CheckerInfo *Dependency : Deps) { - if (Dependency->isDisabled(LO)) + if (Dependency->isDisabled(LO, Opts)) return false; // Collect dependencies recursively. - if (!collectDependenciesImpl(Dependency->Dependencies, LO, Ret)) + if (!collectDependenciesImpl(Dependency->Dependencies, LO, Opts, Ret)) return false; Ret.insert(Dependency); @@ -261,12 +263,12 @@ CheckerInfoSet EnabledCheckers; for (const CheckerInfo &Checker : Checkers) { - if (!Checker.isEnabled(LangOpts)) + if (!Checker.isEnabled(LangOpts, AnOpts)) continue; // Recursively enable its dependencies. llvm::Optional Deps = - collectDependencies(Checker, LangOpts); + collectDependencies(Checker, LangOpts, AnOpts); if (!Deps) { // If we failed to enable any of the dependencies, don't enable this