This is the mail archive of the gcc@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]

-fdump-translation-unit[-option]


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


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