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