[llvm] Ensure NoTrapAfterNoreturn is false for the wasm backend (PR #65876)

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 17:02:29 PDT 2023


================
@@ -37,6 +37,11 @@ static cl::opt<bool>
     EnableTrapUnreachable("trap-unreachable", cl::Hidden,
                           cl::desc("Enable generating trap for unreachable"));
 
+static cl::opt<bool> EnableNoTrapAfterNoreturn(
+    "no-trap-after-noreturn", cl::Hidden,
+    cl::desc("Do not emit a trap instruction for 'unreachable' IR instructions "
+             "after noreturn calls, even if --trap-unreachable is set."));
----------------
aheejin wrote:

And given that `NoTrapAfterNoreturn` is by default set to false and we don't override it, we've been setting this to false anyway... Why do we need to newly 'ensure' it? https://github.com/llvm/llvm-project/blob/2cab996192cf143d10e3381fcefa75e270cc7ddb/llvm/include/llvm/Target/TargetOptions.h#L137

https://github.com/llvm/llvm-project/pull/65876


More information about the llvm-commits mailing list