[cfe-dev] looking "up" the tree in RecursiveASTVisitor?

Noel Grandin via cfe-dev cfe-dev at lists.llvm.org
Thu Jan 28 06:01:37 PST 2016


Hi

Is there a straightforward way to look "up" the tree when implementing
a clang plugin using RecursiveASTVisitor ?

I've bumped into this a couple of times and never found a "nice" answer.

For example, I have overridden

       VisitCallExpr(const CallExpr* expr)

and I want to know in which context the call is happening i.e. from
which FunctionDecl the call is being made.

It seems like there should be an easy way to walk back up the tree?

Thanks, Noel Grandin



More information about the cfe-dev mailing list