From 476030dd2890a4fc0c46afcd8dab3247982a3bd7 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 31 Aug 2024 13:51:35 +0100 Subject: Fix #4156 --- src/llvm_backend_stmt.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/llvm_backend_stmt.cpp') diff --git a/src/llvm_backend_stmt.cpp b/src/llvm_backend_stmt.cpp index f2fe4f7dc..bef516283 100644 --- a/src/llvm_backend_stmt.cpp +++ b/src/llvm_backend_stmt.cpp @@ -1404,6 +1404,10 @@ gb_internal bool lb_switch_stmt_can_be_trivial_jump_table(AstSwitchStmt *ss, boo } + if (is_typeid) { + return false; + } + return true; } -- cgit v1.2.3 From 722b638e2cbefcc1735256ef712cf2b28078a7fb Mon Sep 17 00:00:00 2001 From: Laytan Date: Sat, 31 Aug 2024 19:40:05 +0200 Subject: "fix" #4169, looks like llvm 14 bug --- src/llvm_backend_stmt.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/llvm_backend_stmt.cpp') diff --git a/src/llvm_backend_stmt.cpp b/src/llvm_backend_stmt.cpp index bef516283..df3d4bc03 100644 --- a/src/llvm_backend_stmt.cpp +++ b/src/llvm_backend_stmt.cpp @@ -2199,8 +2199,7 @@ gb_internal void lb_build_if_stmt(lbProcedure *p, Ast *node) { // and `LLVMConstIntGetZExtValue()` calls below will be valid and `LLVMInstructionEraseFromParent()` // will target the correct (& only) branch statement - - if (cond.value && LLVMIsConstant(cond.value)) { + if (cond.value && LLVMIsAConstantInt(cond.value)) { // NOTE(bill): Do a compile time short circuit for when the condition is constantly known. // This done manually rather than relying on the SSA passes because sometimes the SSA passes // miss some even if they are constantly known, especially with few optimization passes. -- cgit v1.2.3