@@ -3351,13 +3351,30 @@ void SelectionDAGBuilder::visitInvoke(const InvokeInst &I) {
3351
3351
3352
3352
// Deopt and ptrauth bundles are lowered in helper functions, and we don't
3353
3353
// 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, LLVMContext::OB_kcfi}))
3354
+ constexpr uint32_t 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
+ LLVMContext::OB_kcfi};
3363
+ if (I.hasOperandBundlesOtherThan (kAllowedBundles )) {
3364
+ std::string Error;
3365
+ for (unsigned i = 0 , e = I.getNumOperandBundles (); i != e; ++i) {
3366
+ OperandBundleUse U = I.getOperandBundleAt (i);
3367
+ bool First = true ;
3368
+ if (is_contained (kAllowedBundles , U.getTagID ()))
3369
+ continue ;
3370
+ if (!First)
3371
+ Error += " , " ;
3372
+ First = false ;
3373
+ Error += U.getTagName ();
3374
+ }
3359
3375
reportFatalUsageError (
3360
- " cannot lower invokes with arbitrary operand bundles!" );
3376
+ Twine (" cannot lower invokes with arbitrary operand bundles: " , Error));
3377
+ }
3361
3378
3362
3379
const Value *Callee (I.getCalledOperand ());
3363
3380
const Function *Fn = dyn_cast<Function>(Callee);
0 commit comments