1. 23 Sep, 2014 1 commit
    • demangle.h (DMGL_DLANG): New macro. · 43b1b9ed
      include/:
      	* demangle.h (DMGL_DLANG): New macro.
      	(DMGL_STYLE_MASK): Add DMGL_DLANG.
      	(demangling_styles): Add dlang_demangling.
      	(DLANG_DEMANGLING_STYLE_STRING): New macro.
      	(DLANG_DEMANGLING): New macro.
      	(dlang_demangle): New prototype.
      libiberty/:
      	* Makefile.in (CFILES): Add d-demangle.c.
      	(REQUIRED_OFILES): Add d-demangle.o.
      	* cplus-dem.c (libiberty_demanglers): Add dlang_demangling case.
      	(cplus_demangle): Likewise.
      	* d-demangle.c: New file.
      	* testsuite/Makefile.in (really-check): Add check-d-demangle.
      	* testsuite/d-demangle-expected: New file.
      
      From-SVN: r215530
      Iain Buclaw committed
  2. 11 Jun, 2014 1 commit
    • Delete temporary string within demangler even in failure cases. · ac8345a5
      A call to demangle_template might allocate storage within a temporary
      string even if the call to demangle_template eventually returns
      failure.
      
      This will never cause the demangler to crash, but does leak memory, as
      a result I've not added any tests for this.
      
      Calling string_delete is safe, even if nothing is allocated into the
      string, the string is initialised with string_init, so we know the
      internal pointers are NULL.
      
      libiberty/ChangeLog
      
      	* cplus-dem.c (do_type): Call string_delete even if the call to
      	demangle_template fails.
      
      From-SVN: r211449
      Andrew Burgess committed
  3. 14 May, 2014 1 commit
  4. 20 Apr, 2011 1 commit
    • remove useless if-before-free tests · 04695783
      Change "if (E) free (E);" to "free (E);" everywhere except in the
      libgo/, intl/, zlib/ and classpath/ directories.
      Also transform equivalent variants like
      "if (E != NULL) free (E);" and allow an extra cast on the
      argument to free.  Otherwise, the tested and freed "E"
      expressions must be identical, modulo white space.
      
      From-SVN: r172785
      Jim Meyering committed
  5. 03 Jan, 2011 1 commit
  6. 22 Sep, 2010 1 commit
    • cplus-dem.c (ada_demangle): Add comments. · a69d9775
      2010-09-22 Tristan Gingold  <gingold@adacore.com>
      
      	* cplus-dem.c (ada_demangle): Add comments.
      	Handle stream and controlled type operations.
      	Decoding of some uppercase letters moved before separators.
      	* testsuite/demangle-expected: Add tests.
      
      From-SVN: r164518
      Tristan Gingold committed
  7. 11 Jan, 2010 1 commit
    • demangle.h (ada_demangle): Add prototype. · 5b40c067
      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
      Tristan Gingold committed
  8. 23 Sep, 2009 1 commit
  9. 13 Mar, 2008 1 commit
  10. 23 Jan, 2008 1 commit
  11. 12 May, 2006 1 commit
  12. 24 May, 2005 1 commit
    • libiberty.h (ACONCAT): Properly cast value of alloca(). · d7cf8390
      include/
      2005-05-24  Gabriel Dos Reis  <gdr@integrable-solutions.net>
      
      	* libiberty.h (ACONCAT): Properly cast value of alloca().
      
      	* ansidecl.h (ATTRIBUTE_UNUSED_LABEL): Don't define if
      	__cplusplus.
      
      libiberty/
      2005-05-24  Gabriel Dos Reis  <gdr@integrable-solutions.net>
      
      	* configure.ac: Check declarations for calloc(), getenv(),
      	malloc(), realloc() and sbrk().
      	* config.in: Regenerate.
      	* configure: Likewise.
      
      	* alloca.c (C_alloca): Change "new" to "new_storage".  Use XNEWVEC
      	instead of xmalloc.
      	* choose-temp.c (choose_temp_base): Use XNEWVEC instea od xmalloc.
      	* concat.c (liiberty_concat_ptr): Surround definition with an
      	extern "C" block, if __cplusplus.
      	(concat): Use XNEWVEC instead of xmalloc.
      	(reconcat): Likewise.
      	* cp-demangle.c (struct d_print_template): Rename member
      	"template" to "template_decl".  Adjust use throughout the file.
      	(d_print_resize): Properly cast return value of realloc().
      	(cplus_demangle_print): Same for malloc().
      	(d_demangle): Likewise.
      	* cp-demint.c (cplus_demangle_fill_builtin_type): Rename parameter
      	"typename" to "type_name".
      	* cplus-dem.c (grow_vect): Use XRESIZEVEC instead of xrealloc().
      	(work_stuff_copy_to_from): Use XNEWVEC insteand of xmalloc().
      	(demangle_template_value_parm): Likewise.
      	(demangle_template): Likewise.
      	(recursively_demangle): Likewise.
      	(do_hpacc_template_literal): Likewise.
      	(do_arg): Likewise.
      	(remember_type): Likewise.
      	(remember_Ktype): Likewise.
      	(register_Btype): Likewise.
      	(string_need): Use XRESIZEVEC instead of xrealloc().
      	* dyn-string.c (dyn_string_init): Use XNEWVEC.
      	(dyn_string_new): Use XNEW.
      	(dyn_string_resize): Use XRESIZEVEC.
      	* fnmatch.c (fnmatch): Rename local variable "not" to "negate".
      	* getopt.c (getenv): Declare only if !__cplusplus and !getenv.
      	Otherwise include <stdlib.h>.
      	(exchange): Cast return value of malloc().
      	* hashtab.c (htab_size): Define as both macro and non-inline
      	function.
      	(htab_elements): Likewise.
      	* getpwd.c (getpwd): Use XNEWVEC.
      	(htab_create_alloc_ex): Use C90 prototype-style.
      	* lrealpath.c (lrealpath): Appropriately cast return value of
      	malloc().
      	* make-relative-prefix.c (save_string): Likewise.
      	* make-temp-file.c (try_dir): Rename from "try".  Adjust use in
      	the file.
      	(choose_tmpdir): Use XNEWVEC.
      	* mkstemps.c (mkstemps): Rename parameter "template" to "pattern".
      	* pex-common.c (pex_init_common): Use XNEW.
      	(pex_add_remove): Use XRESIZEVEC.
      	(pex_run): Likewise.
      	(pex_get_status_and_time): Likewise.
      	* pex-djgpp.c (pex_djgpp_exec_child): Likewise.
      	* pex-msdos.c (pex_init): Use XNEW.
      	(pex_msdos_exec_child): Likewise.
      	(pex_msdos_exec_child): Use XRESIZEVEC.
      	* pex-unix.c (pex_wait): Use XNEW.
      	* pex-win32.c (fix_argv): Use XNEWVEC.
      	* pexecute.c (pwait): Likewise.
      	* setenv.c (setenv): Properly cast return value of malloc().
      	* sigsetmask.c (sigsetmask): Rename local variables "old" and
      	"new" to "old_sig" and "new_sig".
      	* sort.c (main): Use XNEWVEC.
      	* spaces.c (spaces): Cast return value of malloc().
      	* strndup.c (strndup): Likewise.
      	* ternary.c (ternary_insert): Use XNEW.
      	* xmalloc.c (malloc, realloc, calloc, sbrk): Surround declaration
      	with an extern "C" block if __cplusplus.
      	* xstrdup.c (xstrdup): Cast return value of memcpy().
      	* xstrerror.c (strerror): Enclose declaration in an extern "C"
      	block if __cplusplus.
      	* xstrndup.c (xstrndup): Use XNEW. Cast return value of memcpy().
      
      From-SVN: r100115
      Gabriel Dos Reis committed
  13. 10 May, 2005 1 commit
  14. 27 Mar, 2005 1 commit
    • Convert libiberty to use ISO C prototype style 3/n. · 500d7701
              * cplus-dem.c (set_cplus_marker_for_demangling, consume_count,
              consume_count_with_underscores, code_for_qualifier,
              qualifier_string, demangle_qualifier, cplus_demangle_opname,
              cplus_mangle_opname, cplus_demangle_set_style,
              cplus_demangle_name_to_style, cplus_demangle, grow_vect,
              ada_demangle, internal_cplus_demangle, squangle_mop_up,
              work_stuff_copy_to_from, delete_non_B_K_work_stuff,
              delete_work_stuff, mop_up, demangle_signature,
              demangle_method_args, demangle_template_template_parm,
              demangle_expression, demangle_integral_value,
              demangle_real_value, demangle_template_value_parm,
              demangle_template, arm_pt, demangle_arm_hp_template,
              demangle_class_name, demangle_class,
              iterate_demangle_function,
              demangle_prefix, gnu_special, recursively_demangle,
              arm_special,
              demangle_qualified, get_count, do_type, demangle_fund_type,
              do_hpacc_template_const_value, do_hpacc_template_literal,
              snarf_numeric_literal, do_arg, remember_type, remember_Ktype,
              register_Btype, remember_Btype, forget_B_and_K_types,
              forget_types, demangle_args, demangle_nested_args,
              demangle_function_name, string_need, string_delete,
              string_init,
              string_clear, string_empty, string_append, string_appends,
              string_appendn, string_prepend, string_prepends,
              string_prependn,
              string_append_template_idx): Use ISO C prootype style.
              * cp-demint.c (cplus_demangle_fill_component,
              cplus_demangle_fill_builtin_type,
              cplus_demangle_fill_operator,
              cplus_demangle_v3_components): Likewise.
      
      From-SVN: r97109
      Gabriel Dos Reis committed
  15. 24 Nov, 2004 1 commit
  16. 02 Jan, 2004 1 commit
    • cp-demangle.c (d_encoding): When DMGL_PARAMS is not set... · e4796f1c
      	* 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
      Ian Lance Taylor committed
  17. 20 Oct, 2003 1 commit
  18. 11 Mar, 2003 1 commit
  19. 04 Mar, 2003 1 commit
  20. 20 Feb, 2003 1 commit
  21. 13 Feb, 2003 1 commit
    • re PR c++/7612 (Memory leaks in cplus-dem.c) · 902cf50c
      	Fix PR c++/7612.
      	* cplus-dem.c (demangle_signature): Call string_delete.
      	Remove extra string_init.
      	(demangle_arm_hp_template): Call string_delete instead of
      	string_clear.  Add missing string_delete call.
      	(demangle_qualified): Add missing string_delete call.
      	(do_type): Remove unused variable btype.  Add missing string_delete
      	call.  Call string_delete instead of string_clear.
      	(demangle_fund_type): Move variable btype inside of the switch
      	statement.  Add missing string_delete call.
      	(do_arg): Call string_delete instead of string_clear.  Remove extra
      	string_init.
      	(demangle_nested_args): Free work->previous_argument.
      
      From-SVN: r62852
      Daniel Jacobowitz committed
  22. 06 Oct, 2002 1 commit
  23. 20 Sep, 2002 1 commit
    • cp-demangle.c (demangling_new): Cast 0 to enum. · f08b7eee
      	* cp-demangle.c (demangling_new): Cast 0 to enum.
      	(demangle_char): Cast return of strdup to char *.
      	(is_gnu_v3_mangled_ctor): Cast 0 to enum.
      	(is_gnu_v3_mangled_dtor): Likewise.
      	* cplus-dem.c (grow_vect): Cast return of xrealloc to void *.
      	(work_stuff_copy_to_from): Cast return of xmalloc to char **.
      	* fibheap.c (fibnode_new): Cast return of xcalloc to fibnode_t.
      	* md5.c (md5_process_bytes): Cast results back to const void *.
      	(md5_process_block): Add cast to const md5_uint32 *.
      	* regex.c (re_compile_fastmap): Cast enum to UCHAR_T.
      	* safe-ctype.c (L, XL, U, XU, D, P, _, C, Z, M, V, T, S): Add cast to
      	unsigned short.
      	* splay-tree.c (splay_tree_xmalloc_allocate): Cast return of xmalloc
      	to void *.
      	* vasprintf.c (int_vasprintf): Cast return of malloc to char *.
      
      From-SVN: r57330
      John David Anglin committed
  24. 11 Sep, 2002 1 commit
    • Makefile.in: Remove all references to s-under and underscore.c. · 3fd9d606
      gcc:
      	* Makefile.in: Remove all references to s-under and underscore.c.
      	* collect2.c, tlink.c: Change all uses of prepends_underscore
      	to look directly at USER_LABEL_PREFIX.
      
      gcc/cp:
      	* Make-lang.in: Build cp/cxxfilt.o from $(srcdir)/cp/cxxfilt.c,
      	and c++filt from cxxfilt.o + version.o + $(LIBDEPS).
      	* cxxfilt.c: New file: split from libiberty/cplus-dem.c, with
      	minor adjustments (use version_string, eliminate yet another
      	duplicate of xmalloc)
      
      libiberty:
      	* cplus-dem.c: Code code under #ifdef MAIN moved to gcc/cp/cxxfilt.c.
      	* testsuite/Makefile.in: Adjust for test-demangle.
      	* testsuite/regress-demangle: Deleted.
      	* testsuite/test-demangle.c: New file.
      	* testsuite/demangle-expected: Change \$ to $ throughout, now that
      	this file is not being read by a shell script.
      
      From-SVN: r57037
      Zack Weinberg committed
  25. 29 Jul, 2002 1 commit
  26. 19 Feb, 2002 1 commit
  27. 18 Feb, 2002 1 commit
    • re PR other/5390 ([3.3 only?] Libiberty fails to demangle multi-digit template parameters.) · 336669e7
      2002-02-18  Carlo Wood  <carlo@gnu.org>
      
      	PR c++/5390
              * cplus-dem.c (demangle_integral_value): Accept multi-digit
              numbers that do not start with an underscore; This is needed
              for integer template parameters. This doesn't break anything
              because multi-digit numbers are never followed by a digit.
              * testsuite/demangle-expected: Corrected all mangled test
              cases with multi-digit template parameters: g++ 2.95.x does
              not generate underscores around these parameters.
      
      From-SVN: r49851
      Carlo Wood committed
  28. 05 Feb, 2002 1 commit
    • demangle.h (cplus_demangle_v3): Add "options" parm. · c13db5d1
              * demangle.h (cplus_demangle_v3): Add "options" parm.
              (cplus_demangle_v3_type): Remove prototype.
              (DMGL_VERBOSE): New macro.
              (DMGL_TYPES): New macro.
      
              * cplus-dem.c (flags): Add DMGL_VERBOSE
              (cplus_demangle_v3_p): Remove.
              (demangle_it): Add DMGL_TYPES to passed flags.
              * cp-demangle.c (cplus_demangle_v3_all): Remove.
              (cplus_demangle_v3_type): Remove.
              (cplus_demangle_v3): Add options parm.
      
              * collect2.c (dump_file): Pass DMGL_VERBOSE to cplus_demangle.
      
      From-SVN: r49525
      Jason Merrill committed
  29. 03 Feb, 2002 1 commit
    • cp-demangle.c (cp_demangle_type): Do not protect with IN_LIBGCC2. · d74697b8
      2002-02-02  H.J. Lu  (hjl@gnu.org)
      
      	* cp-demangle.c (cp_demangle_type): Do not protect with
      	IN_LIBGCC2.
      	(cplus_demangle_v3_all): New.
      	(cplus_demangle_v3): Call cplus_demangle_v3_all.
      	(cplus_demangle_v3_type): Call cplus_demangle_v3_all.
      
      	* cplus-dem.c (cplus_demangle_v3_p): New function pointer.
      	Initialized to cplus_demangle_v3.
      	(cplus_demangle_with_style): Call cplus_demangle_v3_p instead
      	of cplus_demangle_v3.
      	(main): Set cplus_demangle_v3_p to cplus_demangle_v3_type for
      	command line symbol.
      
      	* testsuite/regress-demangle: Pass the mangled name at the
      	command line.
      
      From-SVN: r49456
      H.J. Lu committed
  30. 02 Jan, 2002 2 commits
    • gcc.c (default_compilers): Const-ify. · 5e65297b
      	* gcc.c (default_compilers): Const-ify.
      	* mips-tdump.c (stab_names): Likewise.
      	* mips-tfile.c (map_coff_types, map_coff_storage,
      	map_coff_sym_type, map_coff_derived_type, stabs_symbol,
      	pseudo_ops_t, pseudo_ops): Likewise.
      	* protoize.c (default_include): Likewise
      
      f:
      	* com.c (clear_binding_level): Const-ify.
      	(ffecom_arglist_expr_): Likewise.
      	* info.c (ffeinfo_types_): Don't needlessly zero init.
      	* lex.c (ffelex_hash_kludge): Const-ify.
      
      java:
      	* parse.y (src_parse_roots): Don't needlessly zero init.
      
      libiberty:
      	* cp-demangle.c (long_options): Const-ify.
      	* cplus-dem.c (long_options): Likewise.
      
      From-SVN: r48485
      Kaveh R. Ghazi committed
    • cplus-dem.c (mystrstr): Delete. · adddf5bf
      	* cplus-dem.c (mystrstr): Delete.  All callers changed to use
      	strstr instead.
      
      From-SVN: r48476
      Kaveh R. Ghazi committed
  31. 12 Dec, 2001 1 commit
  32. 06 Dec, 2001 1 commit
  33. 17 Oct, 2001 1 commit
    • argv.c, [...]: Improve manual formatting. · 5bed56d9
      * argv.c, asprintf.c, choose-temp.c, concat.c, cplus-dem.c,
      ffs.c, fnmatch.txh, getruntime.c, make-temp-file.c,
      mkstemps.c, pexecute.c, random.c, strsitnal.c, vasprintf.c:
      Improve manual formatting.
      * functions.texi: Regenerate.
      
      From-SVN: r46323
      DJ Delorie committed
  34. 07 Oct, 2001 1 commit
    • demangle.h (demangler_engine): Const-ify. · 0be6abca
      include:
      	* demangle.h (demangler_engine): Const-ify.
      	* libiberty.h (buildargv): Likewise.
      
      libiberty:
      	* argv.c (buildargv, tests, main): Const-ify.
      	* cp-demangle.c (operator_code): Likewise.
      	* cplus-dem.c (optable, libiberty_demanglers,
      	cplus_demangle_set_style, cplus_demangle_name_to_style,
      	print_demangler_list): Likewise.
      	* hashtab.c (higher_prime_number): Likewise.
      	* strcasecmp.c (charmap): Likewise.
      	* strerror.c (error_info, strerror, main): Likewise.
      	* strncasecmp.c (charmap): Likewise.
      	* strsignal.c (signal_info): Likewise.
      
      From-SVN: r46060
      Kaveh R. Ghazi committed
  35. 20 Mar, 2001 1 commit
  36. 05 Mar, 2001 1 commit
  37. 16 Feb, 2001 1 commit
  38. 02 Feb, 2001 1 commit
    • Add support for Java demangling under the v3 ABI: · 3b60dd8e
      	* cp-demangle.c (NAMESPACE_SEPARATOR): New define.
      	(struct demangling_def): Add `style' field.
      	(demangling_new): New parameter `style'. Set it in demangling_t.
      	(demangle_prefix): Use NAMESPACE_SEPARATOR.
      	(demangle_type_ptr): Don't emit pointer symbol if doing Java output.
      	(cp_demangle): New parameter `style'. Pass it to demangling_new().
      	(main): Call cp_demangle with extra parameter.
      	(java_demangle_v3): New function.
      	(java_builtin_type_names): New. Table of primitive type names used
      	for Java demangling.
      	(demangle_builtin_type): Look up in java_builtin_type_names if doing
      	Java output.
      	* cplus-dem.c (cplus_demangle): Use java_demangle_v3 to do Java
      	demangling.
      	(long_options): Remove obsolete `java' option.
      	(main): Remove explicit handling of `java' option. Instead, pass style
      	parameter in cplus_demangle flags as gdb does.
      	* testsuite/demangle.expected: Add some Java test cases.
      
      From-SVN: r39399
      Bryce McKinlay committed
  39. 08 Dec, 2000 1 commit
    • safe-ctype.h: New file. · f6bbde28
      include:
      	* safe-ctype.h: New file.
      libiberty:
      	* safe-ctype.c: New file.
      	* Makefile.in (CFILES): Add safe-ctype.c.
      	(REQUIRED_OFILES): Add safe-ctype.o.
      
      	* argv.c: Define ISBLANK and use it, not isspace.
      	* basename.c, cplus-dem.c, fnmatch.c, pexecute.c, strtod.c,
      	strtol.c, strtoul.c: Include safe-ctype.h, not ctype.h.  Use
      	uppercase ctype macros.  Don't test ISUPPER(c)/ISLOWER(c)
      	before calling TOLOWER(c)/TOUPPER(c).
      gcc:
      	* Makefile.in (HOST_RTL): Add safe-ctype.o.
      	(safe-ctype.o): New rule.
      	* system.h: Include safe-ctype.h, not ctype.h.  No need to
      	wrap ctype macros.
      
      	* cpphash.h: Zap IStable and related macros.  Define is_* in
      	terms of safe-ctype.h macros.
      	* cppinit.c: Delete the IStable and all related code.
      
      	* tradcpp.c: Delete is_idchar, is_idstart, is_hor_space, and
      	is_space arrays.  Delete initialize_char_syntax.  Change all
      	references to the above arrays to use macros instead.
      	* tradcpp.h: Define is_idchar, is_idstart, is_space, and
      	is_nvspace in terms of safe_ctype.h's macros.
      	* tradcif.y: is_idchar, is_idstart are macros not arrays.
      
      	* config/i370/i370.c, config/winnt/dirent.c,
      	config/winnt/fixinc-nt.c, config/winnt/ld.c:
      	Use uppercase ctype macros.  If we included ctype.h,
      	include safe-ctype.h instead.
      
      	* fixinc/fixfixes.c: Use uppercase ctype macros.  Don't test
      	ISLOWER(c) before calling TOUPPER(c).
      	* fixinc/fixincl.c (extract_quoted_files): Simplify out some gunk.
      	* fixinc/gnu-regex.c: Include safe-ctype.h, not ctype.h.  No need to
      	wrap ctype macros.  Don't test ISUPPER(x) before calling TOLOWER(x).
      gcc/ch:
      	* lex.c: Don't bother checking whether ISUPPER(c) before
      	calling TOLOWER(c).  Don't bother checking whether isascii(c)
      	before testing ISSPACE(c); ISSPACE(c) includes '\n'.
      gcc/f:
      	* Make-lang.in: Link f/fini with safe-ctype.o.
      	* bad.c: Don't test ISUPPER(c) || ISLOWER(c) before calling TOUPPER(c).
      	* com.c: Use TOUPPER, not ffesrc_toupper.
      	* fini.c: Don't test ISALPHA(c) before calling TOUPPER(c)/TOLOWER(c).
      	* intrin.c: Don't test IN_CTYPE_DOMAIN(c).
      	* src.c: Delete ffesrc_toupper_ and ffesrc_tolower_ and their
      	initializing code; use TOUPPER and TOLOWER instead of
      	ffesrc_toupper and ffesrc_tolower.
      	* src.h: Don't declare ffesrc_toupper_ or ffesrc_tolower_.
      	Don't define ffesrc_toupper or ffesrc_tolower.
      gcc/java:
      	* jvgenmain.c: Use ISPRINT not isascii.
      
      From-SVN: r38124
      Zack Weinberg committed