I'm using the go-clang library to parse the following C file: aac.c. For some reason when I run the file through clang and dump the AST, I don't get AST output for certain functions. For example, the C file contains a forward declaration of aac_ioctl_send_raw_srb
and the actual definition later on in the file.
Given this I was expecting to see two AST nodes in the output but only one FuncDecl
(the forward declaration) is dumped:
clang -Xclang -ast-dump -fsyntax-only aac.c | grep "aac_ioctl_send_raw_srb" | wc -l
aac.c:38:10: fatal error: 'opt_aac.h' file not found
#include "opt_aac.h"
^
1 error generated.
1 <--- wc output
(Ignoring the error)
I get the same result using the go-clang library to parse the C file from within my own application. Is there any explanation for why the definition is not dumped?