41 if (DR && isa<EnumConstantDecl>(DR->
getDecl()))
57 if (VD->isStaticLocal())
69 if (isa<OffsetOfExpr>(S))
80 std::pair<const clang::VarDecl *, const clang::Expr *>
83 const Expr *RHS =
nullptr;
85 if (
auto Assign = dyn_cast_or_null<BinaryOperator>(S)) {
86 if (Assign->isAssignmentOp()) {
88 RHS = Assign->getRHS();
89 if (
auto DE = dyn_cast_or_null<DeclRefExpr>(Assign->getLHS()))
90 VD = dyn_cast_or_null<VarDecl>(DE->getDecl());
92 }
else if (
auto PD = dyn_cast_or_null<DeclStmt>(S)) {
94 assert(PD->isSingleDecl() &&
"We process decls one by one");
95 VD = dyn_cast_or_null<VarDecl>(PD->getSingleDecl());
96 RHS = VD->getAnyInitializer();
99 return std::make_pair(VD, RHS);
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)
std::pair< const clang::VarDecl *, const clang::Expr * > parseAssignment(const Stmt *S)
Expr - This represents one expression.
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocEnd() 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)