Skip to content

Commit 52d813e

Browse files
committed
[fir] Use notifyMatchFailure in fir.zero_bits conversion
Change emitOpError to notifyMatchFailure in conversion pattern. Post-commit change after D113014 Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D113091
1 parent a39eba7 commit 52d813e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

flang/lib/Optimizer/CodeGen/CodeGen.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ struct ZeroOpConversion : public FIROpConversion<fir::ZeroOp> {
196196
zero, ty, mlir::FloatAttr::get(zero.getType(), 0.0));
197197
} else {
198198
// TODO: create ConstantAggregateZero for FIR aggregate/array types.
199-
return zero.emitOpError(
199+
return rewriter.notifyMatchFailure(
200+
zero,
200201
"conversion of fir.zero with aggregate type not implemented yet");
201202
}
202203
return success();

flang/test/Fir/convert-to-llvm-invalid.fir

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// RUN: fir-opt --split-input-file --fir-to-llvm-ir --verify-diagnostics %s
44

55
func @zero_aggregate() {
6-
// expected-error@+2{{'fir.zero_bits' op conversion of fir.zero with aggregate type not implemented yet}}
76
// expected-error@+1{{failed to legalize operation 'fir.zero_bits'}}
87
%a = fir.zero_bits !fir.array<10xf32>
98
return

0 commit comments

Comments
 (0)