@@ -1774,12 +1774,13 @@ llvm::LogicalResult fir::CoordinateOp::verify() {
17741774 return emitOpError (" too many operands for len_param_index case" );
17751775 }
17761776 if (eleTy != index.getOnType ())
1777- emitOpError (
1777+ return emitOpError (
17781778 " len_param_index type not compatible with reference type" );
17791779 return mlir::success ();
17801780 } else if (auto index = mlir::dyn_cast<fir::FieldIndexOp>(defOp)) {
17811781 if (eleTy != index.getOnType ())
1782- emitOpError (" field_index type not compatible with reference type" );
1782+ return emitOpError (
1783+ " field_index type not compatible with reference type" );
17831784 if (auto recTy = mlir::dyn_cast<fir::RecordType>(eleTy)) {
17841785 eleTy = recTy.getType (index.getFieldName ());
17851786 continue ;
@@ -3406,26 +3407,30 @@ llvm::LogicalResult fir::SaveResultOp::verify() {
34063407 auto eleTy = resultType;
34073408 if (auto seqTy = mlir::dyn_cast<fir::SequenceType>(resultType)) {
34083409 if (seqTy.getDimension () != shapeTyRank)
3409- emitOpError (" shape operand must be provided and have the value rank "
3410- " when the value is a fir.array" );
3410+ return emitOpError (
3411+ " shape operand must be provided and have the value rank "
3412+ " when the value is a fir.array" );
34113413 eleTy = seqTy.getEleTy ();
34123414 } else {
34133415 if (shapeTyRank != 0 )
3414- emitOpError (
3416+ return emitOpError (
34153417 " shape operand should only be provided if the value is a fir.array" );
34163418 }
34173419
34183420 if (auto recTy = mlir::dyn_cast<fir::RecordType>(eleTy)) {
34193421 if (recTy.getNumLenParams () != getTypeparams ().size ())
3420- emitOpError (" length parameters number must match with the value type "
3421- " length parameters" );
3422+ return emitOpError (
3423+ " length parameters number must match with the value type "
3424+ " length parameters" );
34223425 } else if (auto charTy = mlir::dyn_cast<fir::CharacterType>(eleTy)) {
34233426 if (getTypeparams ().size () > 1 )
3424- emitOpError (" no more than one length parameter must be provided for "
3425- " character value" );
3427+ return emitOpError (
3428+ " no more than one length parameter must be provided for "
3429+ " character value" );
34263430 } else {
34273431 if (!getTypeparams ().empty ())
3428- emitOpError (" length parameters must not be provided for this value type" );
3432+ return emitOpError (
3433+ " length parameters must not be provided for this value type" );
34293434 }
34303435
34313436 return mlir::success ();
0 commit comments