How to get parameter information as a string from FunctionDecl class in clang . I'm trying but getting confused by so many inheritances. Also they compiler is saying that getReturnType() is not a member of FunctionDecl but doxygen documentation says otherwise . Please help. http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html
using namespace std;
using namespace clang;
using namespace clang::driver;
using namespace clang::tooling;
using namespace llvm;
.......
class ExampleVisitor : public RecursiveASTVisitor<ExampleVisitor>
{
......
virtual bool VisitFunctionDecl(FunctionDecl *func)
{
numFunctions++;
string funcName = func->getNameInfo().getName().getAsString();
string retName = func->getReturnType().getAsString();
...
return true;
}
}
Errors:-
‘class clang::FunctionDecl’ has no member named ‘getReturnType’