I want to print the arguments passed in a function. But clang returns Parameter names used in the function definition. Here is my code:
if (CallExpr *call = dyn_cast<CallExpr>(st))
{
LangOptions LangOpts;
LangOpts.CPlusPlus = true;
PrintingPolicy Policy(LangOpts);
for(int i=0, j=call->getNumArgs(); i<j; i++)
{
std::string TypeS;
raw_string_ostream raw(TypeS);
call->getArg(i)->printPretty(raw, 0, Policy);
errs() << raw.str() << "\n";
}
}
Please tell what might be the problem.