@@ -541,8 +541,8 @@ struct BoxProcHostOpConversion : public FIROpConversion<fir::BoxProcHostOp> {
541
541
mlir::LogicalResult
542
542
matchAndRewrite (fir::BoxProcHostOp boxprochost, OpAdaptor adaptor,
543
543
mlir::ConversionPatternRewriter &rewriter) const override {
544
- return rewriter. notifyMatchFailure (
545
- boxprochost, " fir.boxproc_host codegen is not implemented yet " );
544
+ TODO (boxprochost. getLoc (), " fir.boxproc_host codegen " );
545
+ return failure ( );
546
546
}
547
547
};
548
548
@@ -783,8 +783,8 @@ struct DispatchOpConversion : public FIROpConversion<fir::DispatchOp> {
783
783
mlir::LogicalResult
784
784
matchAndRewrite (fir::DispatchOp dispatch, OpAdaptor adaptor,
785
785
mlir::ConversionPatternRewriter &rewriter) const override {
786
- return rewriter. notifyMatchFailure (
787
- dispatch, " fir.dispatch codegen is not implemented yet " );
786
+ TODO (dispatch. getLoc (), " fir.dispatch codegen " );
787
+ return failure ( );
788
788
}
789
789
};
790
790
@@ -797,8 +797,8 @@ struct DispatchTableOpConversion
797
797
mlir::LogicalResult
798
798
matchAndRewrite (fir::DispatchTableOp dispTab, OpAdaptor adaptor,
799
799
mlir::ConversionPatternRewriter &rewriter) const override {
800
- return rewriter. notifyMatchFailure (
801
- dispTab, " fir.dispatch_table codegen is not implemented yet " );
800
+ TODO (dispTab. getLoc (), " fir.dispatch_table codegen " );
801
+ return failure ( );
802
802
}
803
803
};
804
804
@@ -810,8 +810,8 @@ struct DTEntryOpConversion : public FIROpConversion<fir::DTEntryOp> {
810
810
mlir::LogicalResult
811
811
matchAndRewrite (fir::DTEntryOp dtEnt, OpAdaptor adaptor,
812
812
mlir::ConversionPatternRewriter &rewriter) const override {
813
- return rewriter. notifyMatchFailure (
814
- dtEnt, " fir.dt_entry codegen is not implemented yet " );
813
+ TODO (dtEnt. getLoc (), " fir.dt_entry codegen " );
814
+ return failure ( );
815
815
}
816
816
};
817
817
@@ -822,8 +822,8 @@ struct GlobalLenOpConversion : public FIROpConversion<fir::GlobalLenOp> {
822
822
mlir::LogicalResult
823
823
matchAndRewrite (fir::GlobalLenOp globalLen, OpAdaptor adaptor,
824
824
mlir::ConversionPatternRewriter &rewriter) const override {
825
- return rewriter. notifyMatchFailure (
826
- globalLen, " fir.global_len codegen is not implemented yet " );
825
+ TODO (globalLen. getLoc (), " fir.global_len codegen " );
826
+ return failure ( );
827
827
}
828
828
};
829
829
@@ -836,8 +836,7 @@ struct LenParamIndexOpConversion
836
836
mlir::LogicalResult
837
837
matchAndRewrite (fir::LenParamIndexOp lenp, OpAdaptor,
838
838
mlir::ConversionPatternRewriter &rewriter) const override {
839
- return rewriter.notifyMatchFailure (
840
- lenp, " fir.len_param_index codegen is not implemented yet" );
839
+ TODO (lenp.getLoc (), " fir.len_param_index codegen" );
841
840
}
842
841
};
843
842
@@ -848,8 +847,8 @@ struct GenTypeDescOpConversion : public FIROpConversion<fir::GenTypeDescOp> {
848
847
mlir::LogicalResult
849
848
matchAndRewrite (fir::GenTypeDescOp gentypedesc, OpAdaptor adaptor,
850
849
mlir::ConversionPatternRewriter &rewriter) const override {
851
- return rewriter. notifyMatchFailure (
852
- gentypedesc, " fir.fir.gentypedesc codegen is not implemented yet " );
850
+ TODO (gentypedesc. getLoc (), " fir.gentypedesc codegen " );
851
+ return failure ( );
853
852
}
854
853
};
855
854
@@ -860,8 +859,8 @@ struct FirEndOpConversion : public FIROpConversion<fir::FirEndOp> {
860
859
mlir::LogicalResult
861
860
matchAndRewrite (fir::FirEndOp firEnd, OpAdaptor,
862
861
mlir::ConversionPatternRewriter &rewriter) const override {
863
- return rewriter. notifyMatchFailure (
864
- firEnd, " fir.end codegen is not implemented yet " );
862
+ TODO (firEnd. getLoc (), " fir.end codegen " );
863
+ return failure ( );
865
864
}
866
865
};
867
866
@@ -1021,11 +1020,11 @@ struct SelectCaseOpConversion : public FIROpConversion<fir::SelectCaseOp> {
1021
1020
unsigned conds = caseOp.getNumConditions ();
1022
1021
llvm::ArrayRef<mlir::Attribute> cases = caseOp.getCases ().getValue ();
1023
1022
// Type can be CHARACTER, INTEGER, or LOGICAL (C1145)
1024
- LLVM_ATTRIBUTE_UNUSED auto ty = caseOp.getSelector ().getType ();
1025
- if (ty.isa <fir::CharacterType>())
1026
- return rewriter. notifyMatchFailure (caseOp,
1027
- " conversion of fir.select_case with "
1028
- " character type not implemented yet " );
1023
+ auto ty = caseOp.getSelector ().getType ();
1024
+ if (ty.isa <fir::CharacterType>()) {
1025
+ TODO (caseOp. getLoc (), " fir.select_case codegen with character type " );
1026
+ return failure ();
1027
+ }
1029
1028
mlir::Value selector = caseOp.getSelector (adaptor.getOperands ());
1030
1029
auto loc = caseOp.getLoc ();
1031
1030
for (unsigned t = 0 ; t != conds; ++t) {
@@ -1182,8 +1181,9 @@ struct SelectTypeOpConversion : public FIROpConversion<fir::SelectTypeOp> {
1182
1181
mlir::LogicalResult
1183
1182
matchAndRewrite (fir::SelectTypeOp select, OpAdaptor adaptor,
1184
1183
mlir::ConversionPatternRewriter &rewriter) const override {
1185
- return rewriter.notifyMatchFailure (
1186
- select, " fir.select_type codegen is not implemented yet" );
1184
+ mlir::emitError (select.getLoc (),
1185
+ " fir.select_type should have already been converted" );
1186
+ return failure ();
1187
1187
}
1188
1188
};
1189
1189
@@ -1254,7 +1254,7 @@ struct ZeroOpConversion : public FIROpConversion<fir::ZeroOp> {
1254
1254
mlir::LogicalResult
1255
1255
matchAndRewrite (fir::ZeroOp zero, OpAdaptor,
1256
1256
mlir::ConversionPatternRewriter &rewriter) const override {
1257
- auto ty = convertType (zero.getType ());
1257
+ mlir::Type ty = convertType (zero.getType ());
1258
1258
if (ty.isa <mlir::LLVM::LLVMPointerType>()) {
1259
1259
rewriter.replaceOpWithNewOp <mlir::LLVM::NullOp>(zero, ty);
1260
1260
} else if (ty.isa <mlir::IntegerType>()) {
@@ -1575,10 +1575,11 @@ struct EmboxOpConversion : public EmboxCommonConversion<fir::EmboxOp> {
1575
1575
/* lenParams=*/ adaptor.getOperands ().drop_front (1 ));
1576
1576
dest = insertBaseAddress (rewriter, embox.getLoc (), dest,
1577
1577
adaptor.getOperands ()[0 ]);
1578
- if (isDerivedTypeWithLenParams (boxTy))
1579
- return rewriter.notifyMatchFailure (
1580
- embox, " fir.embox codegen of derived with length parameters not "
1581
- " implemented yet" );
1578
+ if (isDerivedTypeWithLenParams (boxTy)) {
1579
+ TODO (embox.getLoc (),
1580
+ " fir.embox codegen of derived with length parameters" );
1581
+ return failure ();
1582
+ }
1582
1583
auto result = placeInMemoryIfNotGlobalInit (rewriter, embox.getLoc (), dest);
1583
1584
rewriter.replaceOp (embox, result);
1584
1585
return success ();
@@ -1593,12 +1594,11 @@ struct EmboxProcOpConversion : public FIROpConversion<fir::EmboxProcOp> {
1593
1594
mlir::LogicalResult
1594
1595
matchAndRewrite (fir::EmboxProcOp emboxproc, OpAdaptor adaptor,
1595
1596
mlir::ConversionPatternRewriter &rewriter) const override {
1596
- return rewriter. notifyMatchFailure (
1597
- emboxproc, " fir.emboxproc codegen is not implemented yet " );
1597
+ TODO (emboxproc. getLoc (), " fir.emboxproc codegen " );
1598
+ return failure ( );
1598
1599
}
1599
1600
};
1600
1601
1601
-
1602
1602
// Code shared between insert_value and extract_value Ops.
1603
1603
struct ValueOpCommon {
1604
1604
// Translate the arguments pertaining to any multidimensional array to
@@ -2110,8 +2110,8 @@ struct UnboxProcOpConversion : public FIROpConversion<fir::UnboxProcOp> {
2110
2110
mlir::LogicalResult
2111
2111
matchAndRewrite (fir::UnboxProcOp unboxproc, OpAdaptor adaptor,
2112
2112
mlir::ConversionPatternRewriter &rewriter) const override {
2113
- return rewriter. notifyMatchFailure (
2114
- unboxproc, " fir.unboxproc codegen is not implemented yet " );
2113
+ TODO (unboxproc. getLoc (), " fir.unboxproc codegen " );
2114
+ return failure ( );
2115
2115
}
2116
2116
};
2117
2117
0 commit comments