Re: [Gasta-general] how to dump translation unit?
Status: Alpha
Brought to you by:
gthouvenin
From: Guillaume <gui...@po...> - 2002-01-22 02:55:16
|
On Mon, 21 Jan 2002, Mathew Yeates wrote: > Hi Hi Mathew, > I'm using gcc 2.95.3 and I don't see the option to do this. > Of all of the "dump" options, none of them produce a file > with the extension .ast. ??? Those options are available with 2.96 versions and higher (for 2.96 I think that there is only one option which -fdump-translation-unit and from 3.0 they added "-fdump-ast-original and others"). The current version release of gcc is 3.0.3 and options like "-fdump-ast-original" are available only for g++. Here is a sample from http://gcc.gnu.org/onlinedocs/gcc-3.0.3/gcc_3.html#SEC3 : ... -fdump-ast-switch (C++ only) -fdump-ast-switch-number (C++ only) Control the dumping at various stages of processing the abstract syntax tree to a file. The file name is generated by appending a switch specific suffix 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 (these are not set symbolically, as the primary function of these dumps is for debugging gcc itself): `bit0 (1)' Print the address of each node. Usually this is not meaningful as it changes according to the environment and source file. `bit1 (2)' Inhibit dumping of members of a scope or body of a function, unless they are reachable by some other path. The following tree dumps are possible: `original' Dump before any tree based optimization, to `file.original'. `optimized' Dump after all tree based optimization, to `file.optimized'. ... If you only use C files, unfortunatly it can be a problem. For example, I'm trying to compile real C programs for testing and there is always problems, especially with types of variables because C accepts more things than C++. Guillaume |