[flang][NFC] Rename IntType to IntegerType.
https://github.com/flang-compiler/f18-llvm-project/pull/413
Differential Revision: https://reviews.llvm.org/D96072
GitOrigin-RevId: ae7e84285fb34e49029f1f131af287b1b3f2d071
diff --git a/include/flang/Optimizer/Dialect/FIROps.td b/include/flang/Optimizer/Dialect/FIROps.td
index 3064379..60beaf8 100644
--- a/include/flang/Optimizer/Dialect/FIROps.td
+++ b/include/flang/Optimizer/Dialect/FIROps.td
@@ -34,7 +34,7 @@
"FIR character type">;
def fir_ComplexType : Type<CPred<"$_self.isa<fir::ComplexType>()">,
"FIR complex type">;
-def fir_IntegerType : Type<CPred<"$_self.isa<fir::IntType>()">,
+def fir_IntegerType : Type<CPred<"$_self.isa<fir::IntegerType>()">,
"FIR integer type">;
def fir_LogicalType : Type<CPred<"$_self.isa<fir::LogicalType>()">,
"FIR logical type">;
@@ -709,7 +709,7 @@
let verifier = [{
if (!(getSelector().getType().isa<mlir::IntegerType>() ||
getSelector().getType().isa<mlir::IndexType>() ||
- getSelector().getType().isa<fir::IntType>()))
+ getSelector().getType().isa<fir::IntegerType>()))
return emitOpError("must be an integer");
auto cases = (*this)->getAttrOfType<mlir::ArrayAttr>(getCasesAttr()).getValue();
auto count = getNumDest();
@@ -835,7 +835,7 @@
let verifier = [{
if (!(getSelector().getType().isa<mlir::IntegerType>() ||
getSelector().getType().isa<mlir::IndexType>() ||
- getSelector().getType().isa<fir::IntType>() ||
+ getSelector().getType().isa<fir::IntegerType>() ||
getSelector().getType().isa<fir::LogicalType>() ||
getSelector().getType().isa<fir::CharacterType>()))
return emitOpError("must be an integer, character, or logical");
@@ -2564,7 +2564,7 @@
def FortranTypeAttr : Attr<And<[CPred<"$_self.isa<TypeAttr>()">,
Or<[CPred<"$_self.cast<TypeAttr>().getValue().isa<fir::CharacterType>()">,
CPred<"$_self.cast<TypeAttr>().getValue().isa<fir::ComplexType>()">,
- CPred<"$_self.cast<TypeAttr>().getValue().isa<fir::IntType>()">,
+ CPred<"$_self.cast<TypeAttr>().getValue().isa<fir::IntegerType>()">,
CPred<"$_self.cast<TypeAttr>().getValue().isa<fir::LogicalType>()">,
CPred<"$_self.cast<TypeAttr>().getValue().isa<fir::RealType>()">,
CPred<"$_self.cast<TypeAttr>().getValue().isa<fir::RecordType>()">]>]>,
diff --git a/include/flang/Optimizer/Dialect/FIRType.h b/include/flang/Optimizer/Dialect/FIRType.h
index 2a77d53..086519d 100644
--- a/include/flang/Optimizer/Dialect/FIRType.h
+++ b/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<IntType, mlir::Type, detail::IntTypeStorage> {
+class IntegerType : public mlir::Type::TypeBase<fir::IntegerType, mlir::Type,
+ detail::IntegerTypeStorage> {
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<mlir::IndexType>() || t.isa<mlir::IntegerType>() ||
- t.isa<fir::IntType>();
+ t.isa<fir::IntegerType>();
}
/// Is `t` a FIR or MLIR Complex type?
diff --git a/lib/Optimizer/Dialect/FIRDialect.cpp b/lib/Optimizer/Dialect/FIRDialect.cpp
index 8957bb7..66fae23 100644
--- a/lib/Optimizer/Dialect/FIRDialect.cpp
+++ b/lib/Optimizer/Dialect/FIRDialect.cpp
@@ -16,9 +16,9 @@
fir::FIROpsDialect::FIROpsDialect(mlir::MLIRContext *ctx)
: mlir::Dialect("fir", ctx, mlir::TypeID::get<FIROpsDialect>()) {
addTypes<BoxType, BoxCharType, BoxProcType, CharacterType, fir::ComplexType,
- DimsType, FieldType, HeapType, IntType, LenType, LogicalType,
- PointerType, RealType, RecordType, ReferenceType, SequenceType,
- TypeDescType>();
+ DimsType, FieldType, HeapType, fir::IntegerType, LenType,
+ LogicalType, PointerType, RealType, RecordType, ReferenceType,
+ SequenceType, TypeDescType>();
addAttributes<ClosedIntervalAttr, ExactTypeAttr, LowerBoundAttr,
PointIntervalAttr, RealAttr, SubclassAttr, UpperBoundAttr>();
addOperations<
diff --git a/lib/Optimizer/Dialect/FIROps.cpp b/lib/Optimizer/Dialect/FIROps.cpp
index 7b0d7a1..e1658fd 100644
--- a/lib/Optimizer/Dialect/FIROps.cpp
+++ b/lib/Optimizer/Dialect/FIROps.cpp
@@ -337,7 +337,7 @@
bool fir::ConvertOp::isIntegerCompatible(mlir::Type ty) {
return ty.isa<mlir::IntegerType>() || ty.isa<mlir::IndexType>() ||
- ty.isa<fir::IntType>() || ty.isa<fir::LogicalType>() ||
+ ty.isa<fir::IntegerType>() || ty.isa<fir::LogicalType>() ||
ty.isa<fir::CharacterType>();
}
@@ -996,7 +996,7 @@
template <typename A, typename... AdditionalArgs>
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();
diff --git a/lib/Optimizer/Dialect/FIRType.cpp b/lib/Optimizer/Dialect/FIRType.cpp
index 65c5476..3393cb9 100644
--- a/lib/Optimizer/Dialect/FIRType.cpp
+++ b/lib/Optimizer/Dialect/FIRType.cpp
@@ -107,8 +107,8 @@
}
// `int` `<` kind `>`
-IntType parseInteger(mlir::DialectAsmParser &parser) {
- return parseKindSingleton<IntType>(parser);
+fir::IntegerType parseInteger(mlir::DialectAsmParser &parser) {
+ return parseKindSingleton<fir::IntegerType>(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<mlir::IntegerType>() || ty.isa<fir::IntType>();
+ return ty.isa<mlir::IntegerType>() || ty.isa<fir::IntegerType>();
}
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<IntTypeStorage>();
- return new (storage) IntTypeStorage{kind};
+ static IntegerTypeStorage *construct(mlir::TypeStorageAllocator &allocator,
+ KindTy kind) {
+ auto *storage = allocator.allocate<IntegerTypeStorage>();
+ 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<fir::IntType>()) {
+ if (auto type = ty.dyn_cast<fir::IntegerType>()) {
os << "int<" << type.getFKind() << '>';
return;
}