merge from gcc

This commit is contained in:
DJ Delorie 2004-01-02 21:11:34 +00:00
parent 0bc2134ec9
commit 820542c970
6 changed files with 2665 additions and 1132 deletions

View File

@ -1,3 +1,597 @@
2003-12-19 Andreas Tobler <a.tobler@schweiz.ch>
* include/fibheap.h (fibnode): Use __extension__ for
bit-fields mark and degree if __GNUC__.
2003-12-18 Kazu Hirata <kazu@cs.umass.edu>
* include/fibheap.h (fibnode): Use unsigned long int for
bit-fields if __GNUC__ is defined.
2003-10-22 Joseph S. Myers <jsm@polyomino.org.uk>
* obstack.h: Merge the following change from gnulib:
2003-10-21 Paul Eggert <eggert@twinsun.com>
* obstack.h (obstack_1grow_fast): Properly parenthesize arg.
(obstack_ptr_grow_fast, obstack_int_grow_fast):
Don't use lvalue casts, as GCC plans to remove support for them
in GCC 3.5. Reported by Joseph S. Myers. This bug
was also present in the non-GCC version, indicating that this
code had always been buggy and had never been widely used.
(obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
Use the fast variant of each macro, rather than copying the
definiens of the fast variant; that way, we'll be more likely to
catch future bugs in the fast variants.
2003-09-22 Andrew Cagney <cagney@redhat.com>
* floatformat.h (struct floatformat): Add field "is_valid".
2003-09-15 Andrew Cagney <cagney@redhat.com>
* floatformat.h (floatformat_to_double): Make input buffer constant.
(floatformat_from_double, floatformat_is_valid): Ditto.
2003-09-15 Andrew Cagney <cagney@redhat.com>
* floatformat.h (struct floatformat): Make "exp_bias" signed.
2003-09-15 Daniel Jacobowitz <drow@mvista.com>
* floatformat.h (floatformat_is_valid): Add prototype.
2003-07-09 Bob Wilson <bob.wilson@acm.org>
* xtensa-config.h: Undef all macros before defining them.
2003-07-06 H.J. Lu <hongjiu.lu@intel.com>
* demangle.h: Support C++.
2003-07-01 Zack Weinberg <zack@codesourcery.com>
* filenames.h: New file imported from binutils.
2003-06-30 Bob Wilson <bob.wilson@acm.org>
* xtensa-config.h: New file imported from binutils.
2003-06-22 Zack Weinberg <zack@codesourcery.com>
* safe-ctype.h (HC_UNKNOWN, HC_ASCII, HC_EBCDIC): Rename to
HOST_CHARSET_UNKNOWN, HOST_CHARSET_ASCII, HOST_CHARSET_EBCDIC
respectively.
2003-06-21 Zack Weinberg <zack@codesourcery.com>
* safe-ctype.h (HC_UNKNOWN, HC_ASCII, HC_EBCDIC, HOST_CHARSET):
New #defines.
2003-06-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ansidecl.h: Delete HAVE_LONG_DOUBLE GCC bootstrap support.
2003-05-15 Jim Blandy <jimb@redhat.com>
* libiberty.h (hex_value): Make the value an unsigned int, to
avoid unexpected sign-extension when cast to unsigned types larger
than int --- like bfd_vma, on some platforms.
(_hex_value): Update declaration.
2003-05-07 Jason Merrill <jason@redhat.com>
* hashtab.h (iterative_hash): Prototype.
(iterative_hash_object): New macro.
2003-03-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ansidecl.h (ATTRIBUTE_NONNULL, ATTRIBUTE_NULL_PRINTF,
ATTRIBUTE_NULL_PRINTF_1, ATTRIBUTE_NULL_PRINTF_2,
ATTRIBUTE_NULL_PRINTF_3, ATTRIBUTE_NULL_PRINTF_4,
ATTRIBUTE_NULL_PRINTF_5): New.
(ATTRIBUTE_PRINTF): Add ATTRIBUTE_NONNULL.
2003-03-17 Jan Hubicka <jh@suse.cz>
* hashtab.h (htab_traverse_noresize): Declare.
2003-02-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* libiberty.h: Document return value of physmem routines.
2003-02-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* libiberty.h (physmem_total, physmem_available): Prototype.
2003-02-20 Daniel Jacobowitz <drow@mvista.com>
* libiberty.h (lrealpath): Add declaration.
2003-01-26 Daniel Jacobowitz <drow@mvista.com>
* hashtab.h (htab_alloc_with_arg, htab_free_with_arg): Add new types.
(struct htab): Add alloc_arg, alloc_with_arg_f, free_with_arg_f.
(htab_create_alloc_ex): New prototype.
(htab_set_functions_ex): New prototype.
2002-07-17 Geoffrey Keating <geoffk@redhat.com>
* splay-tree.h (GTY): Define if undefined.
(splay_tree_allocate_fn): Return PTR for compatibility, not void *.
(struct splay_tree_node_s): Support gengtype.
(struct splay_tree_s): Likewise. Make allocate_data a PTR,
not a void *.
2002-11-23 Simon Burge <simonb@wasabisystems.com>
* libiberty.h (basename): Add NetBSD to the list.
2002-11-22 Daniel Jacobowitz <drow@mvista.com>
* libiberty.h (make_relative_prefix): Add prototype.
2002-10-26 Roger Sayle <roger@eyesopen.com>
* partition.h: Close the extern "C" scope when compiling with C++.
2002-10-26 Roger Sayle <roger@eyesopen.com>
DJ Delorie <dj@redhat.com>
PR bootstrap/8351
* getopt.h: Avoid prototyping getopt with no arguments in C++.
2002-10-24 Nathan Tallent <eraxxon@alumni.rice.edu>
* ansidecl.h (__STDC__): Add (__alpha && __cplusplus) to the
list of platform compilers that may look, smell and act
like __STDC__ but that may not define it.
2002-10-11 David O'Brien <obrien@FreeBSD.org>
* getopt.h: getopt is in unistd.h (based on SUSv2).
2002-09-19 Alexandre Oliva <aoliva@redhat.com>
* libiberty.h (asprintf, vasprintf): Don't declare them if the
corresponding HAVE_DECL_ macro is 1.
2002-06-25 Alan Modra <amodra@bigpond.net.au>
* demangle.h: #include "ansidecl.h" rather than #include <ansidecl.h>.
* fibheap.h: Likewise.
* hashtab.h: Likewise.
* partition.h: Likewise.
* sort.h: Likewise.
* splay-tree.h: Likewise.
2002-06-24 Alan Modra <amodra@bigpond.net.au>
* libiberty.h (basename): Don't declare if HAVE_DECL_BASENAME.
* getopt.h (getopt): Don't declare if HAVE_DECL_GETOPT.
2002-06-06 DJ Delorie <dj@redhat.com>
* hashtab.h (htab): Rearrange new members for backward
compatibility.
(htab_create): Don't use a macro that requires other headers.
2002-06-05 Geoffrey Keating <geoffk@redhat.com>
* hashtab.h (htab_create): Restore prototype for backward
compatibility.
(htab_try_create): Likewise.
2002-05-22 Geoffrey Keating <geoffk@redhat.com>
* hashtab.h (struct htab): Update for change to length specifier.
2002-05-10 Geoffrey Keating <geoffk@redhat.com>
* hashtab.h (GTY): Define if undefined.
(htab_alloc): New typedef.
(htab_free): New typedef.
(struct htab): Support gengtype; allow user-specified memory
allocation.
(htab_create_alloc): New.
(htab_create): Replace with #define.
(htab_try_create): Delete.
2002-04-16 David S. Miller <davem@redhat.com>
* xregex2.h (__restrict_arr): Define to __restrict on GCC
3.1 and later. Do not redefine.
2002-04-01 Phil Edwards <pme@gcc.gnu.org>
* dyn-string.h: Also allow IN_GLIBCPP_V3 to redefine names.
2002-03-06 Andrew Cagney <ac131313@redhat.com>
* floatformat.h (floatformat_arm_ext): Delete declaration.
2002-02-22 Jim Blandy <jimb@redhat.com>
Allow the user to specify functions for allocating memory for
splay tree roots and nodes.
* splay-tree.h (splay_tree_allocate_fn, splay_tree_deallocate_fn):
New types.
(splay_tree): New fields: `allocate', `deallocate', and
`allocate_data'.
(splay_tree_new_with_allocator): New function declaration.
2002-02-05 Jason Merrill <jason@redhat.com>
* demangle.h (cplus_demangle_v3): Add "options" parm.
(cplus_demangle_v3_type): Remove prototype.
(DMGL_VERBOSE): New macro.
(DMGL_TYPES): New macro.
2002-02-02 H.J. Lu (hjl@gnu.org)
* demangle.h (cplus_demangle_v3_type): New prototype.
2002-01-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* libiberty.h (C_alloca): Add ATTRIBUTE_MALLOC.
2001-12-06 Richard Henderson <rth@redhat.com>
* demangle.h (no_demangling): New.
(NO_DEMANGLING_STYLE_STRING): New.
2001-10-24 Neil Booth <neil@daikokuya.demon.co.uk>
* safe-ctype.h (_sch_isbasic, IS_ISOBASIC): New.
2001-10-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* libiberty.h (hex_init): Revert delete.
* libiberty.h (_hex_value): Const-ify.
(hex_init): Delete.
2001-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* demangle.h (demangler_engine): Const-ify.
* libiberty.h (buildargv): Likewise.
2001-09-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* libiberty.h (reconcat): New function.
2001-09-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* libiberty.h (concat, concat_length, concat_copy, concat_copy2,
ACONCAT): Improve comments.
2001-09-18 Alan Modra <amodra@bigpond.net.au>
* objalloc.h (OBJALLOC_ALIGN): Define using offsetof.
2001-09-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* libiberty.h (concat_length, concat_copy, concat_copy2,
libiberty_concat_ptr, ACONCAT): New.
* libiberty.h (ASTRDUP): New macro.
libiberty_optr, libiberty_nptr, libiberty_len): Declare.
2001-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ansidecl.h: Update comments reflecting previous change.
2001-08-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ansidecl.h (VA_OPEN, VA_CLOSE): Allow multiple uses.
2001-08-23 Lars Brinkhoff <lars@nocrew.org>
* dyn-string.h, fibheap.h, partition.h, sort.h, splay-tree.h:
replace "GNU CC" with "GCC".
2001-08-21 Richard Henderson <rth@redhat.com>
* fibheap.h: Tidy formatting.
(fibnode_t): Limit degree to 31 bits to avoid warning.
2001-08-20 Andrew Cagney <ac131313@redhat.com>
* floatformat.h (floatformat_arm_ext): Document as deprecated.
(floatformat_arm_ext_big, floatformat_arm_ext_littlebyte_bigword)
(floatformat_ia64_spill_little, floatformat_ia64_quad_little)
(floatformat_ia64_spill_big, floatformat_ia64_quad_big)
(floatformat_m88110_harris_ext): Declare.
2001-08-20 Daniel Berlin <dan@cgsoftware.com>
* fibheap.h: New file. Fibonacci heap.
2001-08-18 Zack Weinberg <zackw@panix.com>
* ansidecl.h: Reorganize for readability, remove documentation
of obsolete macros, document PARAMS and VPARAMS. Add new
macros VA_OPEN, VA_CLOSE, and VA_FIXEDARG for nicer variadic
function implementation.
2001-08-16 Richard Henderson <rth@redhat.com>
* hashtab.h (htab_hash_string): Declare.
2001-08-10 Andrew Cagney <ac131313@redhat.com>
* libiberty.h (lbasename): Change function declaration to return a
const char pointer.
2001-08-02 Mark Kettenis <kettenis@gnu.org>
* xregex.h (_REGEX_RE_COMP): Define.
(re_comp): Define to xre_comp.
(re_exec): Define to xre_exec.
2001-07-18 Andreas Jaeger <aj@suse.de>
* xregex2.h: Place under LGPL version 2.1.
2001-07-10 Jeff Johnston <jjohnstn@redhat.com>
* xregex.h: New file to support libiberty regex.
* xregex2.h: Ditto.
2001-05-16 Matt Kraai <kraai@alumni.carnegiemellon.edu>
* partition.h: Fix misspelling of `implementation'.
2001-05-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ansidecl.h (NULL_PTR): Delete.
2001-05-07 Zack Weinberg <zackw@stanford.edu>
* demangle.h: Use PARAMS for all prototypes.
* ternary.h: Use PARAMS for all prototypes. Use PTR, not void *.
Make arguments constant where possible.
2001-05-07 Mark Mitchell <mark@codesourcery.com>
* splay-tree.h (splay_tree_max): New function.
(splay_tree_min): Likewise.
2001-04-15 Daniel Berlin <dan@cgsoftware.com>
* ternary.h: New file - Ternary search tree header.
2001-04-03 Zack Weinberg <zackw@stanford.edu>
* ansidecl.h: All logic from gcc/gansidecl.h moved here.
2001-03-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* libiberty.h (alloca): Handle setting C_ALLOCA.
2001-03-20 Jim Blandy <jimb@redhat.com>
* demangle.h (enum gnu_v3_constructor_kinds,
is_gnu_v3_mangled_ctor, enum gnu_v3_destructor_kinds,
is_gnu_v3_mangled_dtor): New declarations.
2001-03-14 Nick Clifton <nickc@redhat.com>
* ansidecl.h: Fix copyright dates.
* demangle.h: Fix copyright dates.
* floatformat.h: Fix copyright dates.
* fnmatch.h: Fix copyright dates.
* getopt.h: Fix copyright dates.
* libiberty.h: Add FSF copyright notice.
* md5.h: Fix copyright dates.
* obstack.h: Fix copyright dates.
* splay-tree.h: Fix copyright dates.
2001-03-10 Neil Booth <neil@daikokuya.demon.co.uk>
John David Anglin <dave@hiauly1.hia.nrc.ca>
* libiberty.h: Add lbasename.
2001-03-06 Zack Weinberg <zackw@stanford.edu>
* libiberty.h: Prototype C_alloca; define alloca to either
__builtin_alloca or C_alloca as appropriate.
2001-03-01 John David Anglin <dave@hiauly1.hia.nrc.ca>
* safe-ctype.h (_sch_test): Cast enum bit to unsigned short int for pcc
compatibility.
2000-12-18 Joseph S. Myers <jsm28@cam.ac.uk>
* COPYING: Update to current
ftp://ftp.gnu.org/pub/gnu/Licenses/COPYING-2.0 (fixes references
to 19yy as example year in copyright notice).
2000-12-16 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
* safe-ctype.h: Make code work on all targets and not just on
targets where a char is 8 bits.
2000-12-07 Zack Weinberg <zack@wolery.stanford.edu>
* safe-ctype.h: New file.
2000-12-06 Rodney Brown <RodneyBrown@mynd.com>
* getopt.h obstack.h: Standarize copyright statement.
2000-12-04 Richard Henderson <rth@redhat.com>
* demangle.h: Change "new_abi" to "v3" everywhere.
2000-11-22 Zack Weinberg <zack@wolery.stanford.edu>
* libiberty.h: Move #includes to top. Prototype xmalloc_failed.
2000-11-15 Kenneth Block <kenneth.block@compaq.com>
* demangle.h: Add gnat and java demangle styles.
2000-11-04 Hans-Peter Nilsson <hp@bitrange.com>
* hashtab.h (struct htab): Add member return_allocation_failure.
(htab_try_create): New prototype. Mention which functions may
return NULL when this is used.
2000-11-03 Hans-Peter Nilsson <hp@bitrange.com>
* hashtab.h: Change void * to PTR where necessary.
2000-09-10 Mark Mitchell <mark@codesourcery.com>
* splay-tree.h (splay_tree_predecessor): Declare.
2000-09-05 John David Anglin <dave@hiauly1.hia.nrc.ca>
* md5.h (md5_uint32): Choose via INT_MAX instead of UINT_MAX.
2000-09-04 Alex Samuel <samuel@codesourcery.com>
* dyn-string.h: Adjust formatting.
(dyn_string_insert_char): New macro. New declaration.
2000-08-28 Jason Merrill <jason@redhat.com>
* md5.h: New file.
2000-08-24 Greg McGary <greg@mcgary.org>
* libiberty.h (ARRAY_SIZE): New macro.
2000-06-21 Alex Samuel <samuel@codesourcery.com>
* dyn-string.h (dyn_string_init, dyn_string_new,
dyn_string_delete, dyn_string_release, dyn_string_resize,
dyn_string_clear, dyn_string_copy, dyn_string_copy_cstr,
dyn_string_prepend, dyn_string_prepend_cstr, dyn_string_insert,
dyn_string_insert_cstr, dyn_string_append, dyn_string_append_cstr,
dyn_string_append_char, dyn_string_substring_dyn_string_eq):
Define as same name with __cxa_ prepended, if IN_LIBGCC2.
(dyn_string_init, dyn_string_copy, dyn_string_copy_cstr,
dyn_string_prepend, dyn_string_prepend_cstr, dyn_string_insert,
dyn_string_insert_cstr, dyn_string_append, dyn_string_append_cstr,
dyn_string_append_char, dyn_string_substring): Change return type
to int.
2000-06-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* demangle.h (demangling_styles): Remove trailing comma in enum.
* dyn-string.h (dyn_string_append_char): Change parameter from
char to int.
2000-06-04 Alex Samuel <samuel@codesourcery.com>
* dyn-string.h: Move here from gcc/dyn-string.h. Add new functions.
* demangle.h (DMGL_GNU_NEW_ABI): New macro.
(DMGL_STYLE_MASK): Or in DMGL_GNU_NEW_ABI.
(current_demangling_style): Add gnu_new_abi_demangling.
(GNU_NEW_ABI_DEMANGLING_STYLE_STRING): New macro.
(GNU_NEW_ABI_DEMANGLING): Likewise.
(cplus_demangle_new_abi): New declaration.
Tue May 30 16:53:34 2000 Andrew Cagney <cagney@b1.cygnus.com>
* floatformat.h (struct floatformat): Add field name.
2000-05-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* getopt.h (getopt): Also check HAVE_DECL_* when prototyping.
* libiberty.h (basename): Likewise.
2000-05-06 Zack Weinberg <zack@wolery.cumb.org>
* ansidecl.h: #define __extension__ to nothing if
GCC_VERSION < 2008.
2000-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* demangle.h (demangler_engine): Constify.
Thu May 4 17:15:26 2000 Philippe De Muyter <phdm@macqel.be>
* sort.h (sys/types.h): File included unconditionnaly.
(stddef.h): File include only #ifdef __STDC__.
2000-05-03 Zack Weinberg <zack@wolery.cumb.org>
* symcat.h: Remove #endif label.
2000-04-28 Kenneth Block <block@zk3.dec.com>
Jason Merrill <jason@casey.cygnus.com>
* demangle.h (libiberty_demanglers): new table for different styles.
(cplus_demangle_set_style): New function for setting style.
(cplus_demangle_name_to_style): New function to translate name.
2000-04-24 Mark Mitchell <mark@codesourcery.com>
* hashtab.h (hash_pointer): Declare.
(eq_pointer): Likewise.
2000-04-23 Mark Mitchell <mark@codesourcery.com>
* sort.h: New file.
Tue Apr 18 16:22:30 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* hashtab.h (enum insert_option): New type.
(htab_find_slot, htab_find_slot_with_hash): Use it.
2000-04-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* symcat.h: Honor autoconf macro HAVE_STRINGIZE. Add
comments/caveats with regard to traditional C behavior.
2000-04-05 Richard Henderson <rth@cygnus.com>
* splay-tree.h (splay_tree_remove): Declare.
2000-03-30 Mark Mitchell <mark@codesourcery.com>
* hashtab.h (hashval_t): New type.
(htab_find_with_hash): Use it as an argument.
(htab_find_slot_with_hash): Likewise.
2000-03-14 Bernd Schmidt <bernds@cygnus.co.uk>
* hashtab.h (htab_trav): Modify type so that first arg is of type
void **.
(htab_find_with_hash, htab_find_slot_with_hash): Declare new
functions.
2000-03-09 Alex Samuel <samuel@codesourcery.com>
* partition.h: New file.
2000-03-09 Zack Weinberg <zack@wolery.cumb.org>
* hashtab.h (struct htab): Add del_f.
(htab_del): New type.
(htab_create): Add fourth argument.
2000-03-08 Zack Weinberg <zack@wolery.cumb.org>
* hashtab.h (hash_table_t): Rename to htab_t.
(struct hash_table): Rename to struct htab. Shorten element
names. Reorder elements by size.
(htab_hash, htab_eq, htab_trav): New typedefs for the callback
function pointers.
(hash_table_entry_t): Discard; just use void * for element
type.
Sat Jan 1 19:06:52 2000 Hans-Peter Nilsson <hp@bitrange.com>
* symcat.h (STRINGX) [!__STDC__ || ALMOST_STDC]: Change "?" to "s"
to stringify argument s.
For older changes see ChangeLog-9103

View File

@ -1,3 +1,16 @@
2004-01-02 Ian Lance Taylor <ian@wasabisystems.com>
* cp-demangle.c (d_encoding): When DMGL_PARAMS is not set, strip
CV-qualifiers from D_COMP_LOCAL_NAME right subtree.
* cplus-dem.c (demangle_arm_hp_template): Set DMGL_PARAMS when
demangling template parameters.
* testsuite/test-demangle.c (fail): New static function.
(main): Support new options in input file: --no-params,
--is-v3-ctor, and --is-v3-dtor.
* testsuite/demangle-expected: Add --no-params to most tests, and
add the correct result when parameters are not demangled. Add
some simple tests for V3 constructor/destructor recognition.
2003-12-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cp-demangle.c (is_ctor_or_dtor): Fix error in last change.

View File

@ -1,5 +1,5 @@
/* Demangler for g++ V3 ABI.
Copyright (C) 2003 Free Software Foundation, Inc.
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@wasabisystems.com>.
This file is part of the libiberty library, which is part of GCC.
@ -1109,6 +1109,23 @@ d_encoding (di, top_level)
|| dc->type == D_COMP_VOLATILE_THIS
|| dc->type == D_COMP_CONST_THIS)
dc = d_left (dc);
/* If the top level is a D_COMP_LOCAL_NAME, then there may
be CV-qualifiers on its right argument which really apply
here; this happens when parsing a class which is local to
a function. */
if (dc->type == D_COMP_LOCAL_NAME)
{
struct d_comp *dcr;
dcr = d_right (dc);
while (dcr->type == D_COMP_RESTRICT_THIS
|| dcr->type == D_COMP_VOLATILE_THIS
|| dcr->type == D_COMP_CONST_THIS)
dcr = d_left (dcr);
dc->u.s_binary.right = dcr;
}
return dc;
}

View File

@ -1,6 +1,6 @@
/* Demangler for GNU C++
Copyright 1989, 1991, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001 Free Software Foundation, Inc.
2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.uucp)
Rewritten by Fred Fish (fnf@cygnus.com) for ARM and Lucid demangling
Modified by Satish Pai (pai@apollo.hp.com) for HP demangling
@ -2318,6 +2318,7 @@ demangle_arm_hp_template (work, mangled, n, declp)
if (HP_DEMANGLING && ((*mangled)[n] == 'X'))
{
char *start_spec_args = NULL;
int hold_options;
/* First check for and omit template specialization pseudo-arguments,
such as in "Spec<#1,#1.*>" */
@ -2330,6 +2331,12 @@ demangle_arm_hp_template (work, mangled, n, declp)
string_init (&arg);
if (work->temp_start == -1) /* non-recursive call */
work->temp_start = declp->p - declp->b;
/* We want to unconditionally demangle parameter types in
template parameters. */
hold_options = work->options;
work->options |= DMGL_PARAMS;
string_append (declp, "<");
while (1)
{
@ -2376,17 +2383,25 @@ demangle_arm_hp_template (work, mangled, n, declp)
string_delete (&arg);
if (**mangled == '_')
(*mangled)++;
work->options = hold_options;
return;
}
/* ARM template? (Also handles HP cfront extensions) */
else if (arm_pt (work, *mangled, n, &p, &args))
{
int hold_options;
string type_str;
string_init (&arg);
string_appendn (declp, *mangled, p - *mangled);
if (work->temp_start == -1) /* non-recursive call */
work->temp_start = declp->p - declp->b;
/* We want to unconditionally demangle parameter types in
template parameters. */
hold_options = work->options;
work->options |= DMGL_PARAMS;
string_append (declp, "<");
/* should do error checking here */
while (args < e) {
@ -2430,7 +2445,10 @@ demangle_arm_hp_template (work, mangled, n, declp)
/* Fail if we didn't make any progress: prevent infinite loop. */
if (args == old_args)
return;
{
work->options = hold_options;
return;
}
}
}
string_appends (declp, &arg);
@ -2441,6 +2459,7 @@ demangle_arm_hp_template (work, mangled, n, declp)
if (args >= e)
--declp->p; /* remove extra comma */
string_append (declp, ">");
work->options = hold_options;
}
else if (n>10 && strncmp (*mangled, "_GLOBAL_", 8) == 0
&& (*mangled)[9] == 'N'

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* Demangler test program,
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Written by Zack Weinberg <zack@codesourcery.com
This file is part of GNU libiberty.
@ -80,16 +80,39 @@ getline(buf)
buf->alloced = alloc;
}
/* The tester operates on a data file consisting of triples of lines:
format switch
static void
fail (lineno, opts, in, out, exp)
int lineno;
const char *opts;
const char *in;
const char *out;
const char *exp;
{
printf ("\
FAIL at line %d, options %s:\n\
in: %s\n\
out: %s\n\
exp: %s\n",
lineno, opts, in, out != NULL ? out : "(null)", exp);
}
/* The tester operates on a data file consisting of groups of lines:
options
input to be demangled
expected output
The format switch is expected to be either the empty string, a
line of the form --format=<name>, or just <name> by itself. */
Supported options:
--format=<name> Sets the demangling style.
--no-params There are two lines of expected output; the first
is with DMGL_PARAMS, the second is without it.
--is-v3-ctor Calls is_gnu_v3_mangled_ctor on input; expected
output is an integer representing ctor_kind.
--is-v3-dtor Likewise, but for dtors.
#define FORMATS "--format="
#define FORMATL (sizeof FORMATS - 1)
For compatibility, just in case it matters, the options line may be
empty, to mean --format=auto. If it doesn't start with --, then it
may contain only a format name.
*/
int
main(argc, argv)
@ -97,10 +120,12 @@ main(argc, argv)
char **argv;
{
enum demangling_styles style;
int no_params;
int is_v3_ctor;
int is_v3_dtor;
struct line format;
struct line input;
struct line expect;
char *fstyle;
char *result;
int failures = 0;
int tests = 0;
@ -126,20 +151,98 @@ main(argc, argv)
tests++;
fstyle = format.data;
if (!strncmp (fstyle, FORMATS, FORMATL))
fstyle += FORMATL;
if (fstyle[0] == '\0')
no_params = 0;
is_v3_ctor = 0;
is_v3_dtor = 0;
if (format.data[0] == '\0')
style = auto_demangling;
else
style = cplus_demangle_name_to_style (fstyle);
if (style == unknown_demangling)
else if (format.data[0] != '-')
{
printf ("FAIL at line %d: unknown demangling style %s\n",
lineno, fstyle);
failures++;
style = cplus_demangle_name_to_style (format.data);
if (style == unknown_demangling)
{
printf ("FAIL at line %d: unknown demangling style %s\n",
lineno, format.data);
failures++;
continue;
}
}
else
{
char *p;
char *opt;
p = format.data;
while (*p != '\0')
{
char c;
opt = p;
p += strcspn (p, " \t=");
c = *p;
*p = '\0';
if (strcmp (opt, "--format") == 0 && c == '=')
{
char *fstyle;
*p = c;
++p;
fstyle = p;
p += strcspn (p, " \t");
c = *p;
*p = '\0';
style = cplus_demangle_name_to_style (fstyle);
if (style == unknown_demangling)
{
printf ("FAIL at line %d: unknown demangling style %s\n",
lineno, fstyle);
failures++;
continue;
}
}
else if (strcmp (opt, "--no-params") == 0)
no_params = 1;
else if (strcmp (opt, "--is-v3-ctor") == 0)
is_v3_ctor = 1;
else if (strcmp (opt, "--is-v3-dtor") == 0)
is_v3_dtor = 1;
else
{
printf ("FAIL at line %d: unrecognized option %s\n",
lineno, opt);
failures++;
continue;
}
*p = c;
p += strspn (p, " \t");
}
}
if (is_v3_ctor || is_v3_dtor)
{
char buf[20];
if (is_v3_ctor)
{
enum gnu_v3_ctor_kinds kc;
kc = is_gnu_v3_mangled_ctor (input.data);
sprintf (buf, "%d", (int) kc);
}
else
{
enum gnu_v3_dtor_kinds kd;
kd = is_gnu_v3_mangled_dtor (input.data);
sprintf (buf, "%d", (int) kd);
}
if (strcmp (buf, expect.data) != 0)
{
fail (lineno, format.data, input.data, buf, expect.data);
failures++;
}
continue;
}
@ -152,18 +255,25 @@ main(argc, argv)
? strcmp (result, expect.data)
: strcmp (input.data, expect.data))
{
printf ("\
FAIL at line %d, style %s:\n\
in: %s\n\
out: %s\n\
exp: %s\n",
lineno, fstyle,
input.data,
result,
expect.data);
fail (lineno, format.data, input.data, result, expect.data);
failures++;
}
free (result);
if (no_params)
{
getline (&expect);
result = cplus_demangle (input.data, DMGL_ANSI|DMGL_TYPES);
if (result
? strcmp (result, expect.data)
: strcmp (input.data, expect.data))
{
fail (lineno, format.data, input.data, result, expect.data);
failures++;
}
free (result);
}
}
free (format.data);