I’m just getting started with libclang and experimenting with parsing header files, so let me apologize in advance for the basic questions. If I have a function signature with a return type that’s defined in an included header, then clang_visitChildren recognizes the function as a VarDecl. For example:
#include <MyTypes.h>
Status __stdcall MyFunc(int a, double d);
In the above, the “Status” is defined in MyTypes.h. If I change “Status” to “int” (or if I #define Status above the function), then visitChildren properly takes me to a FunctionDecl for MyFunc. I’ve tried calling parseTranslationUnit on MyTypes.h as part of the same index on which I call parseTranslationUnit for the main header, but that doesn’t seem to help. I feel like I’m missing something basic here.
Thanks very much in advance.
Regards,
Kirk Fertitta
Chief Technical Officer
Pacific MindWorks, Inc.
ph: 858-207-6198
fax: 858-521-1385