aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOutliner.cpp
diff options
context:
space:
mode:
authorJoshua Cao <cao.joshua@yahoo.com>2024-06-02 15:02:11 -0700
committerGitHub <noreply@github.com>2024-06-02 15:02:11 -0700
commitab08df2292334d4980b3e81829a20904e59e13c9 (patch)
tree76c9b891ac11d9c031659ea6282714ec086db888 /llvm/lib/CodeGen/MachineOutliner.cpp
parent4ce65423be0ba1d90c11b6a79981d6314e1cf36d (diff)
downloadllvm-ab08df2292334d4980b3e81829a20904e59e13c9.zip
llvm-ab08df2292334d4980b3e81829a20904e59e13c9.tar.gz
llvm-ab08df2292334d4980b3e81829a20904e59e13c9.tar.bz2
[IR] Do not set `none` for function uwtable (#93387)
This avoids the pitfall where we set the uwtable to none: ``` func.setUWTableKind(llvm::UWTableKind::None) ``` `Attribute::getAsString()` would see an unknown attribute and fail an assertion. In this patch, we assert that we do not see a None uwtable kind. This also skips the check of `UWTableKind::Async`. It is dominated by the check of `UWTableKind::Default`, which has the same enum value (nfc).
Diffstat (limited to 'llvm/lib/CodeGen/MachineOutliner.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOutliner.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp
index dc2f5ef..f174dd8 100644
--- a/llvm/lib/CodeGen/MachineOutliner.cpp
+++ b/llvm/lib/CodeGen/MachineOutliner.cpp
@@ -717,8 +717,7 @@ MachineFunction *MachineOutliner::createOutlinedFunction(
[](UWTableKind K, const outliner::Candidate &C) {
return std::max(K, C.getMF()->getFunction().getUWTableKind());
});
- if (UW != UWTableKind::None)
- F->setUWTableKind(UW);
+ F->setUWTableKind(UW);
BasicBlock *EntryBB = BasicBlock::Create(C, "entry", F);
IRBuilder<> Builder(EntryBB);