-fdump-translation-unit[-option]

J. Buchanan buchanan@iinet.net.au
Mon Mar 15 04:44:00 GMT 2004


The docs say that -fdump-translation-unit[-option] which is valid for 
C takes the optional -option from the C++-only 
-fdump-tree-switch-option options, and I chose -original.  But it 
doesn't seem to work.  I have a C source code file, test.c, that looks 
like this:

int main()
{
	char *foo = "Hello World";

	puts(foo);
	return 0;
}

I've left out #include <stdio.h> because I don't want a dump of all 
the header file stuff, nor any of the builtins stuff.  I just want the 
pre-optimised tree structures that are generated for this C file.  But 
all I can get is a massive -fdump-translation-unit effected .tu file 
which shows the contents of the translation unit with a whole load of 
stuff I don't want.

How can I get just the trees that were made for the particular source 
file?  I'd like to examine this because I want to write a front end 
and learn how the C front end compiles sources into trees.  I want 
really slim output, as above.

Thanks,
James



More information about the Gcc mailing list