This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Plugin: global vs global static in c/c++ AST representation


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]