summaryrefslogtreecommitdiff
path: root/gas/macro.h
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2005-04-25 06:43:46 +0000
committerJan Beulich <jbeulich@novell.com>2005-04-25 06:43:46 +0000
commitf73d1b24cc002e103f4f453f39f4c649057cf23a (patch)
tree2ad21d8cbf3dd40d5dfdb2e01e0a317a99761c88 /gas/macro.h
parent72ab29eb495e0ee8cdc28fed2ae5fe78131627f2 (diff)
downloadbinutils-redhat-f73d1b24cc002e103f4f453f39f4c649057cf23a.tar.gz
gas/
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.
Diffstat (limited to 'gas/macro.h')
-rw-r--r--gas/macro.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/gas/macro.h b/gas/macro.h
index 54c7f0c500..958a84bd5d 100644
--- a/gas/macro.h
+++ b/gas/macro.h
@@ -60,6 +60,9 @@ typedef struct macro_struct
int formal_count; /* Number of formal args. */
formal_entry *formals; /* Pointer to list of formal_structs. */
struct hash_control *formal_hash; /* Hash table of formals. */
+ const char *name; /* Macro name. */
+ char *file; /* File the macro was defined in. */
+ unsigned int line; /* Line number of definition. */
} macro_entry;
/* Whether any macros have been defined. */
@@ -76,7 +79,7 @@ extern void macro_init
extern void macro_set_alternate (int);
extern void macro_mri_mode (int);
extern const char *define_macro
- (int, sb *, sb *, int (*) (sb *), const char **);
+ (int, sb *, sb *, int (*) (sb *), char *, unsigned int, const char **);
extern int check_macro (const char *, sb *, const char **, macro_entry **);
extern void delete_macro (const char *);
extern const char *expand_irp (int, int, sb *, sb *, int (*) (sb *));