Data-flow informations (CFG)

Ian Lance Taylor iant@google.com
Tue Oct 25 13:43:00 GMT 2011


Harry Trinta <harrytpc@gmail.com> writes:

>> The CFG doesn't have any declarations.  In effect all declarations are
>> moved to the outer-most block of a function, renamed as necessary.
>
> Truth. The CFC of GCC does not have the DECLARATIONS. =(
>
> I know that declarations is not in a block of the CFG in fact. But if
> we analyze the code, a declaration always is a "part" of a block too.
> So, there is no way to see in which block a declaration was made?

Assuming we are talking about C or C++, then if you look at GENERIC
immediately after parsing, you can find the declarations by looking for
DECL_EXPR statements.  However, at that point there is no CFG, and the
DECL_EXPR statements are dropped when moving to GIMPLE.  So, no, gcc
does not have any representation of the program which includes both a
CFG and records which block contains a declaration.  At least as far as
I know.

Ian



More information about the Gcc-help mailing list