22 using namespace clang;
27 class TrustNonnullChecker :
public Checker<check::PostCall> {
41 if (!isa<ObjCMethodCall>(&Call))
44 const auto *MCall = cast<ObjCMethodCall>(&Call);
48 if (isa<ObjCProtocolDecl>(MD->getDeclContext()))
51 QualType DeclRetType = MD->getReturnType();
57 if (!MCall->isInstanceMessage())
61 SVal Receiver = MCall->getReceiverSVal();
77 if (isNonNullPtr(Call, C))
79 State = State->assume(*L,
true);
A (possibly-)qualified type.
ExplodedNode * addTransition(ProgramStateRef State=nullptr, const ProgramPointTag *Tag=nullptr)
Generates a new transition in the program state graph (ExplodedGraph).
ObjCMethodDecl - Represents an instance or class method declaration.
SVal getReturnValue() const
Returns the return value of the call.
bool isConstrainedTrue() const
Return true if the constraint is perfectly constrained to 'true'.
bool isInSystemHeader() const
Returns true if the callee is known to be from a system header.
Optional< T > getAs() const
Convert to the specified SVal type, returning None if this SVal is not of the desired type...
CHECKER * registerChecker(AT... Args)
Used to register checkers.
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
bool isAnyPointerType() const
Dataflow Directional Tag Classes.
Nullability getNullabilityAnnotation(QualType Type)
Get nullability annotation for a given type.
Represents an abstract call to a function or method along a particular path.
const ProgramStateRef & getState() const
QualType getResultType() const
Returns the result type, adjusted for references.