diff options
author | Matt Harding <majaharding@gmail.com> | 2023-09-22 21:03:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-22 22:03:21 +0200 |
commit | 64d1ceaa3884608c97f8457de6ab64a038ea49d8 (patch) | |
tree | 485ed916ce9ff790d636c648eb3ff1a62ca2f83d /llvm/lib/CodeGen/LLVMTargetMachine.cpp | |
parent | c373a1ff181ca02e8a8e46ed22fbaabeaf1d17c7 (diff) | |
download | llvm-64d1ceaa3884608c97f8457de6ab64a038ea49d8.zip llvm-64d1ceaa3884608c97f8457de6ab64a038ea49d8.tar.gz llvm-64d1ceaa3884608c97f8457de6ab64a038ea49d8.tar.bz2 |
Add command line option --no-trap-after-noreturn (#67051)
Add the command line option --no-trap-after-noreturn, which exposes the
pre-existing TargetOption `NoTrapAfterNoreturn`.
This pull request was split off from this one:
https://github.com/llvm/llvm-project/pull/65876
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LLVMTargetMachine.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index 7ec8390..87a17b8 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -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.")); + void LLVMTargetMachine::initAsmInfo() { MRI.reset(TheTarget.createMCRegInfo(getTargetTriple().str())); assert(MRI && "Unable to create reg info"); @@ -95,6 +100,8 @@ LLVMTargetMachine::LLVMTargetMachine(const Target &T, if (EnableTrapUnreachable) this->Options.TrapUnreachable = true; + if (EnableNoTrapAfterNoreturn) + this->Options.NoTrapAfterNoreturn = true; } TargetTransformInfo |