summaryrefslogtreecommitdiffstats
path: root/tcg/tcg.c
diff options
context:
space:
mode:
authorRichard Henderson2021-06-04 23:26:45 +0200
committerRichard Henderson2021-06-14 02:42:40 +0200
commita80cdd3183ed85bc254cbe22ca240dc035fc6548 (patch)
tree93e6c5628e1c266ef32b3013030614d1f551ef15 /tcg/tcg.c
parenttcg: Move tcg_init_ctx and tcg_ctx from accel/tcg/ (diff)
downloadqemu-a80cdd3183ed85bc254cbe22ca240dc035fc6548.tar.gz
qemu-a80cdd3183ed85bc254cbe22ca240dc035fc6548.tar.xz
qemu-a80cdd3183ed85bc254cbe22ca240dc035fc6548.zip
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.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 81da553244..ca482c2301 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -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;