[llvm] CodeGen: replace assertions with explicit errors for landinpad lowering (PR #71287)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 14 15:31:25 PST 2023
================
@@ -2795,9 +2795,13 @@ bool IRTranslator::translateLandingPad(const User &U,
MIRBuilder.buildUndef(Undef);
SmallVector<LLT, 2> Tys;
- for (Type *Ty : cast<StructType>(LP.getType())->elements())
- Tys.push_back(getLLTForType(*Ty, *DL));
- assert(Tys.size() == 2 && "Only two-valued landingpads are supported");
+ if (LP.getType()->isStructTy()) {
+ for (Type *Ty : cast<StructType>(LP.getType())->elements())
----------------
arsenm wrote:
dyn_cast instead of pre-check + cast
https://github.com/llvm/llvm-project/pull/71287
More information about the llvm-commits
mailing list