Index: flang/include/flang/Optimizer/Dialect/FIROps.td =================================================================== --- flang/include/flang/Optimizer/Dialect/FIROps.td +++ flang/include/flang/Optimizer/Dialect/FIROps.td @@ -34,7 +34,7 @@ "FIR character type">; def fir_ComplexType : Type()">, "FIR complex type">; -def fir_IntegerType : Type()">, +def fir_IntegerType : Type()">, "FIR integer type">; def fir_LogicalType : Type()">, "FIR logical type">; @@ -709,7 +709,7 @@ let verifier = [{ if (!(getSelector().getType().isa() || getSelector().getType().isa() || - getSelector().getType().isa())) + getSelector().getType().isa())) return emitOpError("must be an integer"); auto cases = (*this)->getAttrOfType(getCasesAttr()).getValue(); auto count = getNumDest(); @@ -835,7 +835,7 @@ let verifier = [{ if (!(getSelector().getType().isa() || getSelector().getType().isa() || - getSelector().getType().isa() || + getSelector().getType().isa() || getSelector().getType().isa() || getSelector().getType().isa())) return emitOpError("must be an integer, character, or logical"); @@ -2564,7 +2564,7 @@ def FortranTypeAttr : Attr()">, Or<[CPred<"$_self.cast().getValue().isa()">, CPred<"$_self.cast().getValue().isa()">, - CPred<"$_self.cast().getValue().isa()">, + CPred<"$_self.cast().getValue().isa()">, CPred<"$_self.cast().getValue().isa()">, CPred<"$_self.cast().getValue().isa()">, CPred<"$_self.cast().getValue().isa()">]>]>, Index: flang/include/flang/Optimizer/Dialect/FIRType.h =================================================================== --- flang/include/flang/Optimizer/Dialect/FIRType.h +++ flang/include/flang/Optimizer/Dialect/FIRType.h @@ -43,7 +43,7 @@ struct DimsTypeStorage; struct FieldTypeStorage; struct HeapTypeStorage; -struct IntTypeStorage; +struct IntegerTypeStorage; struct LenTypeStorage; struct LogicalTypeStorage; struct PointerTypeStorage; @@ -119,11 +119,11 @@ /// Model of a Fortran INTEGER intrinsic type, including the KIND type /// parameter. -class IntType - : public mlir::Type::TypeBase { +class IntegerType : public mlir::Type::TypeBase { public: using Base::Base; - static IntType get(mlir::MLIRContext *ctxt, KindTy kind); + static fir::IntegerType get(mlir::MLIRContext *ctxt, KindTy kind); KindTy getFKind() const; }; @@ -388,7 +388,7 @@ /// Is `t` an integral type? inline bool isa_integer(mlir::Type t) { return t.isa() || t.isa() || - t.isa(); + t.isa(); } /// Is `t` a FIR or MLIR Complex type? Index: flang/lib/Optimizer/Dialect/FIRDialect.cpp =================================================================== --- flang/lib/Optimizer/Dialect/FIRDialect.cpp +++ flang/lib/Optimizer/Dialect/FIRDialect.cpp @@ -16,9 +16,9 @@ fir::FIROpsDialect::FIROpsDialect(mlir::MLIRContext *ctx) : mlir::Dialect("fir", ctx, mlir::TypeID::get()) { addTypes(); + DimsType, FieldType, HeapType, fir::IntegerType, LenType, + LogicalType, PointerType, RealType, RecordType, ReferenceType, + SequenceType, TypeDescType>(); addAttributes(); addOperations< Index: flang/lib/Optimizer/Dialect/FIROps.cpp =================================================================== --- flang/lib/Optimizer/Dialect/FIROps.cpp +++ flang/lib/Optimizer/Dialect/FIROps.cpp @@ -337,7 +337,7 @@ bool fir::ConvertOp::isIntegerCompatible(mlir::Type ty) { return ty.isa() || ty.isa() || - ty.isa() || ty.isa() || + ty.isa() || ty.isa() || ty.isa(); } @@ -996,7 +996,7 @@ template static A getSubOperands(unsigned pos, A allArgs, mlir::DenseIntElementsAttr ranges, - AdditionalArgs &&... additionalArgs) { + AdditionalArgs &&...additionalArgs) { unsigned start = 0; for (unsigned i = 0; i < pos; ++i) start += (*(ranges.begin() + i)).getZExtValue(); Index: flang/lib/Optimizer/Dialect/FIRType.cpp =================================================================== --- flang/lib/Optimizer/Dialect/FIRType.cpp +++ flang/lib/Optimizer/Dialect/FIRType.cpp @@ -107,8 +107,8 @@ } // `int` `<` kind `>` -IntType parseInteger(mlir::DialectAsmParser &parser) { - return parseKindSingleton(parser); +fir::IntegerType parseInteger(mlir::DialectAsmParser &parser) { + return parseKindSingleton(parser); } // `len` @@ -181,7 +181,7 @@ /// Is `ty` a standard or FIR integer type? static bool isaIntegerType(mlir::Type ty) { // TODO: why aren't we using isa_integer? investigatation required. - return ty.isa() || ty.isa(); + return ty.isa() || ty.isa(); } bool verifyRecordMemberType(mlir::Type ty) { @@ -469,17 +469,17 @@ }; /// `INTEGER` storage -struct IntTypeStorage : public mlir::TypeStorage { +struct IntegerTypeStorage : public mlir::TypeStorage { using KeyTy = KindTy; static unsigned hashKey(const KeyTy &key) { return llvm::hash_combine(key); } bool operator==(const KeyTy &key) const { return key == getFKind(); } - static IntTypeStorage *construct(mlir::TypeStorageAllocator &allocator, - KindTy kind) { - auto *storage = allocator.allocate(); - return new (storage) IntTypeStorage{kind}; + static IntegerTypeStorage *construct(mlir::TypeStorageAllocator &allocator, + KindTy kind) { + auto *storage = allocator.allocate(); + return new (storage) IntegerTypeStorage{kind}; } KindTy getFKind() const { return kind; } @@ -488,8 +488,8 @@ KindTy kind; private: - IntTypeStorage() = delete; - explicit IntTypeStorage(KindTy kind) : kind{kind} {} + IntegerTypeStorage() = delete; + explicit IntegerTypeStorage(KindTy kind) : kind{kind} {} }; /// `COMPLEX` storage @@ -901,11 +901,11 @@ // INTEGER -IntType fir::IntType::get(mlir::MLIRContext *ctxt, KindTy kind) { +fir::IntegerType fir::IntegerType::get(mlir::MLIRContext *ctxt, KindTy kind) { return Base::get(ctxt, kind); } -int fir::IntType::getFKind() const { return getImpl()->getFKind(); } +int fir::IntegerType::getFKind() const { return getImpl()->getFKind(); } // COMPLEX @@ -1290,7 +1290,7 @@ os << '>'; return; } - if (auto type = ty.dyn_cast()) { + if (auto type = ty.dyn_cast()) { os << "int<" << type.getFKind() << '>'; return; }