Some clarifications regarding GIMPLE and LTO
Hi there i'm looking for a way to emit (dump) complete global and local symbol table entries for any given (C) program. For now, it would be satisfactory if this was properly handled for single-source-file programs. But what i would like to do basically is to store the entire information that would be needed in order to interpret a GIMPLE dump. A HLL (high-level language) program would probably map into something like this by any compiler: record Program is record GlobalSymbolTable is // global symbol entries end record; list FunctionList is // a linked list of Function records as defined below end list; end record; record Function is record LocalSymbolTable is // local symbol entries end record; record StatementList is // list of low-GIMPLE-level statements end record; end record; What I can see now is that GlobalSymbolTable is not dumped at all and LocalSymbolTable entries are not dumped to full extent (e.g. no initializations). For example, struct cgraph_varpool_node does not carry all the required information, for global variables and maybe it wasn't designed for that either. Does the LTO branch try to achieve that the complete information for a Program can be sufficiently stored (in a file)? If this is already there, could anyone provide some pointers to the API? Thank you in advance. Kind regards Nikolaos Kavvadias
Re: Some clarifications regarding GIMPLE and LTO
[EMAIL PROTECTED] wrote: Does the LTO branch try to achieve that the complete information for a Program can be sufficiently stored (in a file)? If this is already there, could anyone provide some pointers to the API? Yes, on the LTO branch, we are working to store the entire translation unit in a form that can then be read back into the compiler. The global symbol table is stored using DWARF3, so you can read it back with a standard DWARF reader. See lto/lto.c on the LTO branch for the code that does this. At present, there are a few things that are not yet written out to the DWARF information (like GCC machine modes), but most things (types, functions, variables) are present. -- Mark Mitchell CodeSourcery [EMAIL PROTECTED] (650) 331-3385 x713