clang 17.0.0git
|
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Path.h"
Go to the source code of this file.
Macros | |
#define | REGISTER_CHECKER(name, trackingRequired) |
Enumerations | |
enum class | NullConstraint { IsNull , IsNotNull , Unknown } |
Functions | |
REGISTER_MAP_WITH_PROGRAMSTATE (NullabilityMap, const MemRegion *, NullabilityState) REGISTER_MAP_WITH_PROGRAMSTATE(PropertyAccessesMap | |
static NullConstraint | getNullConstraint (DefinedOrUnknownSVal Val, ProgramStateRef State) |
static bool | isValidPointerType (QualType T) |
static bool | checkValueAtLValForInvariantViolation (ProgramStateRef State, SVal LV, QualType T) |
Returns true when the value stored at the given location has been constrained to null after being passed through an object of nonnnull type. | |
static bool | checkParamsForPreconditionViolation (ArrayRef< ParmVarDecl * > Params, ProgramStateRef State, const LocationContext *LocCtxt) |
static bool | checkSelfIvarsForInvariantViolation (ProgramStateRef State, const LocationContext *LocCtxt) |
static bool | checkInvariantViolation (ProgramStateRef State, ExplodedNode *N, CheckerContext &C) |
static const Expr * | lookThroughImplicitCasts (const Expr *E) |
Find the outermost subexpression of E that is not an implicit cast. | |
static Nullability | getReceiverNullability (const ObjCMethodCall &M, ProgramStateRef State) |
static const Expr * | matchValueExprForBind (const Stmt *S) |
For a given statement performing a bind, attempt to syntactically match the expression resulting in the bound value. | |
static bool | isARCNilInitializedLocal (CheckerContext &C, const Stmt *S) |
Returns true if. | |
Variables | |
ObjectPropPair | |
#define REGISTER_CHECKER | ( | name, | |
trackingRequired | |||
) |
Definition at line 1359 of file NullabilityChecker.cpp.
|
strong |
Enumerator | |
---|---|
IsNull | |
IsNotNull | |
Unknown |
Definition at line 297 of file NullabilityChecker.cpp.
|
static |
Definition at line 448 of file NullabilityChecker.cpp.
References clang::C, checkParamsForPreconditionViolation(), checkSelfIvarsForInvariantViolation(), clang::LocationContext::getDecl(), and clang::ento::ExplodedNode::isSink().
|
static |
Definition at line 401 of file NullabilityChecker.cpp.
References checkValueAtLValForInvariantViolation(), and clang::ento::SVal::getType().
Referenced by checkInvariantViolation().
|
static |
Definition at line 418 of file NullabilityChecker.cpp.
References checkValueAtLValForInvariantViolation(), clang::LocationContext::getDecl(), clang::ObjCObjectPointerType::getInterfaceDecl(), clang::LocationContext::getSelfDecl(), clang::ValueDecl::getType(), and clang::ento::SVal::getType().
Referenced by checkInvariantViolation().
|
static |
Returns true when the value stored at the given location has been constrained to null after being passed through an object of nonnnull type.
Definition at line 375 of file NullabilityChecker.cpp.
References clang::ento::SVal::getAs(), clang::ento::getNullabilityAnnotation(), getNullConstraint(), and IsNull.
Referenced by checkParamsForPreconditionViolation(), and checkSelfIvarsForInvariantViolation().
|
static |
Definition at line 299 of file NullabilityChecker.cpp.
References clang::ento::ConditionTruthVal::isConstrainedFalse(), clang::ento::ConditionTruthVal::isConstrainedTrue(), IsNotNull, IsNull, and Unknown.
Referenced by checkValueAtLValForInvariantViolation(), and getReceiverNullability().
|
static |
Definition at line 878 of file NullabilityChecker.cpp.
References clang::ento::SVal::getAs(), getNullConstraint(), clang::ento::ObjCMethodCall::getReceiverSVal(), IsNotNull, and clang::ento::ObjCMethodCall::isReceiverSelfOrSuper().
|
static |
Returns true if.
S | is a DeclStmt for a local variable that ObjC automated reference counting initialized with zero. |
Definition at line 1172 of file NullabilityChecker.cpp.
References clang::C.
Definition at line 309 of file NullabilityChecker.cpp.
References clang::Type::isAnyPointerType(), and clang::Type::isBlockPointerType().
Find the outermost subexpression of E that is not an implicit cast.
This looks through the implicit casts to _Nonnull that ARC adds to return expressions of ObjC types when the return type of the function or method is non-null but the express is not.
Definition at line 616 of file NullabilityChecker.cpp.
References clang::Expr::IgnoreImpCasts().
For a given statement performing a bind, attempt to syntactically match the expression resulting in the bound value.
Definition at line 1148 of file NullabilityChecker.cpp.
REGISTER_MAP_WITH_PROGRAMSTATE | ( | NullabilityMap | , |
const MemRegion * | , | ||
NullabilityState | |||
) |
ObjectPropPair |
Definition at line 268 of file NullabilityChecker.cpp.