clang 22.0.0git
clang::ParentMap Class Reference

#include "clang/AST/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.
void setParent (const Stmt *S, const Stmt *Parent)
 Manually sets the parent of S to Parent.
StmtgetParent (Stmt *) const
StmtgetParentIgnoreParens (Stmt *) const
StmtgetParentIgnoreParenCasts (Stmt *) const
StmtgetParentIgnoreParenImpCasts (Stmt *) const
StmtgetOuterParenParent (Stmt *) const
const StmtgetParent (const Stmt *S) const
const StmtgetParentIgnoreParens (const Stmt *S) const
const StmtgetParentIgnoreParenCasts (const Stmt *S) const
bool hasParent (const Stmt *S) const
bool isConsumedExpr (Expr *E) const
bool isConsumedExpr (const Expr *E) const

Detailed Description

Definition at line 20 of file ParentMap.h.

Constructor & Destructor Documentation

◆ ParentMap()

ParentMap::ParentMap ( Stmt * ASTRoot)

Definition at line 117 of file ParentMap.cpp.

References BuildParentMap(), and clang::nullptr.

◆ ~ParentMap()

ParentMap::~ParentMap ( )

Definition at line 125 of file ParentMap.cpp.

Member Function Documentation

◆ addStmt()

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 129 of file ParentMap.cpp.

References BuildParentMap().

◆ getOuterParenParent()

Stmt * ParentMap::getOuterParenParent ( Stmt * S) const

Definition at line 172 of file ParentMap.cpp.

References getParent(), clang::isa(), and Paren.

◆ getParent() [1/2]

const Stmt * clang::ParentMap::getParent ( const Stmt * S) const
inline

Definition at line 42 of file ParentMap.h.

References getParent().

◆ getParent() [2/2]

◆ getParentIgnoreParenCasts() [1/2]

const Stmt * clang::ParentMap::getParentIgnoreParenCasts ( const Stmt * S) const
inline

Definition at line 50 of file ParentMap.h.

References getParentIgnoreParenCasts().

◆ getParentIgnoreParenCasts() [2/2]

Stmt * ParentMap::getParentIgnoreParenCasts ( Stmt * S) const

◆ getParentIgnoreParenImpCasts()

Stmt * ParentMap::getParentIgnoreParenImpCasts ( Stmt * S) const

Definition at line 163 of file ParentMap.cpp.

References clang::cast(), and getParent().

◆ getParentIgnoreParens() [1/2]

const Stmt * clang::ParentMap::getParentIgnoreParens ( const Stmt * S) const
inline

Definition at line 46 of file ParentMap.h.

References getParentIgnoreParens().

◆ getParentIgnoreParens() [2/2]

Stmt * ParentMap::getParentIgnoreParens ( Stmt * S) const

Definition at line 147 of file ParentMap.cpp.

References getParent().

Referenced by getEnclosingParent(), getParentIgnoreParens(), and getStmtParent().

◆ hasParent()

bool clang::ParentMap::hasParent ( const Stmt * S) const
inline

Definition at line 54 of file ParentMap.h.

References getParent().

◆ isConsumedExpr() [1/2]

bool clang::ParentMap::isConsumedExpr ( const Expr * E) const
inline

Definition at line 58 of file ParentMap.h.

References isConsumedExpr().

◆ isConsumedExpr() [2/2]

◆ setParent()

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 135 of file ParentMap.cpp.

Referenced by addParentsForSyntheticStmts().


The documentation for this class was generated from the following files: