clang API Documentation
#include <ParentMap.h>
Public Member Functions | |
ParentMap (Stmt *ASTRoot) | |
~ParentMap () | |
void | addStmt (Stmt *S) |
Adds and/or updates the parent/child-relations of the complete stmt tree of S. All children of S including indirect descendants are visited and updated or inserted but not the parents of S. | |
void | setParent (const Stmt *S, const Stmt *Parent) |
Stmt * | getParent (Stmt *) const |
Stmt * | getParentIgnoreParens (Stmt *) const |
Stmt * | getParentIgnoreParenCasts (Stmt *) const |
Stmt * | getParentIgnoreParenImpCasts (Stmt *) const |
Stmt * | getOuterParenParent (Stmt *) const |
const Stmt * | getParent (const Stmt *S) const |
const Stmt * | getParentIgnoreParens (const Stmt *S) const |
const Stmt * | getParentIgnoreParenCasts (const Stmt *S) const |
bool | hasParent (Stmt *S) const |
bool | isConsumedExpr (Expr *E) const |
bool | isConsumedExpr (const Expr *E) const |
Definition at line 21 of file ParentMap.h.
ParentMap::ParentMap | ( | Stmt * | ASTRoot | ) |
Definition at line 95 of file ParentMap.cpp.
References BuildParentMap().
Definition at line 103 of file ParentMap.cpp.
void ParentMap::addStmt | ( | Stmt * | S | ) |
Adds and/or updates the parent/child-relations of the complete stmt tree of S. All children of S including indirect descendants are visited and updated or inserted but not the parents of S.
Definition at line 107 of file ParentMap.cpp.
References BuildParentMap().
Stmt * ParentMap::getOuterParenParent | ( | Stmt * | S | ) | const |
Definition at line 148 of file ParentMap.cpp.
References getParent(), Paren, and S.
Stmt * ParentMap::getParent | ( | Stmt * | S | ) | const |
Definition at line 120 of file ParentMap.cpp.
Referenced by addParentsForSyntheticStmts(), getOuterParenParent(), getParent(), getParentIgnoreParenCasts(), getParentIgnoreParenImpCasts(), getParentIgnoreParens(), hasParent(), isConsumedExpr(), isContainedByStmt(), isDeadReturn(), isInLoop(), lexicalContains(), mayInlineCallKind(), and removePunyEdges().
const Stmt* clang::ParentMap::getParent | ( | const Stmt * | S | ) | const [inline] |
Definition at line 43 of file ParentMap.h.
References getParent().
Stmt * ParentMap::getParentIgnoreParenCasts | ( | Stmt * | S | ) | const |
Definition at line 131 of file ParentMap.cpp.
References getParent(), and S.
Referenced by clang::ObjCMethodCall::getMessageKind(), getParentIgnoreParenCasts(), and rewriteToArrayLiteral().
const Stmt* clang::ParentMap::getParentIgnoreParenCasts | ( | const Stmt * | S | ) | const [inline] |
Definition at line 51 of file ParentMap.h.
References getParentIgnoreParenCasts().
Stmt * ParentMap::getParentIgnoreParenImpCasts | ( | Stmt * | S | ) | const |
Definition at line 140 of file ParentMap.cpp.
References getParent(), and S.
Stmt * ParentMap::getParentIgnoreParens | ( | Stmt * | S | ) | const |
Definition at line 126 of file ParentMap.cpp.
References getParent(), and S.
Referenced by clang::CFGStmtMap::getBlock(), getEnclosingParent(), getParentIgnoreParens(), and getStmtParent().
const Stmt* clang::ParentMap::getParentIgnoreParens | ( | const Stmt * | S | ) | const [inline] |
Definition at line 47 of file ParentMap.h.
References getParentIgnoreParens().
bool clang::ParentMap::hasParent | ( | Stmt * | S | ) | const [inline] |
Definition at line 55 of file ParentMap.h.
References getParent().
bool ParentMap::isConsumedExpr | ( | Expr * | E | ) | const |
Definition at line 157 of file ParentMap.cpp.
References clang::BO_Comma, clang::BinaryOperator::getOpcode(), getParent(), clang::BinaryOperator::getRHS(), clang::Stmt::getStmtClass(), and P.
Referenced by getEnclosingParent(), isConsumedExpr(), optimizeEdges(), and shouldRemoveDeadBindings().
bool clang::ParentMap::isConsumedExpr | ( | const Expr * | E | ) | const [inline] |
Definition at line 61 of file ParentMap.h.
References isConsumedExpr().
void ParentMap::setParent | ( | const Stmt * | S, |
const Stmt * | Parent | ||
) |
Manually sets the parent of S
to Parent
.
If S
is already in the map, this method will update the mapping.
Definition at line 113 of file ParentMap.cpp.
Referenced by addParentsForSyntheticStmts().