DeclRefExpr - function call arguments

Hi All,I have a got declrefexpr of the form 'change_value(x)', where I find
the references to 'x'I am writing a tool to change 'x' to 'y'.But, I am not
able to find a way to identify 'x' field in the DeclRefExpr, which only
shows 'change_value' when I print the characters within the sourcerange of
the DeclRefexpr.Can anyone help me with this asap ? I only need the 'x'
portion of 'change_value(x)'.Much Appreciated,..Yogi.

I’m fairly new in this so I might be mistaken, but looking at the AST of a sample code I wrote, I can see that the DeclRefExpr that represents the function, is a child of a CallExpr. The other child of that same CallExpr is a DeclRefExpr that represents the function call argument:

(CallExpr 0x484fd00 <col:12, col:28> ‘char *’
(ImplicitCastExpr 0x484fce8 col:12 ‘char ()(char *)’
(DeclRefExpr 0x484fc68 col:12 ‘char *(char *)’ Function 0x484f100 ‘copy_buffer’ ‘char *(char *)’))
(ImplicitCastExpr 0x484fd30 col:24 ‘char *’
(DeclRefExpr 0x484fc90 col:24 ‘char [100]’ lvalue Var 0x484f960 ‘buf1’ ‘char [100]’)))"))

You can use that to acquire the function call argument.

Hope it helps,