summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2019-03-09 21:14:48 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2019-03-16 07:33:45 +0100
commitfcb67c9118e885e56a5f220653e6022b69d8d573 (patch)
tree55fc6031b52450fd08146361cf937b1920e9e171
parentb050c7ee87b319ce94d307f09f667e27e32ed2a7 (diff)
Factor out code to reset the asm input/output entities in normalize_asm_text().
-rw-r--r--src/parser/parser.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/parser/parser.c b/src/parser/parser.c
index 97f32ac..991b241 100644
--- a/src/parser/parser.c
+++ b/src/parser/parser.c
@@ -9231,6 +9231,15 @@ static unsigned set_asm_operand_entities(unsigned pos, bool *const need_normaliz
return pos;
}
+static void reset_asm_operand_entities(entity_t *const operands)
+{
+ for (entity_t *i = operands; i; i = i->base.next) {
+ symbol_t *const symbol = i->base.symbol;
+ if (symbol)
+ reset_symbol(symbol, NAMESPACE_ASM_ARGUMENT);
+ }
+}
+
static void normalize_asm_text(asm_statement_t *asm_statement)
{
if (!asm_statement->has_arguments) {
@@ -9299,18 +9308,8 @@ static void normalize_asm_text(asm_statement_t *asm_statement)
asm_statement->normalized_text
= finish_string_construction(asm_statement->asm_text->encoding);
- for (entity_t *input = asm_statement->inputs; input != NULL;
- input = input->base.next) {
- symbol_t *symbol = input->base.symbol;
- if (symbol != NULL)
- reset_symbol(symbol, NAMESPACE_ASM_ARGUMENT);
- }
- for (entity_t *output = asm_statement->outputs; output != NULL;
- output = output->base.next) {
- symbol_t *symbol = output->base.symbol;
- if (symbol != NULL)
- reset_symbol(symbol, NAMESPACE_ASM_ARGUMENT);
- }
+ reset_asm_operand_entities(asm_statement->inputs);
+ reset_asm_operand_entities(asm_statement->outputs);
}
/**