26 if (S->getBeginLoc().isMacroID())
29 if (S->getEndLoc().isMacroID())
32 for (
const Stmt *Child : S->children())
43 if (DR && isa<EnumConstantDecl>(DR->
getDecl()))
46 for (
const Stmt *Child : S->children())
59 if (VD->isStaticLocal())
62 for (
const Stmt *Child : S->children())
71 if (isa<OffsetOfExpr>(S))
74 for (
const Stmt *Child : S->children())
82std::pair<const clang::VarDecl *, const clang::Expr *>
85 const Expr *RHS =
nullptr;
87 if (
auto Assign = dyn_cast_or_null<BinaryOperator>(S)) {
88 if (Assign->isAssignmentOp()) {
90 RHS = Assign->getRHS();
91 if (
auto DE = dyn_cast_or_null<DeclRefExpr>(Assign->getLHS()))
92 VD = dyn_cast_or_null<VarDecl>(DE->getDecl());
94 }
else if (
auto PD = dyn_cast_or_null<DeclStmt>(S)) {
96 assert(PD->isSingleDecl() &&
"We process decls one by one");
97 VD = cast<VarDecl>(PD->getSingleDecl());
101 return std::make_pair(VD, RHS);