This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] C++. streaming, front-end specific tree nodes, IR types, and assembler names
- From: "Bill Maddox" <maddox at google dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: "Diego Novillo" <dnovillo at google dot com>
- Date: Fri, 1 Aug 2008 00:33:43 -0700
- Subject: [lto] C++. streaming, front-end specific tree nodes, IR types, and assembler names
I am continuing to make progress with the LTO streamer on C++ code,
and finding a considerable amount of front-end specific crud hanging
off of the GIMPLE, particularly related to templates. This is not
surprising given the current strategy for generating debug information
(late, in the back-end). The LTO IR must be language-independent,
hower, and the current short-term plan of record, as I understand it,
is to strip out left-over front-end specific parts of the tree in
tree.c:free_lang_specifics, accepting that this will break debug info
generation until a satisfactory alternative is devised.
Finding that DECL_CONTEXT might include portions of what looked like
template definitions, and surmising that lexical nesting was a
language artifact that should no longer be of significance beyond the
front-end, I attempted to clear DECL_CONTEXT in free_lang_specifics.
This resulted in an assertion failure in
cp/mangle.c:write_unscoped_name. It appears that the name mangling
code, as one would expect, is very interested in such nesting, and
examines DECL_CONTEXT in multiple locations. None of this would be of
any consequence if the name mangling were complete upon entry to the
middle-end, but it can in fact be invoked via a langhook from
DECL_ASSEMBLER_NAME. Setting the assembler name is performed lazily
in the back-end, requiring nesting relationships reflected in
DECL_CONTEXT to be preserved to this point.
My assertion is that the langhook must go, and that mangled names
should be generated before invoking the middle-end. Given the baroque
treatment of the assembler name, however, I don't think it will be
sufficient simply to make a pass over the declarations in
free_lang_specifics setting the assembler name.
Any advice from someone who deeply understands this stuff?
--Bill