aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2024-12-03 10:47:53 +0100
committerJan Beulich <jbeulich@suse.com>2024-12-03 10:47:53 +0100
commit5ea62b98d952c28a988b51fbfabbd6d3a11e1694 (patch)
treecdef3f4ff75022f0a3544cc2b48c1456c333892b /gas
parent29f84cf8a214db79fe28c6d7d4a1e242783555c4 (diff)
downloadbinutils-5ea62b98d952c28a988b51fbfabbd6d3a11e1694.zip
binutils-5ea62b98d952c28a988b51fbfabbd6d3a11e1694.tar.gz
binutils-5ea62b98d952c28a988b51fbfabbd6d3a11e1694.tar.bz2
MMIX: use current_location() directly
It's no longer a static function, so it can be used without involving a wrapper function plus an indirect function call.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-mmix.c10
-rw-r--r--gas/config/tc-mmix.h9
2 files changed, 3 insertions, 16 deletions
diff --git a/gas/config/tc-mmix.c b/gas/config/tc-mmix.c
index f2a16e6..157cb72 100644
--- a/gas/config/tc-mmix.c
+++ b/gas/config/tc-mmix.c
@@ -441,16 +441,6 @@ mmix_fill_nops (char *opcodep, int n)
md_number_to_chars (opcodep + i * 4, SWYM_INSN_BYTE << 24, 4);
}
-/* See macro md_parse_name in tc-mmix.h. */
-
-int
-mmix_current_location (void (*fn) (expressionS *), expressionS *exp)
-{
- (*fn) (exp);
-
- return 1;
-}
-
/* Get up to three operands, filling them into the exp array.
General idea and code stolen from the tic80 port. */
diff --git a/gas/config/tc-mmix.h b/gas/config/tc-mmix.h
index 08061b8..5e70617 100644
--- a/gas/config/tc-mmix.h
+++ b/gas/config/tc-mmix.h
@@ -48,15 +48,12 @@ extern void mmix_md_begin (void);
extern void mmix_md_finish (void);
#define md_finish mmix_md_finish
-extern int mmix_current_location \
- (void (*fn) (expressionS *), expressionS *);
extern int mmix_parse_predefined_name (char *, expressionS *);
extern char *mmix_current_prefix;
-/* A bit ugly, since we "know" that there's a static function
- current_location that does what we want. We also strip off a leading
- ':' in another ugly way.
+/* Besides the special casing of "@" we also strip off a leading ':' in an
+ ugly way.
The [DVWIOUZX]_Handler symbols are provided when-used. */
@@ -65,7 +62,7 @@ extern int mmix_gnu_syntax;
(! mmix_gnu_syntax \
&& (name[0] == '@' \
? (! is_part_of_name (name[1]) \
- && mmix_current_location (current_location, exp)) \
+ && (current_location (exp), 1)) \
: ((name[0] == ':' || ISUPPER (name[0])) \
&& mmix_parse_predefined_name (name, exp))))