This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Gcc Plugin and AST/variable question
- From: Kyle Girard <kyle at kdmanalytics dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 27 Jan 2011 11:35:25 -0500
- Subject: Gcc Plugin and AST/variable question
I have two files:
foo.h:
extern int x;
extern int y;
foo.c:
#include "foo.h"
int x;
int y;
I have written a gcc plugin that traverses the gcc AST ... However in
the situation where I compile the above file I cannot seem to access the
int x and int y decls. If I place a dummy function in the foo.c file I
can get the decl's for x and y and I'm good however this isn't always
the case in real code.
Is there a list buried in gcc somewhere that I can traverse to get
access these decls? Or are they ignored?
Thanks,
Kyle