This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Plugin: global vs global static in c/c++ AST representation
- From: gcc frickler <gccfrickler at privatdemail dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 24 May 2013 06:47:53 +0200
- Subject: Plugin: global vs global static in c/c++ AST representation
- References: <519E6FC6 dot 5030502 at privatdemail dot net>
Hi,
does anybody know how to distinguish a global from a global static
variable while walking the AST in the plugin?
eg.
int glob;
static int moduleGlob;
void f() {static int inner;}
All of them go into the bss segment but the static int moduleGlob is
exported with a mangled name to a .so (so it doesn't conflict at link time)
It does not seem to be a attribute of a VAR_DECL
The static predicate in the bitfield is just saying it goes in the bss
segment (true in all of the above cases) and has got nothing to do with
the static keyword which just controls visibility on link time.
At which pass should this be examined?
Regards
sorry for the crosspost with the python-plugin list, but i am running
out of clues.