Skip to content

Commit 08e9e40

Browse files
committed
Fixed flang build.
1 parent 0408b7c commit 08e9e40

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flang/lib/Optimizer/Transforms/ControlFlowConverter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ class CfgIfConv : public mlir::OpRewritePattern<fir::IfOp> {
215215
auto branchOp = rewriter.create<mlir::cf::CondBranchOp>(
216216
loc, ifOp.getCondition(), ifOpBlock, llvm::ArrayRef<mlir::Value>(),
217217
otherwiseBlock, llvm::ArrayRef<mlir::Value>());
218-
if (auto weights = ifOp.getWeights())
218+
llvm::ArrayRef<int32_t> weights = ifOp.getWeights();
219+
if (!weights.empty())
219220
branchOp.setWeights(weights);
220221
rewriter.replaceOp(ifOp, continueBlock->getArguments());
221222
return success();

0 commit comments

Comments
 (0)