This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Data-flow informations (CFG)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]