diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-04 15:06:14 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-04 15:39:50 +0200 |
commit | dcf7d2a15920303ff74df298f3fb1cf29289c118 (patch) | |
tree | 9ebf4a600d1896f445df2e4d0a86c5e597cdd174 | |
parent | 709595b2979d7fcbc94b57236a8dca1a5d2dd4cb (diff) | |
download | sparse-dcf7d2a15920303ff74df298f3fb1cf29289c118.tar.gz |
add support for arch specific asm constraints
When evaluating asm operands it must be known if they correspond
to a memory operand or not in order to process/ignore the 'noderef'
attribute.
This is done for operands specified with the common constraints
but not for the machine specific constraints.
So, add support for processing machine specific constraints.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | evaluate.c | 5 | ||||
-rw-r--r-- | target.h | 3 |
2 files changed, 6 insertions, 2 deletions
@@ -3642,7 +3642,10 @@ static void parse_asm_constraint(struct asm_operand *op) return; default: - // FIXME: arch-specific (and multi-letter) constraints + if (arch_target->asm_constraint) + str = arch_target->asm_constraint(op, c, str); + + // FIXME: multi-letter constraints break; } } @@ -53,7 +53,7 @@ extern int pointer_alignment; extern int bits_in_enum; extern int enum_alignment; - +struct asm_operand; struct builtin_fn; struct target { @@ -77,6 +77,7 @@ struct target { void (*init)(const struct target *self); void (*predefine)(const struct target *self); + const char *(*asm_constraint)(struct asm_operand *op, int c, const char *str); }; extern const struct target target_default; |