the method of getDirectCallee() can get the callee(be called
method/function) of the call expression,
but Is there any way to get the caller(the method/ function who called it)
of the CallExpr* in VisitCallExpr () method?
Can anyone help me for this problem, or are there any other ways to know the
caller of one call expression?
Thanks in advance for any help...
Clang doesn’t store parental relationships of AST nodes by default. So you’d have to keep track of that yourself. If you’re working with AST matches I Selene you can use the ‘parent map’ for this.
Hi, Thanks very much for help.
What a shame, for this reason, it can be much more complicated to get the
caller of the callexpr.
And if there are any other way to get the caller method of the callexpr.