Skip to content

sg::ancestor

finds an ancestor node with a given type

Synopsis

Declared in <SageIII/sageInterface/sageGeneric.h>

template<class AncestorNode>
AncestorNode*
ancestor(SgNode* n);

Description

the function family comes in four variants: ‐ SgNode* ‐> AncestorNode* ( result can be NULL ) ‐ const SgNode* ‐> const AncestorNode* ( result can be NULL ) ‐ SgNode& ‐> AncestorNode& ( assert(false) when an ancestor of the specified type cannot be found ) ‐ const SgNode& ‐> const AncestorNode& ( assert(false) when an ancestor of the specified type cannot be found )

const SgStatement* enclosingStatement(const SgExpression* e)  { return
sg::ancestor<SgStatement>(e); }

Parameters

Name

Description

n

This class represents the base class for all IR nodes within Sage III.

Created with MrDocs