How to get positional information of a variable declaration?

Sung-taek Lim stlim@dynalith.com
Fri Feb 23 06:03:00 GMT 2001




In expand_expr(), when I meet a VAR_DECL, I want to do some 
operation on it
if it was first declared in a given position. For 
example, I want to determine 
if the integer variable was declared in the second 
sub-block of the first basic 
block of function main(). I illustratd it as follows.
 
int main() 
{
        int 
a;
        {
        }
 
        {
              
int b;
              
{
                  
b;      // I want to do something on b
                  
a;      // not a
              
}
        }
}
 
Does anybody know easy way to implement the 
determination?
 
--- Sung-taek Lim



More information about the Gcc mailing list