Hello, Thanks for the feedback on the previous patch set.
This is the second posting of the RFC patch for CTF support in GCC. This patch set does not rely on debug hooks, but it keeps CTF and DWARF debug info generation separated in the compiler. For CTF generation, callsites in symbol_table::finalize_compilation_unit and rest_of_decl_compilation are used. For CTF emission, callsite in symbol_table::finalize_compilation_unit is used. Summary of the GCC RFC V2 patch set : Patch 1 and Patch 2 have remain unchanged since V1. Patch 1 is a simple addition of a new function lang_GNU_GIMPLE to check for GIMPLE frontend. Patch 2 and Patch 3 set up the framework for CTF support in GCC : -- Patch 2 adds the new command line option for generating CTF. CTF generation is enabled in the compiler by specifying an explicit -gt or -gtLEVEL[LEVEL=1,2] : -gtLEVEL This is used to request CTF debug information and to specify how much CTF debug information, LEVEL[=0,1,2] can be specified. If -gt is specified (with no LEVEL), the default value of LEVEL is 2. -gt0 (Level 0) produces no CTF debug information at all. Thus, -gt0 negates -gt. -gt1 (Level 1) produces CTF information for tracebacks only. This includes CTF callsite information, but does not include type information for other entities. -gt2 (Level 2) produces type information for entities (functions, variables etc.) at file-scope or global-scope only. This level of information can be used by dynamic tracers like DTrace. -- Patch 3 initializes the CTF container if user-level option for CTF generation is specified. CTF is generated for all to-be-emitted global decls if gtLEVEL of 2 is specified. Tested on x86_64-linux and sparc64-linux. Thanks Indu Bhagat (3): Add new function lang_GNU_GIMPLE Add CTF command line options : -gtLEVEL Setup for CTF generation and emission gcc/ChangeLog | 27 ++ gcc/Makefile.in | 3 + gcc/cgraphunit.c | 12 +- gcc/common.opt | 9 + gcc/ctfout.c | 163 ++++++++ gcc/ctfout.h | 52 +++ gcc/doc/invoke.texi | 16 + gcc/flag-types.h | 13 + gcc/gengtype.c | 4 +- gcc/langhooks.c | 9 + gcc/langhooks.h | 1 + gcc/opts.c | 26 ++ gcc/passes.c | 7 +- gcc/testsuite/ChangeLog | 7 + gcc/testsuite/gcc.dg/debug/ctf/ctf-1.c | 6 + gcc/testsuite/gcc.dg/debug/ctf/ctf-preamble-1.c | 11 + gcc/testsuite/gcc.dg/debug/ctf/ctf.exp | 41 ++ gcc/testsuite/gcc.dg/debug/dwarf2-ctf-1.c | 7 + gcc/toplev.c | 18 + include/ChangeLog | 4 + include/ctf.h | 483 ++++++++++++++++++++++++ 21 files changed, 913 insertions(+), 6 deletions(-) create mode 100644 gcc/ctfout.c create mode 100644 gcc/ctfout.h create mode 100644 gcc/testsuite/gcc.dg/debug/ctf/ctf-1.c create mode 100644 gcc/testsuite/gcc.dg/debug/ctf/ctf-preamble-1.c create mode 100644 gcc/testsuite/gcc.dg/debug/ctf/ctf.exp create mode 100644 gcc/testsuite/gcc.dg/debug/dwarf2-ctf-1.c create mode 100644 include/ctf.h -- 1.8.3.1