This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Semantics of -fdump-ast?
On Fri, 31 Aug 2001, Nathan Sidwell wrote:
> > I'm probably misinterpreting what invoke.texi says about
> > -fdump-ast-<name>-<num>, but it looks as if the semantics for
> > <num> are global to all the possible dump names.
> Yes, primarily because it was the simplest thing to do.
>
But, in reality your implementation makes it easy to have
different bitmasks for different -fdump switches. It's the
documentation that suggests otherwise.
> > I would like to add various -fdump-ast names for the tree SSA
> > passes, but I need 'num' to have different meanings according to
> > the name used. In particular, bit0 and bit1 as they're currently
> > defined would be useless for the SSA or CFG dumps.
> >
> > Is that feasible? Thanks.
> It's possible, but IMHO confusing. How about allocating new bits for
> the functionality you want? How many flags are you anticipating? If
> there are many, I'd suggest implementing name->value mapping machinery
>
Not really. So far I've only added one bitmask.
> in the option parsing, so you can say,
> -fdump-ast-optimized=3
> -fdump-ast-optimized=slim,address
> -fdump-ast-optimized=all
> -fdump-ast-optimized=christmas-tree // joke
> and have the right thing happen.
>
Actually, it isn't my intention to change the existing -fdump-XXX
options. In the ast-optimizer-branch you'll see that I added
-----------------------------------------------------------------------------
`-fdump-tree-cfg'
Dump the control flow graph of each function to a file. The file
name is made by appending `.cfg' to the source file name.
`-fdump-tree-graphviz'
Dump a representation of the control flow graph, suitable for
viewing with GraphViz, to a file. The file name is made by
appending `.dot' to the source file name.
`-fdump-tree-ssa'
`-fdump-tree-ssa-NUMBER'
Dump SSA related information to a file. The file name is made by
appending `.ssa' to the source file name. If the `-NUMBER' form is
used, NUMBER is a bit mask which controls the details of the dump.
The following bits are meaningful:
`bit0 (1)'
Print the list of references made to each variable in the
program.
-----------------------------------------------------------------------------
The questions I have are:
- GCC has traditionally called this IL `tree', but now we also
have the name `ast'. I'm not quite sure which one to use.
I went with tradition, but we're starting to have some naming
inconsistencies (my switches are named fdump-tree instead of
fdump-ast).
I'm not arguing for one name or the other. Both are equally
meaningful to me. But we should probably use a single naming
scheme or just use the names interchangeably.
- The only dump switch that currently has a bitmask associated is
the SSA one. I didn't want to add a third bitmask to the
existing bitmasks because it would be meaningless for the
existing fdump-ast-XXX switches and vice-versa.
The documentation suggests that these bits are interpreted by
all the -fdump switches. This is not the case with fdump-tree.
The fdump machinery makes it easy to have different bitmasks
for different switches. It's the documentation that suggests
otherwise.
Thanks. Diego.