aboutsummaryrefslogtreecommitdiff
path: root/libiberty/testsuite
AgeCommit message (Collapse)AuthorFilesLines
2010-02-04* testsuite/demangle-expected: Add missing --format=gnu-v3.Tom Tromey1-0/+1
From-SVN: r156498
2010-02-03re PR c++/4926 (C++ ABI needs clarification on mangling of complex expressions)Jason Merrill1-0/+5
PR c++/4926 PR c++/38600 * mangle.c (write_unqualified_id): Split out from write_expression. (write_unqualified_name): Call it. (write_member_name): Likewise. (write_expression): Support TEMPLATE_ID_EXPR. Disambiguate operator names. From-SVN: r156482
2010-02-03re PR c++/12909 (ambiguity in mangling vector types)Jason Merrill1-0/+6
PR c++/12909 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling. From-SVN: r156481
2010-01-26cp-demangle.c (cplus_demangle_type): Check for invalid type after "DF".Ian Lance Taylor1-2/+5
* cp-demangle.c (cplus_demangle_type): Check for invalid type after "DF". * testsuite/demangle-expected: Add test. From-SVN: r156226
2010-01-11demangle.h (ada_demangle): Add prototype.Tristan Gingold1-0/+95
include/ 2010-01-11 Tristan Gingold <gingold@adacore.com> * demangle.h (ada_demangle): Add prototype. libiberty/ 2010-01-11 Tristan Gingold <gingold@adacore.com> * cplus-dem.c (ada_demangle): Remove prototype. (grow_vect): Removed. (ada_demangle): Rewritten. (cplus_demangle): Fix indentation. * testsuite/demangle-expected: Add tests for Ada. From-SVN: r155804
2009-10-08argv.c (consume_whitespace): New function.Daniel Gutson1-1/+33
2009-10-08 Daniel Gutson <dgutson@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Pedro Alves <pedro@codesourcery.com> libiberty/ * argv.c (consume_whitespace): New function. (only_whitespace): New function. (buildargv): Always use ISSPACE by calling consume_whitespace. (expandargv): Skip empty files. Do not stop at the first empty argument (calling only_whitespace).. * testsuite/test-expandargv.c: (test_data): Test empty lines and empty arguments. (run_tests): Fix false positives due to shorter arguments. Co-Authored-By: Daniel Jacobowitz <dan@codesourcery.com> Co-Authored-By: Pedro Alves <pedro@codesourcery.com> From-SVN: r152560
2009-09-29merge in cxx0x-lambdas-branch@152308Jason Merrill1-5/+21
From-SVN: r152318
2009-06-16re PR fortran/10197 (direct acces files not unformatted by default)Nick Clifton1-5/+5
PR 10197 * testsuite/test-demangle.c: Rename getline to get_line to avoid conflicts with system function of the same name. From-SVN: r148526
2009-03-23pt.c (make_fnparm_pack): Split out from...Jason Merrill1-3/+7
* gcc/cp/pt.c (make_fnparm_pack): Split out from... (instantiate_decl): ...here. (tsubst_pack_expansion): Handle being called in a late-specified return type. * libiberty/cp-demangle.c (d_expression): Handle pack expansion. (d_find_pack): Handle DEMANGLE_COMPONENT_FUNCTION_PARAM. (d_print_subexpr): Don't wrap function parms in (). (d_print_comp) [DEMANGLE_COMPONENT_PACK_EXPANSION]: Handle not finding a pack. From-SVN: r145013
2009-03-17decl.c (grokfndecl): Set DECL_CONTEXT on parms.Jason Merrill1-7/+11
cp/: * decl.c (grokfndecl): Set DECL_CONTEXT on parms. (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms. * pt.c (check_explicit_specialization): Likewise. (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a local specialization. * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name. * decl2.c (parm_index): New fn. * semantics.c (finish_decltype_type): Don't use describable_type. * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR. Give a sorry for unsupported codes rather than crash. Mangle conversions with other than 1 operand. New mangling for PARM_DECL. * operators.def (ALIGNOF_EXPR): Mangle as az. * include/demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_FUNCTION_PARAM. * libiberty/cp-demangle.c (d_make_function_param): new fn. (cplus_demangle_mangled_name): Work around abi v2 bug. (d_expr_primary): Likewise. (cplus_demangle_operators): Add alignof ops. (d_expression): Handle function parameters and conversions with other than 1 operand. (d_print_comp): Handle function parameters. Fix bug with function used in type of function. From-SVN: r144924
2008-10-06PR c++/37376, other mangling issuesJason Merrill1-14/+18
gcc/cp/: PR c++/37376, other mangling issues * mangle.c (write_type): Update TYPE_PACK_EXPANSION mangling. (write_member_name): Break out from... (write_expression): ...here. Handle dependent COMPONENT_REF. (write_template_arg): Wrap an argument pack in 'I'/'E'. (write_builtin_type): Update char16/32_t mangling. (write_nested_name, write_prefix): Don't forget template args for typename types. * operators.def: Add ARROW_EXPR, update COMPONENT_REF and EXPR_PACK_EXPANSION. libstdc++-v3/: * config/abi/pre/gnu.ver: Update char16/32_t manglings. include/: * demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_PACK_EXPANSION. libiberty/: * cp-demangle.c (struct d_print_info): Add pack_index. (d_dump): Add DEMANGLE_COMPONENT_PACK_EXPANSION. (d_make_comp): Likewise. DEMANGLE_COMPONENT_ARGLIST and DEMANGLE_COMPONENT_TEMPLATE_ARGLIST can have two null args. (cplus_demangle_builtin_types): Add char16/32_t. (cplus_demangle_type): Recognize them. (d_template_args): Handle empty argument packs. (d_template_arg): Handle argument packs. (d_expression): Handle dependent name. (d_index_template_argument): New fn. (d_lookup_template_argument): New fn. (d_find_pack, d_pack_length): New fn. (d_print_subexpr): Split out... (d_print_comp): ...from here. Use d_*_template_argument. Handle empty arg lists. Support pack expansions. * cp-demangle.h (D_BUILTIN_TYPE_COUNT): Increase to 32. From-SVN: r140916
2008-09-09demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_DECLTYPE.Jason Merrill1-0/+16
* include/demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_DECLTYPE. * libiberty/cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_DECLTYPE. (d_make_comp): Likewise. (cplus_demangle_type): Handle decltype and DFP types. (cplus_demangle_operators): Call operator takes 2 args. (cplus_demangle_builtin_types): Add DFP types. (d_exprlist): New fn. (d_expression): Handle parm placeholders, T() and calls. (d_print_comp): Handle decltype, T() and calls. * libiberty/testsuite/demangle-expected: Test the above. From-SVN: r140162
2008-04-18cpp-id-data.h (UC): Was U, conflicts with U...Kris Van Hees1-0/+20
libcpp/ChangeLog: 2008-04-14 Kris Van Hees <kris.van.hees@oracle.com> * include/cpp-id-data.h (UC): Was U, conflicts with U... literal. * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens. (struct cpp_options): Added uliterals. (cpp_interpret_string): Update prototype. (cpp_interpret_string_notranslate): Idem. * charset.c (init_iconv_desc): New width member in cset_converter. (cpp_init_iconv): Add support for char{16,32}_cset_desc. (convert_ucn): Idem. (emit_numeric_escape): Idem. (convert_hex): Idem. (convert_oct): Idem. (convert_escape): Idem. (converter_for_type): New function. (cpp_interpret_string): Use converter_for_type, support u and U prefix. (cpp_interpret_string_notranslate): Match changed prototype. (wide_str_to_charconst): Use converter_for_type. (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}. * directives.c (linemarker_dir): Macro U changed to UC. (parse_include): Idem. (register_pragma_1): Idem. (restore_registered_pragmas): Idem. (get__Pragma_string): Support CPP_STRING{16,32}. * expr.c (eval_token): Support CPP_CHAR{16,32}. * init.c (struct lang_flags): Added uliterals. (lang_defaults): Idem. * internal.h (struct cset_converter) <width>: New field. (struct cpp_reader) <char16_cset_desc>: Idem. (struct cpp_reader) <char32_cset_desc>: Idem. * lex.c (digraph_spellings): Macro U changed to UC. (OP, TK): Idem. (lex_string): Add support for u'...', U'...', u... and U.... (_cpp_lex_direct): Idem. * macro.c (_cpp_builtin_macro_text): Macro U changed to UC. (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}. gcc/ChangeLog: 2008-04-14 Kris Van Hees <kris.van.hees@oracle.com> * c-common.c (CHAR16_TYPE, CHAR32_TYPE): New macros. (fname_as_string): Match updated cpp_interpret_string prototype. (fix_string_type): Support char16_t* and char32_t*. (c_common_nodes_and_builtins): Add char16_t and char32_t (and derivative) nodes. Register as builtin if C++0x. (c_parse_error): Support CPP_CHAR{16,32}. * c-common.h (RID_CHAR16, RID_CHAR32): New elements. (enum c_tree_index) <CTI_CHAR16_TYPE, CTI_SIGNED_CHAR16_TYPE, CTI_UNSIGNED_CHAR16_TYPE, CTI_CHAR32_TYPE, CTI_SIGNED_CHAR32_TYPE, CTI_UNSIGNED_CHAR32_TYPE, CTI_CHAR16_ARRAY_TYPE, CTI_CHAR32_ARRAY_TYPE>: New elements. (char16_type_node, signed_char16_type_node, unsigned_char16_type_node, char32_type_node, signed_char32_type_node, char16_array_type_node, char32_array_type_node): New defines. * c-lex.c (cb_ident): Match updated cpp_interpret_string prototype. (c_lex_with_flags): Support CPP_CHAR{16,32} and CPP_STRING{16,32}. (lex_string): Support CPP_STRING{16,32}, match updated cpp_interpret_string and cpp_interpret_string_notranslate prototypes. (lex_charconst): Support CPP_CHAR{16,32}. * c-parser.c (c_parser_postfix_expression): Support CPP_CHAR{16,32} and CPP_STRING{16,32}. gcc/cp/ChangeLog: 2008-04-14 Kris Van Hees <kris.van.hees@oracle.com> * cvt.c (type_promotes_to): Support char16_t and char32_t. * decl.c (grokdeclarator): Disallow signed/unsigned/short/long on char16_t and char32_t. * lex.c (reswords): Add char16_t and char32_t (for c++0x). * mangle.c (write_builtin_type): Mangle char16_t/char32_t as vendor extended builtin type u8char32_t. * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Support RID_CHAR{16,32}. (cp_lexer_print_token): Support CPP_STRING{16,32}. (cp_parser_is_string_literal): Idem. (cp_parser_string_literal): Idem. (cp_parser_primary_expression): Support CPP_CHAR{16,32} and CPP_STRING{16,32}. (cp_parser_simple_type_specifier): Support RID_CHAR{16,32}. * tree.c (char_type_p): Support char16_t and char32_t as char types. * typeck.c (string_conv_p): Support char16_t and char32_t. gcc/testsuite/ChangeLog: 2008-04-14 Kris Van Hees <kris.van.hees@oracle.com> Tests for char16_t and char32_t support. * g++.dg/ext/utf-cvt.C: New * g++.dg/ext/utf-cxx0x.C: New * g++.dg/ext/utf-cxx98.C: New * g++.dg/ext/utf-dflt.C: New * g++.dg/ext/utf-gnuxx0x.C: New * g++.dg/ext/utf-gnuxx98.C: New * g++.dg/ext/utf-mangle.C: New * g++.dg/ext/utf-typedef-cxx0x.C: New * g++.dg/ext/utf-typedef- * g++.dg/ext/utf-typespec.C: New * g++.dg/ext/utf16-1.C: New * g++.dg/ext/utf16-2.C: New * g++.dg/ext/utf16-3.C: New * g++.dg/ext/utf16-4.C: New * g++.dg/ext/utf32-1.C: New * g++.dg/ext/utf32-2.C: New * g++.dg/ext/utf32-3.C: New * g++.dg/ext/utf32-4.C: New * gcc.dg/utf-cvt.c: New * gcc.dg/utf-dflt.c: New * gcc.dg/utf16-1.c: New * gcc.dg/utf16-2.c: New * gcc.dg/utf16-3.c: New * gcc.dg/utf16-4.c: New * gcc.dg/utf32-1.c: New * gcc.dg/utf32-2.c: New * gcc.dg/utf32-3.c: New * gcc.dg/utf32-4.c: New libiberty/ChangeLog: 2008-04-14 Kris Van Hees <kris.van.hees@oracle.com> * testsuite/demangle-expected: Added tests for char16_t and char32_t. From-SVN: r134438
2008-02-19re PR other/12618 (core not cleaned up by 'make distclean')Ben Elliston1-1/+2
PR other/12618 * testsuite/Makefile.in (mostlyclean): Remove any core file. From-SVN: r132405
2008-01-27demangle.h (demangle_component_type): Add DEMANGLE_COMPONENT_JAVA_RESOURCE...David Daney1-0/+4
include/ 2008-01-26 David Daney <ddaney@avtrex.com> * demangle.h (demangle_component_type): Add DEMANGLE_COMPONENT_JAVA_RESOURCE, DEMANGLE_COMPONENT_COMPOUND_NAME, and DEMANGLE_COMPONENT_CHARACTER as new enum values. (demangle_component): Add struct s_character to union u. libiberty/ 2008-01-26 David Daney <ddaney@avtrex.com> * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_JAVA_RESOURCE, DEMANGLE_COMPONENT_COMPOUND_NAME, and DEMANGLE_COMPONENT_CHARACTER cases. (d_make_comp): Handle DEMANGLE_COMPONENT_COMPOUND_NAME and DEMANGLE_COMPONENT_JAVA_RESOURCE cases. (d_make_character): New function. (d_java_resource): Same. (d_special_name): Handle "Gr" case. (d_print_comp): Handle DEMANGLE_COMPONENT_JAVA_RESOURCE, DEMANGLE_COMPONENT_COMPOUND_NAME, and DEMANGLE_COMPONENT_CHARACTER cases. * testsuite/demangle-expected: Add test for java resource name mangling. From-SVN: r131883
2007-05-06Index: libiberty/ChangeLogGeoffrey Keating1-0/+16
2007-05-04 Geoffrey Keating <geoffk@apple.com> * cp-demangle.c (d_name): Detect local-source-name. (d_prefix): Likewise. (d_unqualified_name): Implement local-source-name. Index: gcc/cp/ChangeLog 2007-05-04 Geoffrey Keating <geoffk@apple.com> PR 31775 * mangle.c (write_mangled_name): Mangle static variable names. (write_unqualified_name): Use local-source-name for namespace-scope static variables. Index: gcc/testsuite/ChangeLog 2007-05-04 Geoffrey Keating <geoffk@apple.com> PR 31775 * g++.dg/other/nested-extern.cc: New. * g++.dg/other/nested-extern-1.C: New. * g++.dg/other/nested-extern-2.C: New. From-SVN: r124467
2007-03-16cp-demangle.c (d_encoding): Exit early on error.Geoffrey Keating1-0/+4
* cp-demangle.c (d_encoding): Exit early on error. (d_pointer_to_member_type): Exit early if cplus_demangle_type returns NULL. (cplus_demangle_type): Likewise. * testsuite/demangle-expected: New testcase. From-SVN: r122972
2007-03-01Makefile.in: Add install-pdf target as copied from automake v1.10 rules.Brooks Moses1-1/+2
* Makefile.in: Add install-pdf target as copied from automake v1.10 rules. * testsuite/Makefile.in: Add dummy install-pdf target. From-SVN: r122438
2006-12-21cp-demangle.h: Add comment explaining what to do to avoid overrunning string.Geoffrey Keating2-4/+74
* cp-demangle.h: Add comment explaining what to do to avoid overrunning string. (d_check_char): New. (d_next_char): Don't advance past trailing '\0'. * cp-demangle.c (cplus_demangle_mangled_name): Use d_check_char. (d_nested_name): Likewise. (d_special_name): Likewise. (d_call_offset): Likewise. (d_function_type): Likewise. (d_array_type): Likewise. (d_pointer_to_member_type): Likewise. (d_template_param): Likewise. (d_template_args): Likewise. (d_template_arg): Likewise. (d_expr_primary): Likewise. (d_local_name): Likewise. (d_substitution): Likewise. (d_ctor_dtor_name): Use d_advance rather than d_next_char. * testsuite/test-demangle.c: Include sys/mman.h. (MAP_ANONYMOUS): Define. (protect_end): New. (main): Use protect_end. * testsuite/demangle-expected: Add testcases for overrunning the end of the string. From-SVN: r120097
2006-10-10--(top level)--------------------------------------------Brooks Moses1-1/+1
2006-10-10 Brooks Moses <bmoses@stanford.edu> * Makefile.def: Added pdf target handling. * Makefile.tpl: Added pdf target handling. * Makefile.in: Regenerated. ---fixincludes-------------------------------------------- 2006-10-10 Brooks Moses <bmoses@stanford.edu> * Makefile.in: Added empty "pdf" target. ---gcc---------------------------------------------------- 2006-10-10 Brooks Moses <bmoses@stanford.edu> * configure.ac: Added pdf to "Make-hooks" * Makefile.in: Added TEXI2PDF definition, and various pdf-file targets and *.pdf file patterns in cleanup targets. * configure: Regenerated. ---gcc/cp------------------------------------------------- 2006-10-10 Brooks Moses <bmoses@stanford.edu> * Make-lang.in: Added "c++.pdf" target support. ---gcc/fortran-------------------------------------------- 2006-10-10 Brooks Moses <bmoses@stanford.edu> * Make-lang.in: Added "fortran.pdf", "gfortran.pdf" target support. ---gcc/java----------------------------------------------- 2006-10-10 Brooks Moses <bmoses@stanford.edu> * Make-lang.in: Added "java.pdf", "gcj.pdf" target support. ---gcc/objc----------------------------------------------- 2006-10-10 Brooks Moses <bmoses@stanford.edu> * Make-lang.in: Added empty "objc.pdf" target. ---gcc/objcp---------------------------------------------- 2006-10-10 Brooks Moses <bmoses@stanford.edu> * Make-lang.in: Added empty "obj-c++.pdf" target. ---gcc/treelang------------------------------------------- 2006-10-10 Brooks Moses <bmoses@stanford.edu> * Make-lang.in: Added "treelang.pdf" target support. ---gnattools---------------------------------------------- 2006-10-10 Brooks Moses <bmoses@stanford.edu> * Makefile.in: Added empty "pdf" target. ---libcpp------------------------------------------------- 2006-10-10 Brooks Moses <bmoses@stanford.edu> * Makefile.in: Added empty "pdf" target. ---libdecnumber------------------------------------------- 2006-10-10 Brooks Moses <bmoses@stanford.edu> * Makefile.in: Added empty "pdf" target. ---libiberty---------------------------------------------- 2006-10-10 Brooks Moses <bmoses@stanford.edu> * Makefile.in: Added "pdf", "libiberty.pdf" target support. * testsuite/Makefile.in: Added empty "pdf" target. ---libobjc------------------------------------------------ 2006-10-10 Brooks Moses <bmoses@stanford.edu> * Makefile.in: Added empty "pdf" target. From-SVN: r117618
2006-09-22re PR other/29176 (Seg fault in demangler)Ian Lance Taylor1-0/+5
PR other/29176 * cp-demangle.c (d_substitution): Check for overflow when computing substitution index. From-SVN: r117144
2006-08-27re PR other/28797 (Problems with demangling (__cxa_demangle()))Ian Lance Taylor1-0/+6
PR other/28797 * cp-demangle.c (d_pointer_to_member_type): Do add a substitution for a qualified member which is not a function. * testsuite/demangle-expected: Add test case. From-SVN: r116493
2006-04-06Makefile.in: Add install-html, install-html-am, and install-html-recursive ↵Carlos O'Donell1-2/+2
targets. libiberty/ 2006-04-06 Carlos O'Donell <carlos@codesourcery.com> * Makefile.in: Add install-html, install-html-am, and install-html-recursive targets. Define mkdir_p and NORMAL_INSTALL. * configure.ac: AC_SUBST datarootdir, docdir, htmldir. * configure: Regenerate. * testsuite/Makefile.in: Add install-html and html targets. From-SVN: r112741
2006-01-20Makefile.in: Add test-expandargv test.Carlos O'Donell2-1/+307
libiberty/ 2006-01-20 Carlos O'Donell <carlos@codesourcery.com> * testsuite/Makefile.in: Add test-expandargv test. * testsuite/test-expandargv.c: New test. * argv.c (expandargv): Check for errors with ferror, rather than just by looking at return value from fread. From-SVN: r110047
2005-12-11Fixes java/PR9861Terry Laurenzo2-1/+31
From-SVN: r108374
2005-08-17strverscmp.c: Update FSF address.Kelley Cook3-4/+4
2005-08-17 Kelley Cook <kcook@gcc.gnu.org> * strverscmp.c: Update FSF address. * testsuite/Makefile.in: Likewise. * testsuite/test-demangle.c: Likewise. * testsuite/test-pexecute.c: Likewise. From-SVN: r103199
2005-07-01re PR other/22268 (libiberty demanger crashes on (invalid) mangled name)Ian Lance Taylor1-0/+6
PR other/22268 * cp-demangle.c (d_expr_primary): Don't run off the end of the string while looking for the end of a literal value. * testsuite/demangle-expected: Add test case. From-SVN: r101506
2005-05-25demangle.h (DEMANGLE_COMPONENT_HIDDEN_ALIAS): New.Richard Henderson1-0/+4
include/ * demangle.h (DEMANGLE_COMPONENT_HIDDEN_ALIAS): New. libiberty/ * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_HIDDEN_ALIAS. (d_make_comp, d_print_comp): Likewise. (d_special_name): Generate one. * testsuite/demangle-expected: Add a hidden alias test. From-SVN: r100174
2005-04-04test-pexecute.c (TEST_PEX_RUN): Move variable declaration before statement.Ian Lance Taylor1-2/+3
* testsuite/test-pexecute.c (TEST_PEX_RUN): Move variable declaration before statement. From-SVN: r97576
2005-03-29pex-common.c: New file.Ian Lance Taylor2-0/+532
libiberty: * pex-common.c: New file. * pex-one.c: New file. * pexecute.c: New file. * pex-common.h: Include <stdio.h>. (struct pex_obj): Define. (struct pex_funcs): Define. (pex_init_common): Declare. * pex-unix.c: Rewrite. * pex-win32.c: Rewrite. * pex-djgpp.c: Rewrite. * pex-msdos.c: Rewrite. * testsuite/text-pexecute.c: New file. * pexecute.txh: Rewrite. * configure.ac: Check for wait3 and wait4. Set CHECK to really-check rather than check-cplus-dem. * functions.texi: Rebuild. * Makefile.in: Rebuild dependencies. (CFILES): Add pexecute.c, pex-common.c, pex-one.c. (REQUIRED_OFILES): Add pexecute.o, pex-common.o, pex-one.o. * testsuite/Makefile.in (really-check): New target. (check-pexecute, test-pexecute): New targets. * configure: Rebuild. include: * libiberty.h: Include <stdio.h>. (PEX_RECORD_TIMES, PEX_USE_PIPES, PEX_SAVE_TEMPS): Define. (PEX_LAST, PEX_SEARCH, PEX_SUFFIX, PEX_STDERR_TO_STDOUT): Define. (PEX_BINARY_INPUT, PEX_BINARY_OUTPUT): Define. (pex_init, pex_run, pex_read_output): Declare. (pex_get_status, pex_get_times, pex_free, pex_one): Declare. (struct pex_time): Define. From-SVN: r97148
2004-06-28* testsuite/demangle-expected: Add test case.Ian Lance Taylor1-0/+5
From-SVN: r83799
2004-03-07test-demangle.c: Include <string.h> and <stdlib.h> for prototypes.Andreas Jaeger1-1/+7
* testsuite/test-demangle.c: Include <string.h> and <stdlib.h> for prototypes. (main): Initialize style. From-SVN: r79062
2004-02-25cp-demangle.h (enum d_builtin_type_print): Add D_PRINT_UNSIGNED...Ian Lance Taylor1-4/+4
* cp-demangle.h (enum d_builtin_type_print): Add D_PRINT_UNSIGNED, D_PRINT_UNSIGNED_LONG, D_PRINT_LONG_LONG, D_PRINT_UNSIGNED_LONG_LONG, D_PRINT_FLOAT. * cp-demangle.c (cplus_demangle_builtin_types): Change char and short types to D_PRINT_DEFAULT. Change other integer types to use new D_PRINT_* values where appropriate. Change float types to D_PRINT_FLOAT. (d_print_comp) [LITERAL, LITERAL_NEG]: Handle new D_PRINT_* values. * testsuite/demangle-expected: Adjust two test cases. * cp-demangle.c (d_print_function_type): Print a space before the parenthesis around the function type in more cases. * testsuite/demangle-expected: Adjust one test case. From-SVN: r78421
2004-02-25cp-demangle.c (d_print_comp): Don't emit extra parentheses around a cast.Ian Lance Taylor1-2/+2
* cp-demangle.c (d_print_comp) [UNARY]: Don't emit extra parentheses around a cast. * testsuite/demangle-expected: Adjust two test cases to match new output. From-SVN: r78416
2004-02-24cp-demangle.c (d_print_comp): Don't push more than one of the same ↵Ian Lance Taylor1-0/+18
CV-qualifier on the top of the stack. * cp-demangle.c (d_print_comp) [RESTRICT, VOLATILE, CONST]: Don't push more than one of the same CV-qualifier on the top of the stack. (d_print_comp) [ARRAY_TYPE]: If the array itself is CV-qualified, move the CV-qualifiers to apply to the element type instead. (d_print_array_type): When checking the modifiers, keep looking past ones which have been printed already. * testsuite/demangle-expected: Add three test cases. From-SVN: r78354
2004-01-02cp-demangle.c (d_encoding): When DMGL_PARAMS is not set...Ian Lance Taylor2-758/+1648
* 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. From-SVN: r75336
2003-12-20cp-demangle.c (d_identifier): In Java mode, skip an optional '$' after the ↵Ian Lance Taylor1-0/+4
identifier. * cp-demangle.c (d_identifier): In Java mode, skip an optional '$' after the identifier. * testsuite/demangle-expected: Add test case. From-SVN: r74885
2003-12-19re PR c++/13447 (Another demangler problem with method cv-qualifiers)Ian Lance Taylor1-0/+21
Fix for PR c++/13447: * cp-demangle.c (enum d_comp_type): Add D_COMP_LOCAL_NAME. (d_dump, d_make_comp): Handle D_COMP_LOCAL_NAME. (is_ctor_dtor_or_conversion): Handle D_COMP_LOCAL_NAME like D_COMP_QUAL_NAME. (is_ctor_or_dtor): Likewise. (d_local_name): Use D_COMP_LOCAL_NAME rather than D_COMP_QUAL_NAME. (d_print_comp) [D_COMP_LOCAL_NAME]: New. (d_prinT_comp) [D_COMP_TYPED_NAME]: If the left tree is D_COMP_LOCAL_NAME, pull any qualifiers off its right subtree. (d_print_mod_list): Handle D_COMP_LOCAL_NAME. * testsuite/demangle-expected: Add two test cases. * cp-demangle.c (d_print_function_type): Clear the global modifier list when printing the modifiers, not just when printing the function parameters. * testsuite/demangle-expected: Add two test cases. From-SVN: r74850
2003-12-15cp-demangle.c (d_print_function_type): Print the function parameters with no ↵Ian Lance Taylor1-0/+5
modifiers. * cp-demangle.c (d_print_function_type): Print the function parameters with no modifiers. * testsuite/demangle-expected: Add test case. From-SVN: r74652
2003-12-15Fix handling of constructor/destructor of standard substitution:Ian Lance Taylor1-1/+11
* cp-demangle.c (struct d_standard_sub_info): Define. (d_substitution): Add prefix argument. Change all callers. Rework handling of standard substitutions to print full name when qualifying a constructor/destructor, or when DMGL_VERBOSE is set. * testsuite/demangle-expected: Add test case. Fix handling of negative literal constants: * cp-demangle.c (enum d_comp_type): Add D_COMP_LITERAL_NEG. (d_dump, d_make_comp): Handle D_COMP_LITERAL_NEG. (d_expr_primary): Use D_COMP_LITERAL_NEG for a negative number. (d_print_comp): Handle D_COMP_LITERAL_NEG. * testsuite/demangle-expected: Add test case. From-SVN: r74632
2003-12-04re PR other/13304 (demangler bad output, "operator<<" insteads of "operator< <")Ian Lance Taylor1-0/+18
* cp-demangle.c (IS_UPPER, IS_LOWER): Define. (d_last_char): Define new macro. (d_make_name): Reject an empty name. (d_prefix, d_unqualified_name, d_type): Use new IS_* macros. (d_substitution, d_print_identifier): Likewise. (d_print_comp) [D_COMP_OPERATOR]: Likewise. (d_print_comp) [D_COMP_TEMPLATE]: Use new d_last_char macro. (d_print_mod) Use new d_last_char macro. (d_print_cast): Use new d_last_char macro. (is_ctor_or_dtor): Don't leak memory. Fix handling of member function modifiers: * cp-demangle.c (enum d_comp_type): Add D_COMP_RESTRICT_THIS, D_COMP_VOLATILE_THIS, and D_COMP_CONST_THIS. (d_dump): Dump new d_comp_type values. (d_make_comp): Accept new d_comp_type values. (has_return_type): Only accept _THIS variants of qualifiers. (d_encoding): Without DMGL_PARAMS, only remove _THIS variants of qualifiers. (d_cv_qualifiers): Add member_fn parameter. Change all callers. (d_print_comp) [D_COMP_TYPED_NAME]: Rather than removing qualifiers and printing them at the end, add _THIS qualifiers to the modifier list. (d_print_comp) [D_COMP_*_THIS]: New cases. (d_print_comp) [D_COMP_PTRMEM_TYPE]: Remove special handling of qualifiers. (d_print_mod_list): Add suffix parameter. Change all callers. Keep walking the list even if the current modifier has been printed. (d_print_mod): Handle new _THIS qualifiers. (d_print_function_type): Handle new _THIS qualifiers when deciding whether to print a parenthesis. Put a space before the parenthesis in some cases. Call d_print_mod_list again at the end, passing suffix as 1. (is_ctor_or_dtor): Look for new _THIS qualifiers. * testsuite/demangle-expected: Add test case. Fix for PR gcc/13304: * cp-demangle.c (d_print_comp) [D_COMP_TEMPLATE]: If the character before the '<' is itself a '<', insert a space. (d_print_cast): Likewise. * testsuite/demangle-expected: Add test case. Fix for PR gcc/13244: * cp-demangle.c (d_print_comp) [D_COMP_BINARY]: Wrap an expression which uses the '>' operator in an extra layer of parens. * testsuite/demangle-expected: Add test case. From-SVN: r74290
2003-12-01demangle-expected: Revert one part of 2003-06-26 patch to restore expected ↵Ian Lance Taylor1-2/+13
result of EDG test case... * testsuite/demangle-expected: Revert one part of 2003-06-26 patch to restore expected result of EDG test case to original expected result. From-SVN: r74128
2003-11-26cp-demangle.c (struct d_print_mod): Add templates field.Ian Lance Taylor1-0/+8
* cp-demangle.c (struct d_print_mod): Add templates field. (d_make_builtin_type): Check for NULL type. (d_make_extended_operator): Check for NULL name. (d_make_ctor, d_make_dtor): Likewise. (d_mangled_name): Add top_level parameter. Change all callers. (d_encoding): If DMGL_PARAMS is not set, strip off initial CV-qualifiers. (d_type): Check some return values we rely on. (d_bare_function_type, d_array_type): Likewise. (d_pointer_to_member_type, d_template_args): Likewise. (d_add_substitution): Fail if argument is NULL. (d_print_resize): Check whether buf is NULL. (d_print_comp): Save current templates list with each modifier. Don't pass the modifier list down when printing a template. (d_print_cast): Don't pass the modifier list down when printing a template. (d_print_mod_list): Temporarily set templates list while printing a modifier. (d_print_mod): Check that buf is not NULL before using it. (d_print_function_type): Print parens if there is no modifier. (d_init_info): Permit as many substitutions as there are characters in the mangled name. * testsuite/demangle-expected: Add two new test cases. From-SVN: r73970
2003-11-21cp-demangle.c (has_return_type): Skip qualifiers when checking whether we ↵Ian Lance Taylor1-0/+21
have a template. * cp-demangle.c (has_return_type): Skip qualifiers when checking whether we have a template. * testsuite/demangle-expected: Add four new tests. From-SVN: r73819
2003-11-21demangle-expected: Minor changes to match output of new demangler...Ian Lance Taylor1-5/+5
* testsuite/demangle-expected: Minor changes to match output of new demangler: adjust whitespace in four tests, and change order of qualifiers in one test. From-SVN: r73813
2003-11-18test-demangle.c (main): Don't pass DMGL_VERBOSE to cplus_demangle.Ian Lance Taylor1-1/+1
* testsuite/test-demangle.c (main): Don't pass DMGL_VERBOSE to cplus_demangle. From-SVN: r73709
2003-11-18* testsuite/Makefile.in (test-demangle): Depend upon libiberty.a.Ian Lance Taylor1-1/+1
From-SVN: r73708
2003-10-20cplus-dem.c (demangle_template): Register a new Btype only when needed.J. Brobecker1-0/+6
* cplus-dem.c (demangle_template): Register a new Btype only when needed. * testsuite/demangle-expected: Add a new test. From-SVN: r72729
2003-10-16demangle-expected: Update the expected output of _GLOBAL__I__Z2fnv.H.J. Lu1-1/+1
2003-10-16 H.J. Lu <hongjiu.lu@intel.com> * testsuite/demangle-expected: Update the expected output of _GLOBAL__I__Z2fnv. From-SVN: r72552
2003-06-26demangle-expected: Add more GNU V3 testcases.H.J. Lu1-1/+261
2003-06-26 H.J. Lu <hongjiu.lu@intel.com> * testsuite/demangle-expected: Add more GNU V3 testcases. From-SVN: r68540