[cfe-dev] Function declaration basics

Kirk Fertitta kirk at pacificmindworks.com
Fri Sep 27 07:48:02 PDT 2013


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130927/41ee9ec0/attachment.html>


More information about the cfe-dev mailing list