What tree flags tell me a variable is local?

Daniel Berlin dberlin@dberlin.org
Sat Jun 14 19:38:00 GMT 2003


I know you can do it with decl_function_context, but I'm trying to 
avoid using it, because it's too expensive in PTA due to call overhead 
(Any time a query is made, we need to figure out whether they are 
querying about a global or not, so we end up calling it millions of 
times).

Thus, i'm wondering if there is some combination of tree flags i can 
rely on to always be correct.

Currently, I check DECL_CONTEXT, and iff it's a FUNCTION_DECL, we say 
it's local, otherwise, we call decl_function_context and see if it 
returns NULL.


Is there a better way?

--Dan



More information about the Gcc mailing list