aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
diff options
context:
space:
mode:
authorduk <74797529+duk-37@users.noreply.github.com>2024-10-12 20:01:22 -0400
committerGitHub <noreply@github.com>2024-10-12 20:01:22 -0400
commit464a7ee79efda399c77f0009cc9dc0737d6e3c1e (patch)
tree305fee367e1b1975dc100f7ba2efda143b641044 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
parent4c25a538d3677866f6e3757ad3beecc50c56e589 (diff)
downloadllvm-464a7ee79efda399c77f0009cc9dc0737d6e3c1e.zip
llvm-464a7ee79efda399c77f0009cc9dc0737d6e3c1e.tar.gz
llvm-464a7ee79efda399c77f0009cc9dc0737d6e3c1e.tar.bz2
[CodeGen] Generalize trap emission after SP check fail (#109744)
Generalize and improve some target-specific code that emits traps after stack protector failure in SelectionDAG & GlobalIsel.
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
index 73765f8..7b7ba0b 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
@@ -133,7 +133,10 @@ WebAssemblyTargetMachine::WebAssemblyTargetMachine(
// WebAssembly type-checks instructions, but a noreturn function with a return
// type that doesn't match the context will cause a check failure. So we lower
// LLVM 'unreachable' to ISD::TRAP and then lower that to WebAssembly's
- // 'unreachable' instructions which is meant for that case.
+ // 'unreachable' instructions which is meant for that case. Formerly, we also
+ // needed to add checks to SP failure emission in the instruction selection
+ // backends, but this has since been tied to TrapUnreachable and is no longer
+ // necessary.
this->Options.TrapUnreachable = true;
this->Options.NoTrapAfterNoreturn = false;