[PATCH] D123464: [analyzer] Clean checker options from bool to DefaultBool (NFC)
Vince Bridgers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Apr 10 05:48:59 PDT 2022
vabridgers created this revision.
vabridgers added reviewers: NoQ, steakhal.
Herald added subscribers: manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun.
Herald added a project: All.
vabridgers requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
A recent review emphasized the preference to use DefaultBool instead of
bool for checker options. This change is a NFC and cleans up some of the
instances where bool was used, and could be changed to DefaultBool.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D123464
Files:
clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
Index: clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
+++ clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
@@ -44,7 +44,7 @@
public:
// These are going to be null if the respective check is disabled.
mutable std::unique_ptr<BugType> BT_Pure, BT_Impure;
- bool ShowFixIts = false;
+ DefaultBool ShowFixIts;
void checkBeginFunction(CheckerContext &C) const;
void checkEndFunction(const ReturnStmt *RS, CheckerContext &C) const;
Index: clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
===================================================================
--- clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
+++ clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
@@ -71,11 +71,11 @@
namespace ento {
struct UninitObjCheckerOptions {
- bool IsPedantic = false;
- bool ShouldConvertNotesToWarnings = false;
- bool CheckPointeeInitialization = false;
+ DefaultBool IsPedantic;
+ DefaultBool ShouldConvertNotesToWarnings;
+ DefaultBool CheckPointeeInitialization;
std::string IgnoredRecordsWithFieldPattern;
- bool IgnoreGuardedFields = false;
+ DefaultBool IgnoreGuardedFields;
};
/// A lightweight polymorphic wrapper around FieldRegion *. We'll use this
Index: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
+++ clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
@@ -566,9 +566,9 @@
DefaultBool ChecksEnabled[CK_NumCheckKinds];
CheckerNameRef CheckNames[CK_NumCheckKinds];
- bool DisplayLoadedSummaries = false;
- bool ModelPOSIX = false;
- bool ShouldAssumeControlledEnvironment = false;
+ DefaultBool DisplayLoadedSummaries;
+ DefaultBool ModelPOSIX;
+ DefaultBool ShouldAssumeControlledEnvironment;
private:
Optional<Summary> findFunctionSummary(const FunctionDecl *FD,
Index: clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h
===================================================================
--- clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h
+++ clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h
@@ -267,13 +267,13 @@
static std::unique_ptr<CheckerProgramPointTag> CastFailTag;
/// Track Objective-C and CoreFoundation objects.
- bool TrackObjCAndCFObjects = false;
+ DefaultBool TrackObjCAndCFObjects;
/// Track sublcasses of OSObject.
- bool TrackOSObjects = false;
+ DefaultBool TrackOSObjects;
/// Track initial parameters (for the entry point) for NS/CF objects.
- bool TrackNSCFStartParam = false;
+ DefaultBool TrackNSCFStartParam;
RetainCountChecker() {};
Index: clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
+++ clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
@@ -120,7 +120,7 @@
namespace {
class DeadStoresChecker : public Checker<check::ASTCodeBody> {
public:
- bool ShowFixIts = false;
+ DefaultBool ShowFixIts;
bool WarnForDeadNestedAssignments = true;
void checkASTCodeBody(const Decl *D, AnalysisManager &Mgr,
Index: clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
+++ clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
@@ -30,7 +30,7 @@
public:
// Checker options.
int MinComplexity;
- bool ReportNormalClones;
+ DefaultBool ReportNormalClones;
StringRef IgnoredFilesPattern;
private:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123464.421785.patch
Type: text/x-patch
Size: 3860 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220410/92d2ba1e/attachment-0001.bin>
More information about the cfe-commits
mailing list