diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2021-06-04 14:26:45 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2021-06-13 17:42:40 -0700 |
commit | a80cdd3183ed85bc254cbe22ca240dc035fc6548 (patch) | |
tree | 93e6c5628e1c266ef32b3013030614d1f551ef15 /tcg/tcg.c | |
parent | 42eb6dfcf135068aa6873e6e9f5f8afa77858914 (diff) |
tcg: Introduce tcg_remove_ops_after
Introduce a function to remove everything emitted
since a given point.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/tcg.c')
-rw-r--r-- | tcg/tcg.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -2083,6 +2083,19 @@ void tcg_op_remove(TCGContext *s, TCGOp *op) #endif } +void tcg_remove_ops_after(TCGOp *op) +{ + TCGContext *s = tcg_ctx; + + while (true) { + TCGOp *last = tcg_last_op(); + if (last == op) { + return; + } + tcg_op_remove(s, last); + } +} + static TCGOp *tcg_op_alloc(TCGOpcode opc) { TCGContext *s = tcg_ctx; |