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

Re: [PATCH] PR libstdc++/13045


On Wed, Dec 03, 2003 at 11:00:20PM -0600, Benjamin Kosnik wrote:
> 
> >2003-12-03  Carlo Wood  <carlo@alinoe.com>
> >
> >	PR libstdc++/13045
> >	* bits/demangle.h
> >	namespace __gnu_cxx::demangler
> >	(enum substitution_nt): Removed trailing comma.
> >	(session<Allocator>::decode_real): Added.
> >	(session<Allocator>::decode_literal): Call decode_real for
> >	floating literals.
> >	(session<Allocator>::decode_type_with_postfix): Put the postfix
> >	of the return type of (member) functions after the function
> >	instead of after the return type.  Also, put a space after the
> >	prefix of qualified function pointers: "int (* const<space>".
> >	* src/demangle.cc: include most dependent header file first.
> >	* testsuite/demangle/regression/cw-16.cc: Updated one
> >	and added three tests.
> 
> This is fine, thanks. 

Err - I changed it a little bit - because the virtual decode_real
could not be overridden by users with the given interface.
Instead, I added a new class called 'demangler::implementation_details'
and did put the virtual decode_real into that class.  Then a reference
to this object is being passed around to the static
session<>::decode_encoding.  This was needed because a new encoding
session starts completely fresh (new instance) but does need to keep
the implementation details.
Now, while I was at it, I removed all the _GLIBCXX_DEMANGLER_STYLE_*
macros too and put an equivalent in the new implementation_details
class; this will allow user applications to have all possible formats
in one application at their disposal without any code duplication/bloat.
Hell, I might even add a foo<T> [with T = bar] style later.

The new ChangeLog is:


2003-12-04  Carlo Wood  <carlo@alinoe.com>

	PR libstdc++/13045
	* bits/demangle.h
	namespace __gnu_cxx::demangler
	(enum substitution_nt): Removed trailing comma.
	(implementation_details): Added.
	(session<Allocator>::M_implementation_details): Added.
	(session<Allocator>::session): Pass implementation_details.
	(session<Allocator>::decode_encoding): Same.
	(session<Allocator>::decode_real): Added.
	(_GLIBCXX_DEMANGLER_STYLE_VOID _GLIBCXX_DEMANGLER_STYLE_LITERAL
	_GLIBCXX_DEMANGLER_STYLE_LITERAL_INT
	_GLIBCXX_DEMANGLER_STYLE_COMPACT_EXPR_OPS
	_GLIBCXX_DEMANGLER_STYLE_SIZEOF_TYPENAME): Replaced with
	implementation_details equivalent.
	(session<Allocator>::decode_expression):
	Use M_implementation_details instead of macros.
	(session<Allocator>::decode_bare_function_type): Idem.
	(session<Allocator>::decode_literal):
	Idem, and call decode_real for floating literals.
	(session<Allocator>::decode_type_with_postfix): Put the postfix
	of the return type of (member) functions after the function
	instead of after the return type.  Also, put a space after the
	prefix of qualified function pointers: "int (* const<space>".
	* src/demangle.cc: include most dependent header file first.
	* testsuite/demangle/regression/cw-16.cc: Updated one
	and added three tests.

Tested to compile and run the demangler testsuite.

The functionality of this patch from the point of view
of the default libstdc++-v3 demangling behaviour, did not change.

Still ok to commit?

[New patch attached in case you want to look at it.]

-- 
Carlo Wood <carlo@alinoe.com>

Attachment: PR13045.diff
Description: Text document


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