Where to find global var declaration

Cristina Georgiana Opriceana cristina.opriceana@gmail.com
Wed Apr 27 09:34:00 GMT 2016


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!



More information about the Gcc mailing list