17#include "llvm/ADT/DenseMap.h"
21typedef llvm::DenseMap<Stmt*, Stmt*>
MapTy;
33 switch (S->getStmtClass()) {
34 case Stmt::PseudoObjectExprClass: {
38 auto [
Iter, Inserted] = M.try_emplace(SF, S);
45 for (
Stmt *SubStmt : S->children())
58 case Stmt::BinaryConditionalOperatorClass: {
59 assert(OVMode ==
OV_Transparent &&
"Should not appear alongside OVEs");
76 case Stmt::OpaqueValueExprClass: {
84 auto [
Iter, Inserted] = M.try_emplace(SrcExpr, S);
94 case Stmt::CapturedStmtClass:
95 for (
Stmt *SubStmt : S->children()) {
101 if (
Stmt *SubStmt = cast<CapturedStmt>(S)->getCapturedStmt()) {
107 for (
Stmt *SubStmt : S->children()) {
126 delete (
MapTy*) Impl;
139 M->insert(std::make_pair(
const_cast<Stmt *
>(S),
const_cast<Stmt *
>(
Parent)));
150 }
while (isa_and_nonnull<ParenExpr>(S));
158 while (S && (isa<ParenExpr>(S) || isa<CastExpr>(S)));
166 }
while (isa_and_nonnull<Expr>(S) &&
167 cast<Expr>(S)->IgnoreParenImpCasts() != S);
174 while (isa<ParenExpr>(S)) {
183 Stmt *DirectChild =
E;
186 while (
P && (isa<ParenExpr>(
P) || isa<CastExpr>(
P) ||
195 switch (
P->getStmtClass()) {
198 case Stmt::DeclStmtClass:
200 case Stmt::BinaryOperatorClass: {
206 case Stmt::ForStmtClass:
207 return DirectChild == cast<ForStmt>(
P)->getCond();
208 case Stmt::WhileStmtClass:
209 return DirectChild == cast<WhileStmt>(
P)->getCond();
210 case Stmt::DoStmtClass:
211 return DirectChild == cast<DoStmt>(
P)->getCond();
212 case Stmt::IfStmtClass:
213 return DirectChild == cast<IfStmt>(
P)->getCond();
214 case Stmt::IndirectGotoStmtClass:
215 return DirectChild == cast<IndirectGotoStmt>(
P)->getTarget();
216 case Stmt::SwitchStmtClass:
217 return DirectChild == cast<SwitchStmt>(
P)->getCond();
218 case Stmt::ObjCForCollectionStmtClass:
219 return DirectChild == cast<ObjCForCollectionStmt>(
P)->getCollection();
220 case Stmt::ReturnStmtClass:
static void BuildParentMap(MapTy &M, Stmt *S, OpaqueValueMode OVMode=OV_Transparent)
llvm::DenseMap< Stmt *, Stmt * > MapTy
Defines the Objective-C statement AST node classes.
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condition evaluates to false; ...
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value.
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
A builtin binary operation expression such as "x + y" or "x <= y".
This represents one expression.
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
bool isConsumedExpr(Expr *E) const
void addStmt(Stmt *S)
Adds and/or updates the parent/child-relations of the complete stmt tree of S.
void setParent(const Stmt *S, const Stmt *Parent)
Manually sets the parent of S to Parent.
Stmt * getOuterParenParent(Stmt *) const
Stmt * getParentIgnoreParenImpCasts(Stmt *) const
Stmt * getParentIgnoreParenCasts(Stmt *) const
Stmt * getParent(Stmt *) const
Stmt * getParentIgnoreParens(Stmt *) const
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
semantics_iterator semantics_end()
semantics_iterator semantics_begin()
Expr *const * semantics_iterator
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Stmt - This represents one statement.
The JSON file list parser is used to communicate input to InstallAPI.