[clang] [clang][bytecode] Recude steps caused by switch statements (PR #201845)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 5 07:10:37 PDT 2026


https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/201845

>From 33da2e5975bda43332d78d72127306c8cc358feb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Fri, 5 Jun 2026 16:09:32 +0200
Subject: [PATCH] asdf

---
 clang/lib/AST/ByteCode/Interp.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp
index 699b034c3c683..f6cac7aeb9fb5 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -65,15 +65,17 @@ static bool Jmp(InterpState &S, CodePtr &PC, int32_t Offset) {
 static bool Jt(InterpState &S, CodePtr &PC, int32_t Offset) {
   if (S.Stk.pop<bool>()) {
     PC += Offset;
+    return S.noteStep(PC);
   }
-  return S.noteStep(PC);
+  return true;
 }
 
 static bool Jf(InterpState &S, CodePtr &PC, int32_t Offset) {
   if (!S.Stk.pop<bool>()) {
     PC += Offset;
+    return S.noteStep(PC);
   }
-  return S.noteStep(PC);
+  return true;
 }
 
 static void diagnoseMissingInitializer(InterpState &S, CodePtr OpPC,



More information about the cfe-commits mailing list