Commit eae96d0c authored by Christian Gmeiner's avatar Christian Gmeiner Committed by Marge Bot
Browse files

compiler/isaspec: keep track of written data


Signed-off-by: Christian Gmeiner's avatarChristian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark's avatarRob Clark <robdclark@chromium.org>
Part-of: <mesa/mesa!11321>
parent f0104a6c
...@@ -127,6 +127,11 @@ struct decode_state { ...@@ -127,6 +127,11 @@ struct decode_state {
*/ */
unsigned num_instr; unsigned num_instr;
/**
* Column number of current line
*/
unsigned line_column;
/** /**
* Bitset of instructions that are branch targets (if options->branch_labels * Bitset of instructions that are branch targets (if options->branch_labels
* is enabled) * is enabled)
...@@ -162,7 +167,7 @@ print(struct decode_state *state, const char *fmt, ...) ...@@ -162,7 +167,7 @@ print(struct decode_state *state, const char *fmt, ...)
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
vfprintf(state->out, fmt, args); state->line_column += vfprintf(state->out, fmt, args);
va_end(args); va_end(args);
} }
...@@ -644,6 +649,7 @@ display(struct decode_scope *scope) ...@@ -644,6 +649,7 @@ display(struct decode_scope *scope)
p = e; p = e;
} else { } else {
fputc(*p, scope->state->out); fputc(*p, scope->state->out);
scope->state->line_column++;
} }
p++; p++;
} }
...@@ -661,6 +667,7 @@ decode(struct decode_state *state, void *bin, int sz) ...@@ -661,6 +667,7 @@ decode(struct decode_state *state, void *bin, int sz)
bitmask_t instr = { 0 }; bitmask_t instr = { 0 };
next_instruction(&instr, &instrs[state->n * BITMASK_WORDS]); next_instruction(&instr, &instrs[state->n * BITMASK_WORDS]);
state->line_column = 0;
if (state->options->max_errors && (errors > state->options->max_errors)) { if (state->options->max_errors && (errors > state->options->max_errors)) {
break; break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment