how to get info from Decl

Hi!

I have implemented HandleTopLevelDecl in an own ASTConsumer
and want to get some Info from the declarations.

I already get the function names and the names of the
parameters, but how can I get the type of the arguments out of
ParamVarDecl?

If a function is extern "C", I get a LinkageSpecDecl, but how
do I get the function inside this declaration?

-Jochen

Hi!

I have implemented HandleTopLevelDecl in an own ASTConsumer
and want to get some Info from the declarations.

I already get the function names and the names of the
parameters, but how can I get the type of the arguments out of
ParamVarDecl?

The getType() function on ParmVarDecl returns the type of the parameter. getOriginalType() returns the type as it was written in the source code.

If a function is extern "C", I get a LinkageSpecDecl, but how
do I get the function inside this declaration?

A LinkageSpecDecl is a DeclContext, which you can traverse using its member functions decls_begin()/decls_end(), which return DeclContext::decl_iterator iterators. This is how you traverse anything that has nested declarations, including namespaces and classes.

  - Doug