summaryrefslogtreecommitdiff
path: root/gas/macro.c
Commit message (Collapse)AuthorAgeFilesLines
* gas/Roland McGrath2013-01-101-13/+13
| | | | | | | * hash.c (hash_new_sized): Make it global. * hash.h: Declare it. * macro.c (define_macro): Use hash_new_sized instead of hash_new, pass a small size.
* PR gas/14201Alan Modra2012-06-071-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | * sb.h (sb_max_power_two): Delete. (struct sb): Delete "item" and "pot". Make "len" a size_t. Add "max". (sb_element): Delete. (sb_add_char, sb_add_buffer, sb_skip_comma, sb_skip_write): Update prototypes. * sb.c (string_count, free_list): Delete. (sb_build, sb_kill, sb_check): Rewrite. (scrub_from_sb, sb_add_char, sb_add_string, sb_add_buffer, sb_skip_white, sb_skip_comma): Replace assorted int params, vars and return types with size_t. * input-scrub.c: Likewise. * macro.c: Likewise. * macro.h: Likewise. * as.c: Likewise. * as.h: Likewise. * input-file.h: Likewise. * input-file.c: Likewise. * read.c: Likewise. * app.c: ..or ptrdiff_t. * input-file.c (input_file_get): Use ferror. (input_file_give_next_buffer): Use input_file_get.
* * macro.c (get_any_string): Free malloced br_buf.Nick Clifton2011-03-301-8/+12
| | | | (do_formals): Free 'formal'.
* * macro.c (sub_actual): Add back ampersand suffix when noAlan Modra2010-08-181-3/+4
| | | | | substitution. (macro_expand_body): Correct comment.
* PR gas/11834Alan Modra2010-07-231-3/+7
| | | | | * macro.c (macro_expand): Recover gracefully from named args that don't match params.
* PR gas/11507Nick Clifton2010-04-201-1/+3
| | | | | | | | * macro.c (macro_expand_body): Do not treat LOCAL as a keyword in altmacro mode if found inside a quoted string. * gas/macros/altmacro.s: New test. * gas/macros/altmacro.d: Expected output.
* Add -Wshadow to the gcc command line options used when compiling the binutils.Nick Clifton2009-12-111-5/+5
| | | | Fix up all warnings generated by the addition of this switch.
* PR gas/1491Alan Modra2009-10-151-37/+28
| | | | | | | | | | | | | | | | gas/ * macro.c: Delete unnecessary function declarations. (buffer_and_nest): Support multiple labels per line for LABELS_WITHOUT_COLONS targets if the labels do have colons. (free_macro): Move so that we don't need forward declaration. * read.c (read_a_source_file): Take a copy of macro expansion line before we trim labels. * listing.c (listing_newline): Adjust stdin line save for input_line_pointer still at start of line. gas/testsuite/ * gas/macros/dot.s: Don't start macro invocations is first column. * gas/macros/dot.l: Update. * gas/macros/macros.exp: Run dot test on more targets.
* * po/bfd.pot: Updated by the Translation project.Nick Clifton2009-09-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * po/binutils.pot: Updated by the Translation project. * po/gold.pot: Updated by the Translation project. * po/gold.pot: Updated by the Translation project. * po/gprof.pot: Updated by the Translation project. * po/sv.po: Updated Swedish translation. * po/ld.pot: Updated by the Translation project. * po/fi.po: Updated Finnish translation. * po/ld.pot: Updated by the Translation project. * po/fi.po: Updated Finnish translation. Updated sources to compile cleanly with -Wc++-compat: * basic_blocks.c: Add casts. * cg_dfn.c: Add cast. * corefile.c: Add casts. * gmon_io.c: Add casts. * hist.c: Add cast. * source.c: Add cast. * sym_ids.c (struct match): Moved to top level. Updated soruces in ld/* to compile cleanly with -Wc++-compat: * ld.h (enum endian_enum,enum symbolic_enum,enum dynamic_list_enum): Move to top level. * ldcref.c: Add casts. * ldctor.c: Add casts. * ldexp.c * ldexp.h (enum node_tree_enum,enum phase_enum): Move to top level. * ldlang.c: Add casts. (lang_insert_orphan): Use enum name instead of integer. * ldlang.h (enum statement_enum): Move to top level. * ldmain.c: Add casts. * ldwrite.c: Add casts. * lexsup.c: Add casts. (enum control_enum): Move to top level. * mri.c: Add casts. (mri_draw_tree): Use enum name instead of integer. Updated sources to compile cleanly with -Wc++-compat: * basic_blocks.c: Add casts. * cg_dfn.c: Add cast. * corefile.c: Add casts. * gmon_io.c: Add casts. * hist.c: Add cast. * source.c: Add cast. * sym_ids.c (struct match): Moved to top level. * as.c (main): Call dwarf2_init. * config/obj-elf.c (struct group_list): New field. (build_group_lists): Use hash lookup. (free_section_idx): New function. (elf_frob_file): Adjust. * dwarf2dbg.c (all_segs_hash, last_seg_ptr): New variables. (get_line_subseg): Adjust. (dwarf2_init): New function. * dwarf2dbg.h (dwarf2_init): New declaration.
* Banish PARAMS and PTR. Convert to ISO C.Alan Modra2008-08-121-1/+1
| | | | Delete unnecessary forward declarations.
* PR 6575Alan Modra2008-08-111-5/+7
| | | | | | | | | | | | * hash.c: Expand PTR to void *. (hash_delete): Add "freeme" parameter. Call obstack_free. * hash.h: Expand PTR to void *. (hash_delete): Update prototype. * macro.c (macro_expand_body): hash_delete LOCALs from formal_hash. * config/tc-tic54x.c (tic54x_remove_local_label): Update hash_delete call. (subsym_substitute): Likewise. * doc/internals.texi (hash_delete): Update.
* Switch to GPLv3Nick Clifton2007-07-031-2/+2
|
* PR gas/3856Nick Clifton2007-01-121-2/+12
| | | | * macro.c (expand_irp): Do not ignore spaces inside quoted strings.
* remove some duplicate #include's.Alan Modra2006-06-071-37/+1
|
* * listing.c (listing_listing): Remove useless loop.Ben Elliston2006-05-011-3/+0
| | | | | | | | | * macro.c (macro_expand): Remove is_positional local variable. * read.c (s_comm_internal): Simplify `if' condition 1 || x -> 1 and simplify surrounding expressions, where possible. (assign_symbol): Likewise. (s_weakref): Likewise. * symbols.c (colon): Likewise.
* gas/Jan Beulich2006-02-281-4/+3
| | | | | | | | | | | | 2006-02-28 Jan Beulich <jbeulich@novell.com> * macro.c (get_any_string): Don't insert quotes for <>-quoted input. gas/testsuite/ 2006-02-28 Jan Beulich <jbeulich@novell.com> * gas/all/altmacro.s: Adjust. * gas/all/altmac2.s: Adjust.
* gas/Jan Beulich2006-02-281-37/+40
| | | | | | | | | | | | | | | | 2006-02-28 Jan Beulich <jbeulich@novell.com> PR/1070 * macro.c (getstring): Don't treat parentheses special anymore. (get_any_string): Don't consider '(' and ')' as quoting anymore. Special-case '(', ')', '[', and ']' when dealing with non-quoting characters. gas/testsuite/ 2006-02-28 Jan Beulich <jbeulich@novell.com> * gas/macros/paren[sd]: New. * gas/macros/macros.exp: Run new test.
* * macro.c (buffer_and_nest): Skip labels regardless ofAlan Modra2005-11-071-36/+33
| | | | NO_PSEUDO_DOT and flag_m68k_mri.
* PR 1070Nick Clifton2005-08-091-5/+26
| | | | | * macro.c (getstring): Do not treat round parentheses exactly the same as angle brackets - the parentheses need to be preserved and passed on to the macro processing code.
* PR 1070Nick Clifton2005-08-081-8/+16
| | | | | * macro.c (getstring): Treat round parentheses in the same way as angle brackets. (get_any_string): Likewise.
* gas/Jan Beulich2005-05-101-23/+14
| | | | | | | | | | | | 2005-05-10 Jan Beulich <jbeulich@novell.com> * macro.c (get_any_string): Remove the two last parameters. Replace references to the former expand parameter by using macro_alternate. Simplify loop condition for checking for end-of-string. (get_string): Remove redunant call to sb_skip_white. (do_formals): Remove two last arguments to get_any_string. (macro_expand): Likewise. (expand_irp): Likewise.
* gas/Jan Beulich2005-05-061-69/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2005-05-06 Jan Beulich <jbeulich@novell.com> * macro.c (new_formal, del_formal): New. (do_formals): Use new_formal. Check for and parse qualifier. Warn if required argument has default value. Stop looking for more formal when there was a vararg one. (macro_expand_body): Use new_formal and del_formal. (macro_expand): Likewise. Initialize local variable err. Don't return immediately when encountering an error. Warn when keyword argument already had a value assigned. Eliminate duplicate clearing of argument value. When current positional argument matches parameter of vararg type, assign to it all the remaining arguments. Issue error when required parameter does not have value. (free_macro): Use del_formal. (expand_irp): Initialize formal type. Free buffers associated with formal prior to returning. * macro.h (struct formal_struct): Add new field 'type' with new enumeration type 'formal_type'. * doc/as.texinfo: Document macro parameter qualifiers. * NEWS: Mention new functionality. gas/testsuite/ 2005-05-06 Jan Beulich <jbeulich@novell.com> * gas/macros/badarg.s: Add check for bad qualifier specification. * gas/macros/badarg.l: Adjust. * gas/macros/vararg.[sd]: New. * gas/macros/macros.exp: Run new test.
* Update the address and phone number of the FSFNick Clifton2005-05-051-2/+2
|
* * config/obj-ecoff.c (ecoff_frob_file_before_fix): Fix invocations of ↵Nick Clifton2005-05-031-1/+1
| | | | | | | | | | | bfd_section_list... macros. * config/tc-mmix.c (mmix_frob_file): Likewise. * config/tc-xtensa.c (xtensa_remove_section): Likewise. (xtensa_insert_section): Likewise. * macro.c (macro_hash): Remove static. * macro.h (macro_hash): Provide an external declaration.
* * Makefile.am (GAS_CFILES): Remove bignum-copy.c.Ben Elliston2005-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GENERIC_OBJS): Likewise, remove bignum-copy.o. (bignum-copy.o): Remove. * Makefile.in: Regenerate. * makefile.vms (OBJS): Remove bignum-copy.obj. * symbols.h (local_symbol_make): Remove declaration. (verify_symbol_chain_2): Likewise. * symbols.c (local_symbol_make): Make static. (max_indent_level): Likewise. (verify_symbol_chain_2): Remove. * macro.c (macro_hash): Make static. * messages.c (fprint_value): Remove. * read.h (get_absolute_expr): Remove. (emit_leb128_expr): Likewise. (do_s_func): Likewise. * read.c (do_s_func): Make static. (emit_leb128_expr): Likewise. (get_absolute_expr): Likewise. * as.h (as_howmuch): Remove declaration. (fprint_value): Likewise. * as.c (myname): Make static. * input-scrub.c (as_howmuch): Remove. (as_1_char): Likewise. * input-file.h (input_file_is_open): Remove. * input-file.c (input_file_is_open): Likewise. * expr.h (expr_build_unary): Remove declaration. (expr_build_binary): Likewise. * expr.c (expr_build_unary): Remove. (expr_build_binary): Likewise. * hash.h (hash_replace): Remove declaration. (hash_delete): Likewise. * hash.c (hash_replace): Remove. (hash_delete): Likewise. * bignum-copy.c (bignum_copy): Move from here .. * config/tc-vax.c (bignum_copy): .. to here. * bignum.h (LOG_TO_BASE_2_OF_10): Remove. (bignum_copy): Remove extern declaration. * sb.h (string_count): Remove extern declaration. (sb_build, sb_add_buffer, sb_print, sb_print_at): Likewise. (sb_name): Likewise. * sb.c (dsize): Replace preprocessor macro with static int. (string_count): Make static. (sb_build, sb_add_buffer, sb_print, sb_print_at): Likewise. (sb_name): Likewise. * config/obj-coff.c (dim_index): Make static. * config/tc-i386.c (GOT_symbol): Likewise. (output_invalid_buf): Likewise. * doc/internals.texi (Warning and error messages): Remove the prototype for fprint_value.
* gas/Jan Beulich2005-04-251-55/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2005-04-25 Jan Beulich <jbeulich@novell.com> * macro.c (macro_expand_body): Replace locals indicator parameters with actual macro_entry. New local variables macro_line and err. Don't return when encountering an error, just record the fact. Detect local symbol name colliding with parameter. Track line number inside of macro expansion. (do_formals): Move local variable name to wider scope. Check parameter of the same name doesn't already exist. In MRI mode, also check it doesn't collide with the argument count pseudo-parameter). (define_macro): Add file and line number parameters. Remove local variable namestr. New local variable error. Initialize macro_entry members file, line, and name. Don't return when encountering an error, just record the fact. Use %s in some diagnostics for read.c to insert the macro name. Free macro_entry on error. (macro_expand): Pass macro_entry to macro_epand_body. Don't return when encountering an error, just record the fact. (expand_irp): Don't return when encountering an error, just record the fact. * macro.h (macro_struct): New members name, file, and line. (define_macro): Add file and line number parameters. * read.c (s_macro): Pass file and line to define_macro. Tag warning regarding pseudo-op redefinition with the file/line that macro definition started at. gas/testsuite/ 2005-04-25 Jan Beulich <jbeulich@novell.com> * gas/macros/badarg.s: Add tests for collisions between/among macro parameters and local symbols. * gas/macros/badarg.l: Adjust.
* gas/Jan Beulich2005-04-181-3/+43
| | | | | | | | | | | | | | | | | 2005-04-18 Jan Beulich <jbeulich@novell.com> * macro.c (free_token): New, freeing all the memory associated with a macro. (do_formals): Move initializers to ... (define_macro): ... here. (delete_macro): Convert passed in name to lower case. Warn when purging macro that doesn't exist. Use hash_jam instead of hash_delete. gas/testsuite/ 2005-04-18 Jan Beulich <jbeulich@novell.com> * gas/macros/purge.[ls]: New. * gas/macros/macros.exp: Run new test.
* gas/Jan Beulich2005-04-111-36/+52
| | | | | | | | | | | | | | | | | | | | | | | | 2005-04-11 Jan Beulich <jbeulich@novell.com> * NEWS: Mention these changes and their effects. * macro.c (get_token): Use is_name_beginner/is_part_of_name/ is_name_ender. (check_macro): Likewise. (buffer_and_nest): Likewise. Permit multiple labels. Don't discard labels together with the closing pseudo-op. (macro_expand_body): Adjust comment. Range-check input before use. Adjust mis-spelled diagnostic. Use is_name_beginner. * read.c (try_macro): New. (read_a_source_file): New static variable last_eol. Don't list macro expansion lines more than once. Call try_macro. (s_macro): Set section of line_label to absolute instead of undefined. * doc/as.texinfo: Add information on the caveats of these changes. gas/testsuite/ 2005-04-11 Jan Beulich <jbeulich@novell.com> * gas/macros/dot.[ls]: New. * gas/macros/macros.exp: Run new test.
* update copyright datesAlan Modra2005-03-031-2/+2
|
* gas/Jan Beulich2005-01-311-13/+26
| | | | | | | | | | | | | | | | | 2005-01-31 Jan Beulich <jbeulich@novell.com> * macro.c (buffer_and_nest): Allow 'from' being NULL; handle anything that can end with .endr in that case. Make requiring/permitting pseudo-ops without leading dot closer to the logic in read.c serving the same purpose. (expand_irp): Don't pass a mnemonic to buffer_and_nest as it will be ignored. gas/testsuite/ 2005-01-31 Jan Beulich <jbeulich@novell.com> * gas/macros/repeat.[ds]: New. * gas/macros/macros.exp: Run new test.
* gas/Jan Beulich2005-01-311-14/+35
| | | | | | | | | | | | | | | | | | | | | | | 2005-01-31 Jan Beulich <jbeulich@novell.com> * macro.c (do_formals): Adjust to no longer accept empty parameter names. (define_macro): Adjust to no longer accept empty macro name, garbage following the parameters, or macros that were previously defined. * read.c (s_bad_end): Declare. (potable): Add endm. Handler for endr and endm is s_bad_end. (s_bad_end): Rename from s_bad_endr. Adjust to handle both .endm and .endr. * read.h (s_bad_endr): Remove. gas/testsuite/ 2005-01-31 Jan Beulich <jbeulich@novell.com> * gas/macros/badarg.[ls]: New. * gas/macros/end.[ls]: New. * gas/macros/redef.[ls]: New. * gas/macros/macros.exp (run_list_test): Copy from elsewhere. Run new tests.
* For ELF targets use .LL rather than LL as the prefix for symbol names generatedNick Clifton2004-10-071-2/+3
| | | | from the LOCAL macro directive.
* (macro_set_alternate): Use ISO C90 formatting.Nick Clifton2004-08-161-2/+1
|
* Add and handle new --alternate command line option.Nick Clifton2004-08-131-0/+9
|
* * listing.c: Convert to ISO-C.Kazu Hirata2003-11-241-83/+30
| | | | | | * listing.h: Likewise. * macro.c: Likewise. * macro.h: Likewise.
* * macro.c (sub_actual): Don't lose string if it turns out thatAlan Modra2003-06-021-0/+1
| | | | &string wasn't an arg.
* (buffer_and_nest): Store more to sb instead of '\n'.Nick Clifton2003-03-131-2/+2
| | | | | (get_line_sb): Return end of line character or '\n' if it is zero or non-existent.
* * configure.in: Add iq2000-elf target.Stan Cox2003-01-031-2/+2
| | | | | | * configure: Regenerate. * config/tc-iq2000.c: New file. * config/tc-iq2000.h: Likewise.
* Remove GASP.Nick Clifton2002-12-021-44/+20
|
* * macro.c (get_any_string): Correct logic for not going beyond endHans-Peter Nilsson2002-11-111-1/+1
| | | | of in->ptr[].
* * as.h: Fix formatting.Kazu Hirata2002-05-031-24/+24
| | | | | | | | | | | | * cgen.c: Likewise. * cgen.h: Likewise. * dwarf2dbg.c: Likewise. * frags.h: Likewise. * gasp.c: Likewise. * macro.c: Likewise. * read.c: Likewise. * stabs.c: Likewise. * symbols.c: Likewise.
* Add no-c-format comment to prevent confusion when translating string.Nick Clifton2002-01-171-1/+2
|
* Locale changes from Bruno Haible <haible@clisp.cons.org>.H.J. Lu2001-09-191-18/+15
|
* * as.h (alloca): Don't declare if __GNUC__. Remove an old comment.Alan Modra2001-08-101-11/+5
| | | | | Comment indentation of #pragma. * macro.c (alloca): Likewise.
* Fix m68k/mri mode problems.Nick Clifton2001-06-121-15/+23
|
* Fix copyright noticesNick Clifton2001-03-081-1/+1
|
* Fix formattingNick Clifton2000-12-121-5/+5
|
* 2000-08-31 Kazu Hirata <kazu@hxi.com>Kazu Hirata2000-08-311-62/+65
| | | | | * frags.c: Fix formatting. * macro.c: Likewise.
* Fix spelling typos.Nick Clifton2000-06-251-5/+12
| | | | Remove use of DEFUN().
* 2000-06-13 Ulf Carlsson <ulfc@engr.sgi.com>Ulf Carlsson2000-06-141-0/+11
| | | | | * macro.c (getstring): Make it possible to escape the quote character.