Hello All,
I am trying to find the clang::FunctionDecl relevant to a return expression (clang::Expr). For example consider following function;
- int foo(int a, int b) {
- int k;
- int d = 5 * k;
- return d;
- }
I have an expression (clang::Expr type) relevant to line 6 (return statement). From that I want to access the function declaration (clang::FunctionDecl) where return statement resides (i.e. foo).
Further I need to access declarations relevant to lines 3 and 4. I believe I can access name declarations relevant to lines 3 and 4 once I have access to FunctionDecl.
Could you please advise how to access clang::FunctionDecl from clang::Expr ?
Thank you in advance.
Regards
-Thejaka