40 if (DR && isa<EnumConstantDecl>(DR->
getDecl()))
56 if (VD->isStaticLocal())
68 if (isa<OffsetOfExpr>(S))
79 std::pair<const clang::VarDecl *, const clang::Expr *>
82 const Expr *RHS =
nullptr;
84 if (
auto Assign = dyn_cast_or_null<BinaryOperator>(S)) {
85 if (Assign->isAssignmentOp()) {
87 RHS = Assign->getRHS();
88 if (
auto DE = dyn_cast_or_null<DeclRefExpr>(Assign->getLHS()))
89 VD = dyn_cast_or_null<VarDecl>(DE->getDecl());
91 }
else if (
auto PD = dyn_cast_or_null<DeclStmt>(S)) {
93 assert(PD->isSingleDecl() &&
"We process decls one by one");
94 VD = dyn_cast_or_null<VarDecl>(PD->getSingleDecl());
95 RHS = VD->getAnyInitializer();
98 return std::make_pair(VD, RHS);
105 if (AttrType->getAttrKind() == attr::TypeNullable)
107 else if (AttrType->getAttrKind() == attr::TypeNonNull)
A (possibly-)qualified type.
bool containsStaticLocal(const Stmt *S)
Stmt - This represents one statement.
The base class of the type hierarchy.
Represents a variable declaration or definition.
const T * getAs() const
Member-template getAs<specific type>'.
bool containsBuiltinOffsetOf(const Stmt *S)
SourceLocation getBeginLoc() const LLVM_READONLY
std::pair< const clang::VarDecl *, const clang::Expr * > parseAssignment(const Stmt *S)
This represents one expression.
SourceLocation getEndLoc() const LLVM_READONLY
Dataflow Directional Tag Classes.
Nullability getNullabilityAnnotation(QualType Type)
Get nullability annotation for a given type.
An attributed type is a type to which a type attribute has been applied.
bool containsMacro(const Stmt *S)
A reference to a declared variable, function, enum, etc.
bool containsEnum(const Stmt *S)