diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2021-07-14 23:23:49 +0200 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-09-21 20:25:31 +0000 |
commit | eae96d0c4c4874b49962220c07c67281f6cc9f8c (patch) | |
tree | 5fdeb5300299627455ab43c317e3e252c8396aad /src/compiler/isaspec | |
parent | f0104a6c72336fac573201925d0884d36a241b58 (diff) |
compiler/isaspec: keep track of written data
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
Diffstat (limited to 'src/compiler/isaspec')
-rw-r--r-- | src/compiler/isaspec/decode.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/isaspec/decode.c b/src/compiler/isaspec/decode.c index 9edb5be3d8e..5c64489664f 100644 --- a/src/compiler/isaspec/decode.c +++ b/src/compiler/isaspec/decode.c @@ -128,6 +128,11 @@ struct decode_state { unsigned num_instr; /** + * Column number of current line + */ + unsigned line_column; + + /** * Bitset of instructions that are branch targets (if options->branch_labels * is enabled) */ @@ -162,7 +167,7 @@ print(struct decode_state *state, const char *fmt, ...) va_list args; va_start(args, fmt); - vfprintf(state->out, fmt, args); + state->line_column += vfprintf(state->out, fmt, args); va_end(args); } @@ -644,6 +649,7 @@ display(struct decode_scope *scope) p = e; } else { fputc(*p, scope->state->out); + scope->state->line_column++; } p++; } @@ -661,6 +667,7 @@ decode(struct decode_state *state, void *bin, int sz) bitmask_t instr = { 0 }; next_instruction(&instr, &instrs[state->n * BITMASK_WORDS]); + state->line_column = 0; if (state->options->max_errors && (errors > state->options->max_errors)) { break; |