[flang][NFC] Rename IntType to IntegerType.

https://github.com/flang-compiler/f18-llvm-project/pull/413

Differential Revision: https://reviews.llvm.org/D96072
This commit is contained in:
Eric Schweitz 2021-02-04 12:13:33 -08:00
parent e8a2b7c915
commit ae7e84285f
5 changed files with 27 additions and 27 deletions

View File

@ -34,7 +34,7 @@ def fir_CharacterType : Type<CPred<"$_self.isa<fir::CharacterType>()">,
"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 @@ class fir_IntegralSwitchTerminatorOp<string mnemonic,
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 @@ def fir_SelectCaseOp : fir_SwitchTerminatorOp<"select_case"> {
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 fir_ConvertOp : fir_OneResultOp<"convert", [NoSideEffect]> {
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>()">]>]>,

View File

@ -43,7 +43,7 @@ struct ComplexTypeStorage;
struct DimsTypeStorage;
struct FieldTypeStorage;
struct HeapTypeStorage;
struct IntTypeStorage;
struct IntegerTypeStorage;
struct LenTypeStorage;
struct LogicalTypeStorage;
struct PointerTypeStorage;
@ -119,11 +119,11 @@ public:
/// 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 @@ inline bool isa_real(mlir::Type t) {
/// 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?

View File

@ -16,9 +16,9 @@ using namespace fir;
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<

View File

@ -337,7 +337,7 @@ mlir::OpFoldResult fir::ConvertOp::fold(llvm::ArrayRef<mlir::Attribute> opnds) {
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 @@ static constexpr llvm::StringRef getTargetOffsetAttr() {
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();

View File

@ -107,8 +107,8 @@ HeapType parseHeap(mlir::DialectAsmParser &parser, mlir::Location loc) {
}
// `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 @@ SequenceType parseSequence(mlir::DialectAsmParser &parser, mlir::Location) {
/// 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 @@ private:
};
/// `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,
static IntegerTypeStorage *construct(mlir::TypeStorageAllocator &allocator,
KindTy kind) {
auto *storage = allocator.allocate<IntTypeStorage>();
return new (storage) IntTypeStorage{kind};
auto *storage = allocator.allocate<IntegerTypeStorage>();
return new (storage) IntegerTypeStorage{kind};
}
KindTy getFKind() const { return kind; }
@ -488,8 +488,8 @@ protected:
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 @@ int fir::LogicalType::getFKind() const { return getImpl()->getFKind(); }
// 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 @@ void fir::printFirType(FIROpsDialect *, mlir::Type ty,
os << '>';
return;
}
if (auto type = ty.dyn_cast<fir::IntType>()) {
if (auto type = ty.dyn_cast<fir::IntegerType>()) {
os << "int<" << type.getFKind() << '>';
return;
}