diff options
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index ecd1ff87e7fb..3a6fd6283dae 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -3351,13 +3351,29 @@ void SelectionDAGBuilder::visitInvoke(const InvokeInst &I) { // Deopt and ptrauth bundles are lowered in helper functions, and we don't // have to do anything here to lower funclet bundles. - if (I.hasOperandBundlesOtherThan( - {LLVMContext::OB_deopt, LLVMContext::OB_gc_transition, - LLVMContext::OB_gc_live, LLVMContext::OB_funclet, - LLVMContext::OB_cfguardtarget, LLVMContext::OB_ptrauth, - LLVMContext::OB_clang_arc_attachedcall})) + constexpr std::array<uint32_t, 7> kAllowedBundles = { + LLVMContext::OB_deopt, + LLVMContext::OB_gc_transition, + LLVMContext::OB_gc_live, + LLVMContext::OB_funclet, + LLVMContext::OB_cfguardtarget, + LLVMContext::OB_ptrauth, + LLVMContext::OB_clang_arc_attachedcall}; + if (I.hasOperandBundlesOtherThan(kAllowedBundles)) { + std::string Error; + for (unsigned i = 0, e = I.getNumOperandBundles(); i != e; ++i) { + OperandBundleUse U = I.getOperandBundleAt(i); + bool First = true; + if (is_contained(kAllowedBundles, U.getTagID())) + continue; + if (!First) + Error += ", "; + First = false; + Error += U.getTagName(); + } reportFatalUsageError( - "cannot lower invokes with arbitrary operand bundles!"); + Twine("cannot lower invokes with arbitrary operand bundles: ", Error)); + } const Value *Callee(I.getCalledOperand()); const Function *Fn = dyn_cast<Function>(Callee); |
