@@ -655,7 +655,7 @@ LogicalResult cir::CastOp::verify() {
655
655
auto resComplexTy = mlir::dyn_cast<cir::ComplexType>(resType);
656
656
if (!resComplexTy)
657
657
return emitOpError () << " requires !cir.complex type for result" ;
658
- if (srcType != resComplexTy.getElementTy ())
658
+ if (srcType != resComplexTy.getElementType ())
659
659
return emitOpError () << " requires source type match result element type" ;
660
660
return success ();
661
661
}
@@ -665,7 +665,7 @@ LogicalResult cir::CastOp::verify() {
665
665
auto resComplexTy = mlir::dyn_cast<cir::ComplexType>(resType);
666
666
if (!resComplexTy)
667
667
return emitOpError () << " requires !cir.complex type for result" ;
668
- if (srcType != resComplexTy.getElementTy ())
668
+ if (srcType != resComplexTy.getElementType ())
669
669
return emitOpError () << " requires source type match result element type" ;
670
670
return success ();
671
671
}
@@ -675,7 +675,7 @@ LogicalResult cir::CastOp::verify() {
675
675
return emitOpError () << " requires !cir.complex type for source" ;
676
676
if (!mlir::isa<cir::CIRFPTypeInterface>(resType))
677
677
return emitOpError () << " requires !cir.float type for result" ;
678
- if (srcComplexTy.getElementTy () != resType)
678
+ if (srcComplexTy.getElementType () != resType)
679
679
return emitOpError () << " requires source element type match result type" ;
680
680
return success ();
681
681
}
@@ -685,71 +685,66 @@ LogicalResult cir::CastOp::verify() {
685
685
return emitOpError () << " requires !cir.complex type for source" ;
686
686
if (!mlir::isa<cir::IntType>(resType))
687
687
return emitOpError () << " requires !cir.int type for result" ;
688
- if (srcComplexTy.getElementTy () != resType)
688
+ if (srcComplexTy.getElementType () != resType)
689
689
return emitOpError () << " requires source element type match result type" ;
690
690
return success ();
691
691
}
692
692
case cir::CastKind::float_complex_to_bool: {
693
693
auto srcComplexTy = mlir::dyn_cast<cir::ComplexType>(srcType);
694
- if (!srcComplexTy ||
695
- !mlir::isa<cir::CIRFPTypeInterface>(srcComplexTy.getElementTy ()))
694
+ if (!srcComplexTy || !srcComplexTy.isFloatingPointComplex ())
696
695
return emitOpError ()
697
- << " requires !cir.complex<!cir.float> type for source" ;
696
+ << " requires floating point !cir.complex type for source" ;
698
697
if (!mlir::isa<cir::BoolType>(resType))
699
698
return emitOpError () << " requires !cir.bool type for result" ;
700
699
return success ();
701
700
}
702
701
case cir::CastKind::int_complex_to_bool: {
703
702
auto srcComplexTy = mlir::dyn_cast<cir::ComplexType>(srcType);
704
- if (!srcComplexTy || !mlir::isa<cir::IntType>( srcComplexTy.getElementTy () ))
703
+ if (!srcComplexTy || !srcComplexTy.isIntegerComplex ( ))
705
704
return emitOpError ()
706
- << " requires !cir.complex<!cir.float> type for source" ;
705
+ << " requires floating point !cir.complex type for source" ;
707
706
if (!mlir::isa<cir::BoolType>(resType))
708
707
return emitOpError () << " requires !cir.bool type for result" ;
709
708
return success ();
710
709
}
711
710
case cir::CastKind::float_complex: {
712
711
auto srcComplexTy = mlir::dyn_cast<cir::ComplexType>(srcType);
713
- if (!srcComplexTy ||
714
- !mlir::isa<cir::CIRFPTypeInterface>(srcComplexTy.getElementTy ()))
712
+ if (!srcComplexTy || !srcComplexTy.isFloatingPointComplex ())
715
713
return emitOpError ()
716
- << " requires !cir.complex<!cir.float> type for source" ;
714
+ << " requires floating point !cir.complex type for source" ;
717
715
auto resComplexTy = mlir::dyn_cast<cir::ComplexType>(resType);
718
- if (!resComplexTy ||
719
- !mlir::isa<cir::CIRFPTypeInterface>(resComplexTy.getElementTy ()))
716
+ if (!resComplexTy || !resComplexTy.isFloatingPointComplex ())
720
717
return emitOpError ()
721
- << " requires !cir.complex<!cir.float> type for result" ;
718
+ << " requires floating point !cir.complex type for result" ;
722
719
return success ();
723
720
}
724
721
case cir::CastKind::float_complex_to_int_complex: {
725
722
auto srcComplexTy = mlir::dyn_cast<cir::ComplexType>(srcType);
726
- if (!srcComplexTy ||
727
- !mlir::isa<cir::CIRFPTypeInterface>(srcComplexTy.getElementTy ()))
723
+ if (!srcComplexTy || !srcComplexTy.isFloatingPointComplex ())
728
724
return emitOpError ()
729
- << " requires !cir.complex<!cir.float> type for source" ;
725
+ << " requires floating point !cir.complex type for source" ;
730
726
auto resComplexTy = mlir::dyn_cast<cir::ComplexType>(resType);
731
- if (!resComplexTy || !mlir::isa<cir::IntType>( resComplexTy.getElementTy () ))
732
- return emitOpError () << " requires !cir.complex<!cir.int> type for result" ;
727
+ if (!resComplexTy || !resComplexTy.isIntegerComplex ( ))
728
+ return emitOpError () << " requires integer !cir.complex type for result" ;
733
729
return success ();
734
730
}
735
731
case cir::CastKind::int_complex: {
736
732
auto srcComplexTy = mlir::dyn_cast<cir::ComplexType>(srcType);
737
- if (!srcComplexTy || !mlir::isa<cir::IntType>( srcComplexTy.getElementTy () ))
738
- return emitOpError () << " requires !cir.complex<!cir.int> type for source" ;
733
+ if (!srcComplexTy || !srcComplexTy.isIntegerComplex ( ))
734
+ return emitOpError () << " requires integer !cir.complex type for source" ;
739
735
auto resComplexTy = mlir::dyn_cast<cir::ComplexType>(resType);
740
- if (!resComplexTy || !mlir::isa<cir::IntType>( resComplexTy.getElementTy () ))
741
- return emitOpError () << " requires !cir.complex<!cir.int> type for result" ;
736
+ if (!resComplexTy || !resComplexTy.isIntegerComplex ( ))
737
+ return emitOpError () << " requires integer !cir.complex type for result" ;
742
738
return success ();
743
739
}
744
740
case cir::CastKind::int_complex_to_float_complex: {
745
741
auto srcComplexTy = mlir::dyn_cast<cir::ComplexType>(srcType);
746
- if (!srcComplexTy || !mlir::isa<cir::IntType>( srcComplexTy.getElementTy () ))
747
- return emitOpError () << " requires !cir.complex<!cir.int> type for source" ;
742
+ if (!srcComplexTy || !srcComplexTy.isIntegerComplex ( ))
743
+ return emitOpError () << " requires integer !cir.complex type for source" ;
748
744
auto resComplexTy = mlir::dyn_cast<cir::ComplexType>(resType);
749
- if (!resComplexTy ||
750
- !mlir::isa<cir::CIRFPTypeInterface>(resComplexTy.getElementTy ()))
745
+ if (!resComplexTy || !resComplexTy.isFloatingPointComplex ())
751
746
return emitOpError ()
752
- << " requires !cir.complex<!cir.float> type for result" ;
747
+ << " requires floating point !cir.complex type for result" ;
753
748
return success ();
754
749
}
755
750
case cir::CastKind::member_ptr_to_bool: {
@@ -912,7 +907,7 @@ LogicalResult cir::DerivedMethodOp::verify() {
912
907
// ===----------------------------------------------------------------------===//
913
908
914
909
LogicalResult cir::ComplexCreateOp::verify () {
915
- if (getType ().getElementTy () != getReal ().getType ()) {
910
+ if (getType ().getElementType () != getReal ().getType ()) {
916
911
emitOpError ()
917
912
<< " operand type of cir.complex.create does not match its result type" ;
918
913
return failure ();
@@ -945,7 +940,7 @@ OpFoldResult cir::ComplexCreateOp::fold(FoldAdaptor adaptor) {
945
940
// ===----------------------------------------------------------------------===//
946
941
947
942
LogicalResult cir::ComplexRealOp::verify () {
948
- if (getType () != getOperand ().getType ().getElementTy ()) {
943
+ if (getType () != getOperand ().getType ().getElementType ()) {
949
944
emitOpError () << " cir.complex.real result type does not match operand type" ;
950
945
return failure ();
951
946
}
@@ -960,7 +955,7 @@ OpFoldResult cir::ComplexRealOp::fold(FoldAdaptor adaptor) {
960
955
}
961
956
962
957
LogicalResult cir::ComplexImagOp::verify () {
963
- if (getType () != getOperand ().getType ().getElementTy ()) {
958
+ if (getType () != getOperand ().getType ().getElementType ()) {
964
959
emitOpError () << " cir.complex.imag result type does not match operand type" ;
965
960
return failure ();
966
961
}
@@ -984,7 +979,7 @@ LogicalResult cir::ComplexRealPtrOp::verify() {
984
979
auto operandPointeeTy =
985
980
mlir::cast<cir::ComplexType>(operandPtrTy.getPointee ());
986
981
987
- if (resultPointeeTy != operandPointeeTy.getElementTy ()) {
982
+ if (resultPointeeTy != operandPointeeTy.getElementType ()) {
988
983
emitOpError ()
989
984
<< " cir.complex.real_ptr result type does not match operand type" ;
990
985
return failure ();
@@ -999,7 +994,7 @@ LogicalResult cir::ComplexImagPtrOp::verify() {
999
994
auto operandPointeeTy =
1000
995
mlir::cast<cir::ComplexType>(operandPtrTy.getPointee ());
1001
996
1002
- if (resultPointeeTy != operandPointeeTy.getElementTy ()) {
997
+ if (resultPointeeTy != operandPointeeTy.getElementType ()) {
1003
998
emitOpError ()
1004
999
<< " cir.complex.imag_ptr result type does not match operand type" ;
1005
1000
return failure ();
0 commit comments