Skip to content

Commit eb39f24

Browse files
committed
[𝘀𝗽𝗿] changes to main this commit is based on
Created using spr 1.3.4 [skip ci]
1 parent 102c15a commit eb39f24

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3351,13 +3351,29 @@ void SelectionDAGBuilder::visitInvoke(const InvokeInst &I) {
33513351

33523352
// Deopt and ptrauth bundles are lowered in helper functions, and we don't
33533353
// have to do anything here to lower funclet bundles.
3354-
if (I.hasOperandBundlesOtherThan(
3355-
{LLVMContext::OB_deopt, LLVMContext::OB_gc_transition,
3356-
LLVMContext::OB_gc_live, LLVMContext::OB_funclet,
3357-
LLVMContext::OB_cfguardtarget, LLVMContext::OB_ptrauth,
3358-
LLVMContext::OB_clang_arc_attachedcall}))
3354+
constexpr std::array<uint32_t, 7> kAllowedBundles = {
3355+
LLVMContext::OB_deopt,
3356+
LLVMContext::OB_gc_transition,
3357+
LLVMContext::OB_gc_live,
3358+
LLVMContext::OB_funclet,
3359+
LLVMContext::OB_cfguardtarget,
3360+
LLVMContext::OB_ptrauth,
3361+
LLVMContext::OB_clang_arc_attachedcall};
3362+
if (I.hasOperandBundlesOtherThan(kAllowedBundles)) {
3363+
std::string Error;
3364+
for (unsigned i = 0, e = I.getNumOperandBundles(); i != e; ++i) {
3365+
OperandBundleUse U = I.getOperandBundleAt(i);
3366+
bool First = true;
3367+
if (is_contained(kAllowedBundles, U.getTagID()))
3368+
continue;
3369+
if (!First)
3370+
Error += ", ";
3371+
First = false;
3372+
Error += U.getTagName();
3373+
}
33593374
reportFatalUsageError(
3360-
"cannot lower invokes with arbitrary operand bundles!");
3375+
Twine("cannot lower invokes with arbitrary operand bundles: ", Error));
3376+
}
33613377

33623378
const Value *Callee(I.getCalledOperand());
33633379
const Function *Fn = dyn_cast<Function>(Callee);

llvm/test/CodeGen/X86/invalid-operand-bundle-invoke.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: not llc -mtriple=x86_64-unknown-linux-gnu < %s 2>&1 | FileCheck %s
22

3-
; CHECK: LLVM ERROR: cannot lower invokes with arbitrary operand bundles!
3+
; CHECK: LLVM ERROR: cannot lower invokes with arbitrary operand bundles: foo
44

55
declare void @g()
66
declare i32 @__gxx_personality_v0(...)

0 commit comments

Comments
 (0)