This is the mail archive of the gcc@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]

Where to find global var declaration


Hello,

I tried to add a new global declaration of a pointer and I expected to
see it in varpool nodes, but it does not appear there.

ustackptr = build_decl (UNKNOWN_LOCATION,
                             VAR_DECL, get_identifier ("ustackptr"),
                             build_pointer_type(void_type_node));
TREE_ADDRESSABLE (ustackptr) = 1;
TREE_USED (ustackptr) = 1;
rest_of_decl_compilation (ustackptr, 1, 0);

and

struct varpool_node *node;
FOR_EACH_VARIABLE (node) {
        fprintf(stdout, "%s\n", get_name(node->decl));
}

Thanks!


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