18#include "llvm/ADT/DenseMap.h"
22typedef llvm::DenseMap<Stmt*, Stmt*>
MapTy;
34 switch (S->getStmtClass()) {
35 case Stmt::PseudoObjectExprClass: {
43 for (
Stmt *SubStmt : S->children())
57 case Stmt::BinaryConditionalOperatorClass: {
58 assert(OVMode ==
OV_Transparent &&
"Should not appear alongside OVEs");
75 case Stmt::OpaqueValueExprClass: {
88 case Stmt::CapturedStmtClass:
89 for (
Stmt *SubStmt : S->children()) {
95 if (
Stmt *SubStmt = cast<CapturedStmt>(S)->getCapturedStmt()) {
101 for (
Stmt *SubStmt : S->children()) {
120 delete (
MapTy*) Impl;
133 M->insert(std::make_pair(
const_cast<Stmt *
>(S),
const_cast<Stmt *
>(
Parent)));
144 }
while (isa_and_nonnull<ParenExpr>(S));
152 while (S && (isa<ParenExpr>(S) || isa<CastExpr>(S)));
160 }
while (isa_and_nonnull<Expr>(S) &&
161 cast<Expr>(S)->IgnoreParenImpCasts() != S);
168 while (isa<ParenExpr>(S)) {
177 Stmt *DirectChild =
E;
180 while (
P && (isa<ParenExpr>(
P) || isa<CastExpr>(
P) ||
189 switch (
P->getStmtClass()) {
192 case Stmt::DeclStmtClass:
194 case Stmt::BinaryOperatorClass: {
200 case Stmt::ForStmtClass:
201 return DirectChild == cast<ForStmt>(
P)->getCond();
202 case Stmt::WhileStmtClass:
203 return DirectChild == cast<WhileStmt>(
P)->getCond();
204 case Stmt::DoStmtClass:
205 return DirectChild == cast<DoStmt>(
P)->getCond();
206 case Stmt::IfStmtClass:
207 return DirectChild == cast<IfStmt>(
P)->getCond();
208 case Stmt::IndirectGotoStmtClass:
209 return DirectChild == cast<IndirectGotoStmt>(
P)->getTarget();
210 case Stmt::SwitchStmtClass:
211 return DirectChild == cast<SwitchStmt>(
P)->getCond();
212 case Stmt::ObjCForCollectionStmtClass:
213 return DirectChild == cast<ObjCForCollectionStmt>(
P)->getCollection();
214 case Stmt::ReturnStmtClass:
Defines the clang::Expr interface and subclasses for C++ expressions.
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.