clang plugin error

Hi ,
I am trying to write the plugin like PrinFunctionNames in clang. I create instance of “ASTConsumer” from “PluginASTAction’s” “createASTConsumer” method. I handle all FunctionDecl from HandleTopLevelDecl metod of ASTConsumer. I stored all the FunctionDecl in one global vector or any datastructure in my code. Now i want to print that vector in some print() function after completing all AST pasing . But when try to call print() function it will print null values.
can any one tell me what is the problem ?
thnks.

Hi ,
I am trying to write the plugin like PrinFunctionNames in clang. I
create instance of "ASTConsumer" from "PluginASTAction's"
"createASTConsumer" method. I handle all FunctionDecl from
HandleTopLevelDecl metod of ASTConsumer. I stored all the FunctionDecl in
one global vector or any datastructure in my code. Now i want to print that
vector in some print() function after completing all AST pasing . But when
try to call print() function it will print null values.
can any one tell me what is the problem ?
thnks.

I wouldn't rely on lifetime of the AST objects past the calls to
HandleTopLevelDecl. If you want to store information about the
FunctionDecls longer, I'd extract the data while inside
HandleTopLevelDecl and put that data into your own structures for
later processing.

Cheers,
/Manuel