[llvm] Ensure NoTrapAfterNoreturn is false for the wasm backend (PR #65876)
Heejin Ahn via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 21 16:21:46 PDT 2023
================
@@ -127,6 +127,7 @@ WebAssemblyTargetMachine::WebAssemblyTargetMachine(
// LLVM 'unreachable' to ISD::TRAP and then lower that to WebAssembly's
// 'unreachable' instructions which is meant for that case.
this->Options.TrapUnreachable = true;
+ this->Options.NoTrapAfterNoreturn = false;
----------------
aheejin wrote:
> > Even if you give --no-trap-after-noreturn to the command line, this line will override it. Is that a bug or your intention?
>
> Yes, that's the intention.
>
> > If it is your intention, did you want to check if we can override it, i.e., ignore it, even if we are given --no-trap-after-noreturn, and was that the reason you added the command line flag?
>
> Yes that's more-or-less the point. Except that it's not just the command line option we need to ignore, we also need to override NoTrapAfterNoreturn when it's passed to us in C++.
If `--no-trap-after-noreturn` is given in the command line, I think we should either warn or error rather than silently ignoring it, which can be more confusing.
https://github.com/llvm/llvm-project/pull/65876
More information about the llvm-commits
mailing list