I am trying to get the type of parameters and type of return of a C function.
For example I have function:
int addTwoIntegers(int a, int b){
return a + b;
}
What I need is: int (int, int)
I am using clang frontend to generate AST. Currently I have:
CXString cursorVariables = clang_getCursorDisplayName( cursor );
string methodDecl = clang_getCString( cursorVariables );
cout << methodDecl << '\n';
It gives me:
addTwoIntegers(int, int)
and nothing about the type of the return value. My question is how should I get the return type of function from cursor CXCursor_FunctionDecl?