This is the mail archive of the
mailing list for the GCC project.
bad definition of IDENTIFIER_GLOBAL_VALUE
- To: egcs at cygnus dot com
- Subject: bad definition of IDENTIFIER_GLOBAL_VALUE
- From: Per Bothner <bothner at cygnus dot com>
- Date: Fri, 27 Mar 1998 16:28:47 -0800
- Cc: Martin von Loewis <loewis at informatik dot hu-berlin dot de>
The macros IDENTIFIER_GLOBAL_VALUE and IDENTIFIER_NAMESPACE_VALUE
call binding_for_name, which creates a new binding, if there is none.
This is inefficient, since it creates new CPLUS_BINDINGs
unnecessarily. Most uses of IDENTIFIER_GLOBAL_VALUE are in
an rvalue context, where creating a new binding is useless.
Worse, print_lang_identifier invokes IDENTIFIER_GLOBAL_VALUE.
This means that calling debug_tree from the debugger may
invoke make_node. This means that debugging cc1plus is no
longer determinate, but the address of nodes depends on
whatever previous nodes have been printed using debug_tree.
That is why it is totally unacceptable for debug_tree to
allocate any memory. (The only exception is buffers allocated
by printf, which we cannot control, but at least normally
only happens once.)
Cygnus Solutions email@example.com http://www.cygnus.com/~bothner