================ @@ -1038,6 +1038,37 @@ mlir::LogicalResult CIRToLLVMGlobalOpLowering::matchAndRewrite( return mlir::success(); } +mlir::LogicalResult CIRToLLVMSwitchFlatOpLowering::matchAndRewrite( + cir::SwitchFlatOp op, OpAdaptor adaptor, + mlir::ConversionPatternRewriter &rewriter) const { + + llvm::SmallVector<mlir::APInt, 8> caseValues; + if (op.getCaseValues()) { + for (mlir::Attribute val : op.getCaseValues()) { + auto intAttr = dyn_cast<cir::IntAttr>(val); + caseValues.push_back(intAttr.getValue()); + } + } + + llvm::SmallVector<mlir::Block *, 8> caseDestinations; + llvm::SmallVector<mlir::ValueRange, 8> caseOperands; + + for (mlir::Block *x : op.getCaseDestinations()) { + caseDestinations.push_back(x); + } + + for (mlir::OperandRange x : op.getCaseOperands()) { ---------------- andykaylor wrote:
No braces https://github.com/llvm/llvm-project/pull/140425 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits