This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG3dae01911b69: [analyzer] Make CheckerManager::hasPathSensitiveCheckers() complete again (authored by steakhal).
Changed prior to commit: https://reviews.llvm.org/D105101?vs=355179&id=355227#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105101/new/ https://reviews.llvm.org/D105101 Files: clang/lib/StaticAnalyzer/Core/CheckerManager.cpp Index: clang/lib/StaticAnalyzer/Core/CheckerManager.cpp =================================================================== --- clang/lib/StaticAnalyzer/Core/CheckerManager.cpp +++ clang/lib/StaticAnalyzer/Core/CheckerManager.cpp @@ -33,21 +33,20 @@ using namespace ento; bool CheckerManager::hasPathSensitiveCheckers() const { - return !StmtCheckers.empty() || - !PreObjCMessageCheckers.empty() || - !PostObjCMessageCheckers.empty() || - !PreCallCheckers.empty() || - !PostCallCheckers.empty() || - !LocationCheckers.empty() || - !BindCheckers.empty() || - !EndAnalysisCheckers.empty() || - !EndFunctionCheckers.empty() || - !BranchConditionCheckers.empty() || - !LiveSymbolsCheckers.empty() || - !DeadSymbolsCheckers.empty() || - !RegionChangesCheckers.empty() || - !EvalAssumeCheckers.empty() || - !EvalCallCheckers.empty(); + const auto IfAnyAreNonEmpty = [](const auto &... Callbacks) -> bool { + bool Result = false; + // FIXME: Use fold expressions in C++17. + LLVM_ATTRIBUTE_UNUSED int Unused[]{0, (Result |= !Callbacks.empty())...}; + return Result; + }; + return IfAnyAreNonEmpty( + StmtCheckers, PreObjCMessageCheckers, ObjCMessageNilCheckers, + PostObjCMessageCheckers, PreCallCheckers, PostCallCheckers, + LocationCheckers, BindCheckers, EndAnalysisCheckers, + BeginFunctionCheckers, EndFunctionCheckers, BranchConditionCheckers, + NewAllocatorCheckers, LiveSymbolsCheckers, DeadSymbolsCheckers, + RegionChangesCheckers, PointerEscapeCheckers, EvalAssumeCheckers, + EvalCallCheckers, EndOfTranslationUnitCheckers); } void CheckerManager::finishedCheckerRegistration() {
Index: clang/lib/StaticAnalyzer/Core/CheckerManager.cpp =================================================================== --- clang/lib/StaticAnalyzer/Core/CheckerManager.cpp +++ clang/lib/StaticAnalyzer/Core/CheckerManager.cpp @@ -33,21 +33,20 @@ using namespace ento; bool CheckerManager::hasPathSensitiveCheckers() const { - return !StmtCheckers.empty() || - !PreObjCMessageCheckers.empty() || - !PostObjCMessageCheckers.empty() || - !PreCallCheckers.empty() || - !PostCallCheckers.empty() || - !LocationCheckers.empty() || - !BindCheckers.empty() || - !EndAnalysisCheckers.empty() || - !EndFunctionCheckers.empty() || - !BranchConditionCheckers.empty() || - !LiveSymbolsCheckers.empty() || - !DeadSymbolsCheckers.empty() || - !RegionChangesCheckers.empty() || - !EvalAssumeCheckers.empty() || - !EvalCallCheckers.empty(); + const auto IfAnyAreNonEmpty = [](const auto &... Callbacks) -> bool { + bool Result = false; + // FIXME: Use fold expressions in C++17. + LLVM_ATTRIBUTE_UNUSED int Unused[]{0, (Result |= !Callbacks.empty())...}; + return Result; + }; + return IfAnyAreNonEmpty( + StmtCheckers, PreObjCMessageCheckers, ObjCMessageNilCheckers, + PostObjCMessageCheckers, PreCallCheckers, PostCallCheckers, + LocationCheckers, BindCheckers, EndAnalysisCheckers, + BeginFunctionCheckers, EndFunctionCheckers, BranchConditionCheckers, + NewAllocatorCheckers, LiveSymbolsCheckers, DeadSymbolsCheckers, + RegionChangesCheckers, PointerEscapeCheckers, EvalAssumeCheckers, + EvalCallCheckers, EndOfTranslationUnitCheckers); } void CheckerManager::finishedCheckerRegistration() {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits