FLANG
FIRType.h
1//===-- Optimizer/Dialect/FIRType.h -- FIR types ----------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Coding style: https://mlir.llvm.org/getting_started/DeveloperGuide/
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef FORTRAN_OPTIMIZER_DIALECT_FIRTYPE_H
14#define FORTRAN_OPTIMIZER_DIALECT_FIRTYPE_H
15
16#include "mlir/IR/BuiltinAttributes.h"
17#include "mlir/IR/BuiltinTypes.h"
18#include "mlir/Interfaces/DataLayoutInterfaces.h"
19#include "llvm/ADT/SmallVector.h"
20#include "llvm/IR/Type.h"
21
22namespace fir {
23class FIROpsDialect;
24class KindMapping;
25using KindTy = unsigned;
26
27namespace detail {
29} // namespace detail
30
31} // namespace fir
32
33//===----------------------------------------------------------------------===//
34// BaseBoxType
35//===----------------------------------------------------------------------===//
36
37namespace fir {
38
40class BaseBoxType : public mlir::Type {
41public:
42 using mlir::Type::Type;
43
45 enum class Attribute { None, Allocatable, Pointer };
46
48 mlir::Type getEleTy() const;
49
53 mlir::Type getBaseAddressType(bool dropHeapOrPtr = false) const;
54
56 mlir::Type unwrapInnerType() const;
57
58 // Get the element type or the fir.array
59 mlir::Type getElementOrSequenceType() const;
60
62 bool isAssumedRank() const;
63
65 bool isPointer() const;
66
68 bool isPointerOrAllocatable() const;
69
71 bool isVolatile() const;
72
74 bool isArray() const;
75
77 bool isCoarray() const;
78
81 BaseBoxType getBoxTypeWithNewShape(mlir::Type shapeMold) const;
82 BaseBoxType getBoxTypeWithNewShape(int rank) const;
83
87 BaseBoxType getBoxTypeWithNewElementType(mlir::Type elementType,
88 bool polymorphic) const;
89
92
94 static bool classof(mlir::Type type);
95};
96
97} // namespace fir
98
99#define GET_TYPEDEF_CLASSES
100#include "flang/Optimizer/Dialect/FIROpsTypes.h.inc"
101
102namespace llvm {
103class raw_ostream;
104class StringRef;
105template <typename>
107class hash_code;
108} // namespace llvm
109
110namespace mlir {
111class DialectAsmParser;
112class DialectAsmPrinter;
113class ComplexType;
114class FloatType;
115class ValueRange;
116} // namespace mlir
117
118namespace fir {
119namespace detail {
120struct RecordTypeStorage;
121} // namespace detail
122
123// These isa_ routines follow the precedent of llvm::isa_or_null<>
124
126bool isa_fir_type(mlir::Type t);
127
129bool isa_std_type(mlir::Type t);
130
132bool isa_fir_or_std_type(mlir::Type t);
133
135inline bool isa_ref_type(mlir::Type t) {
136 return mlir::isa<fir::ReferenceType, fir::PointerType, fir::HeapType,
137 fir::LLVMPointerType>(t);
138}
139
141inline bool isa_box_type(mlir::Type t) {
142 return mlir::isa<fir::BaseBoxType, fir::BoxCharType, fir::BoxProcType>(t);
143}
144
148inline bool isa_passbyref_type(mlir::Type t) {
149 return mlir::isa<fir::ReferenceType, mlir::FunctionType>(t) ||
150 isa_box_type(t);
151}
152
156inline bool conformsWithPassByRef(mlir::Type t) {
157 return isa_ref_type(t) || isa_box_type(t) || mlir::isa<mlir::FunctionType>(t);
158}
159
161inline bool isa_derived(mlir::Type t) { return mlir::isa<fir::RecordType>(t); }
162
164inline bool isa_builtin_event_type(mlir::Type t) {
165 if (auto recTy = mlir::dyn_cast_or_null<fir::RecordType>(t))
166 return recTy.getName().ends_with("T__builtin_event_type");
167 return false;
168}
169
171inline bool isa_builtin_cptr_type(mlir::Type t) {
172 if (auto recTy = mlir::dyn_cast_or_null<fir::RecordType>(t))
173 return recTy.getName().ends_with("T__builtin_c_ptr") ||
174 recTy.getName().ends_with("T__builtin_c_funptr") ||
175 recTy.getName().ends_with("T__builtin_c_devptr");
176 return false;
177}
178
179// Is `t` type(c_devptr)?
180inline bool isa_builtin_c_devptr_type(mlir::Type t) {
181 if (auto recTy = mlir::dyn_cast_or_null<fir::RecordType>(t))
182 return recTy.getName().ends_with("T__builtin_c_devptr");
183 return false;
184}
185
187inline bool isa_builtin_cdevptr_type(mlir::Type t) {
188 if (auto recTy = mlir::dyn_cast_or_null<fir::RecordType>(t))
189 return recTy.getName().ends_with("T__builtin_c_devptr");
190 return false;
191}
192
194inline bool isa_aggregate(mlir::Type t) {
195 return mlir::isa<SequenceType, mlir::TupleType>(t) || fir::isa_derived(t);
196}
197
200mlir::Type dyn_cast_ptrEleTy(mlir::Type t);
201
204mlir::Type dyn_cast_ptrOrBoxEleTy(mlir::Type t);
205
207inline bool isa_real(mlir::Type t) { return mlir::isa<mlir::FloatType>(t); }
208
210inline bool isa_integer(mlir::Type t) {
211 return mlir::isa<mlir::IndexType, mlir::IntegerType, fir::IntegerType>(t);
212}
213
215inline bool isa_vector(mlir::Type t) {
216 return mlir::isa<mlir::VectorType, fir::VectorType>(t);
217}
218
219mlir::Type parseFirType(FIROpsDialect *, mlir::DialectAsmParser &parser);
220
221void printFirType(FIROpsDialect *, mlir::Type ty, mlir::DialectAsmPrinter &p);
222
225void verifyIntegralType(mlir::Type type);
226
228inline bool isa_complex(mlir::Type t) {
229 return mlir::isa<mlir::ComplexType>(t) &&
230 mlir::isa<mlir::FloatType>(
231 mlir::cast<mlir::ComplexType>(t).getElementType());
232}
233
235inline bool isa_char(mlir::Type t) { return mlir::isa<fir::CharacterType>(t); }
236
239inline bool isa_trivial(mlir::Type t) {
240 return isa_integer(t) || isa_real(t) || isa_complex(t) || isa_vector(t) ||
241 mlir::isa<fir::LogicalType>(t);
242}
243
245inline bool isa_char_string(mlir::Type t) {
246 if (auto ct = mlir::dyn_cast_or_null<fir::CharacterType>(t))
247 return ct.getLen() != fir::CharacterType::singleton();
248 return false;
249}
250
256bool isa_unknown_size_box(mlir::Type t);
257
260bool isa_volatile_type(mlir::Type t);
261
263inline bool characterWithDynamicLen(mlir::Type t) {
264 if (auto charTy = mlir::dyn_cast<fir::CharacterType>(t))
265 return charTy.hasDynamicLen();
266 return false;
267}
268
271inline bool sequenceWithNonConstantShape(fir::SequenceType seqTy) {
272 return seqTy.hasUnknownShape() || seqTy.hasDynamicExtents();
273}
274
276bool hasDynamicSize(mlir::Type t);
277
278inline unsigned getRankOfShapeType(mlir::Type t) {
279 if (auto shTy = mlir::dyn_cast<fir::ShapeType>(t))
280 return shTy.getRank();
281 if (auto shTy = mlir::dyn_cast<fir::ShapeShiftType>(t))
282 return shTy.getRank();
283 if (auto shTy = mlir::dyn_cast<fir::ShiftType>(t))
284 return shTy.getRank();
285 return 0;
286}
287
289inline mlir::Type boxMemRefType(fir::BaseBoxType t) {
290 auto eleTy = t.getEleTy();
291 if (!mlir::isa<fir::PointerType, fir::HeapType>(eleTy))
292 eleTy = fir::ReferenceType::get(t);
293 return eleTy;
294}
295
297inline mlir::Type unwrapSequenceType(mlir::Type t) {
298 if (auto seqTy = mlir::dyn_cast<fir::SequenceType>(t))
299 return seqTy.getEleTy();
300 return t;
301}
302
304mlir::Type extractSequenceType(mlir::Type ty);
305
306inline mlir::Type unwrapRefType(mlir::Type t) {
307 if (auto eleTy = dyn_cast_ptrEleTy(t))
308 return eleTy;
309 return t;
310}
311
314inline mlir::Type unwrapPassByRefType(mlir::Type t) {
315 if (auto eleTy = dyn_cast_ptrOrBoxEleTy(t))
316 return eleTy;
317 return t;
318}
319
325mlir::Type getFortranElementType(mlir::Type ty);
326
334mlir::Type unwrapSeqOrBoxedSeqType(mlir::Type ty);
335
339mlir::Type unwrapAllRefAndSeqType(mlir::Type ty);
340
343inline fir::SequenceType unwrapUntilSeqType(mlir::Type t) {
344 while (true) {
345 if (!t)
346 return {};
347 if (auto ty = dyn_cast_ptrOrBoxEleTy(t)) {
348 t = ty;
349 continue;
350 }
351 if (auto seqTy = mlir::dyn_cast<fir::SequenceType>(t))
352 return seqTy;
353 return {};
354 }
355}
356
359inline fir::RecordType unwrapIfDerived(fir::BaseBoxType boxTy) {
360 return mlir::dyn_cast<fir::RecordType>(
361 fir::unwrapSequenceType(fir::unwrapRefType(boxTy.getEleTy())));
362}
363
366 auto recTy = unwrapIfDerived(boxTy);
367 return recTy && recTy.getNumLenParams() > 0;
368}
369
371inline bool isDerivedType(fir::BaseBoxType boxTy) {
372 return static_cast<bool>(unwrapIfDerived(boxTy));
373}
374
375#ifndef NDEBUG
376// !fir.ptr<X> and !fir.heap<X> where X is !fir.ptr, !fir.heap, or !fir.ref
377// is undefined and disallowed.
378inline bool singleIndirectionLevel(mlir::Type ty) {
379 return !fir::isa_ref_type(ty);
380}
381#endif
382
385bool isPointerType(mlir::Type ty);
386
388bool isAllocatableType(mlir::Type ty);
389
391bool isBoxNone(mlir::Type ty);
392
395bool isBoxedRecordType(mlir::Type ty);
396
398bool isTypeWithDescriptor(mlir::Type ty);
399
404bool isScalarBoxedRecordType(mlir::Type ty);
405
407mlir::Type getDerivedType(mlir::Type ty);
408
411bool isPolymorphicType(mlir::Type ty);
412
415bool isUnlimitedPolymorphicType(mlir::Type ty);
416
418bool isClassStarType(mlir::Type ty);
419
423bool isAssumedType(mlir::Type ty);
424
426bool isAssumedShape(mlir::Type ty);
427
429bool isAllocatableOrPointerArray(mlir::Type ty);
430
434 return static_cast<bool>(unwrapIfDerived(boxTy)) ||
436}
437
439unsigned getBoxRank(mlir::Type boxTy);
440
442unsigned getBoxCorank(mlir::Type boxTy);
443
445bool isRecordWithAllocatableMember(mlir::Type ty);
446
449bool isRecordWithDescriptorMember(mlir::Type ty);
450
452inline bool isRecordWithTypeParameters(mlir::Type ty) {
453 if (auto recTy = mlir::dyn_cast_or_null<fir::RecordType>(ty))
454 return recTy.isDependentType();
455 return false;
456}
457
459bool isCharacterProcedureTuple(mlir::Type type, bool acceptRawFunc = true);
460
464mlir::Type applyPathToType(mlir::Type rootTy, mlir::ValueRange path);
465
468bool hasAbstractResult(mlir::FunctionType ty);
469
471mlir::Type fromRealTypeID(mlir::MLIRContext *context, llvm::Type::TypeID typeID,
472 fir::KindTy kind);
473
474int getTypeCode(mlir::Type ty, const KindMapping &kindMap);
475
476inline bool BaseBoxType::classof(mlir::Type type) {
477 return mlir::isa<fir::BoxType, fir::ClassType>(type);
478}
479
481inline bool isNoneOrSeqNone(mlir::Type type) {
482 if (auto seqTy = mlir::dyn_cast<fir::SequenceType>(type))
483 return mlir::isa<mlir::NoneType>(seqTy.getEleTy());
484 return mlir::isa<mlir::NoneType>(type);
485}
486
489inline mlir::Type wrapInClassOrBoxType(mlir::Type eleTy,
490 bool isPolymorphic = false,
491 bool isAssumedType = false,
492 unsigned corank = 0) {
493 if (isPolymorphic && !isAssumedType)
494 return fir::ClassType::get(eleTy, /*isVolatile*/ false, corank);
495 return fir::BoxType::get(eleTy, /*isVolatile*/ false, corank);
496}
497
500mlir::Type updateTypeWithVolatility(mlir::Type type, bool isVolatile);
501
508inline mlir::Type updateTypeForUnlimitedPolymorphic(mlir::Type ty) {
509 if (auto seqTy = mlir::dyn_cast<fir::SequenceType>(ty))
510 return fir::SequenceType::get(
511 seqTy.getShape(), updateTypeForUnlimitedPolymorphic(seqTy.getEleTy()));
512 if (auto heapTy = mlir::dyn_cast<fir::HeapType>(ty))
513 return fir::HeapType::get(
514 updateTypeForUnlimitedPolymorphic(heapTy.getEleTy()));
515 if (auto pointerTy = mlir::dyn_cast<fir::PointerType>(ty))
516 return fir::PointerType::get(
517 updateTypeForUnlimitedPolymorphic(pointerTy.getEleTy()));
518 if (!mlir::isa<mlir::NoneType, fir::RecordType>(ty))
519 return mlir::NoneType::get(ty.getContext());
520 return ty;
521}
522
525mlir::Type updateTypeWithVolatility(mlir::Type type, bool isVolatile);
526
531mlir::Type changeElementType(mlir::Type type, mlir::Type newElementType,
532 bool turnBoxIntoClass);
533
535inline bool isBoxAddress(mlir::Type t) {
536 return fir::isa_ref_type(t) &&
537 mlir::isa<fir::BaseBoxType>(fir::unwrapRefType(t));
538}
539
541inline bool isBoxAddressOrValue(mlir::Type t) {
542 return mlir::isa<fir::BaseBoxType>(fir::unwrapRefType(t));
543}
544
546inline bool isBoxProcAddressType(mlir::Type t) {
548 return t && mlir::isa<fir::BoxProcType>(t);
549}
550
551inline bool isRefOfConstantSizeAggregateType(mlir::Type t) {
553 return t &&
554 mlir::isa<fir::CharacterType, fir::RecordType, fir::SequenceType>(t) &&
555 !hasDynamicSize(t);
556}
557
562std::string getTypeAsString(mlir::Type ty, const KindMapping &kindMap,
563 llvm::StringRef prefix = "");
564
598
600std::pair<std::uint64_t, unsigned short>
601getTypeSizeAndAlignmentOrCrash(mlir::Location loc, mlir::Type ty,
602 const mlir::DataLayout &dl,
603 const fir::KindMapping &kindMap);
604
606std::optional<std::pair<uint64_t, unsigned short>>
607getTypeSizeAndAlignment(mlir::Location loc, mlir::Type ty,
608 const mlir::DataLayout &dl,
609 const fir::KindMapping &kindMap);
610
611} // namespace fir
612
613#endif // FORTRAN_OPTIMIZER_DIALECT_FIRTYPE_H
This class provides a shared interface for box and class types.
Definition FIRType.h:40
Attribute
Box attributes.
Definition FIRType.h:45
mlir::Type getBaseAddressType(bool dropHeapOrPtr=false) const
Definition FIRType.cpp:1490
BaseBoxType getBoxTypeWithNewAttr(Attribute attr) const
Return the same type, except for the attribute (fir.heap/fir.ptr).
Definition FIRType.cpp:1573
BaseBoxType getBoxTypeWithNewElementType(mlir::Type elementType, bool polymorphic) const
Definition FIRType.cpp:1566
bool isVolatile() const
Is this a box describing volatile memory?
Definition FIRType.cpp:1610
bool isPointer() const
Is this a box for a pointer?
Definition FIRType.cpp:1602
bool isAssumedRank() const
Is this the box for an assumed rank?
Definition FIRType.cpp:1595
mlir::Type unwrapInnerType() const
Unwrap element type from fir.heap, fir.ptr and fir.array.
Definition FIRType.cpp:1497
mlir::Type getEleTy() const
Returns the element type of this box type.
Definition FIRType.cpp:1484
bool isCoarray() const
Is this a box describing a coarray?
Definition FIRType.cpp:1616
bool isPointerOrAllocatable() const
Does this box for a pointer or allocatable?
Definition FIRType.cpp:1606
BaseBoxType getBoxTypeWithNewShape(mlir::Type shapeMold) const
Definition FIRType.cpp:1546
static bool classof(mlir::Type type)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition FIRType.h:476
bool isArray() const
Is this a box describing an array or assumed-rank?
Definition FIRType.cpp:1612
Definition KindMapping.h:48
Definition FIRType.h:106
Definition AbstractConverter.h:37
bool isa_box_type(mlir::Type t)
Is t a boxed type?
Definition FIRType.h:141
int getTypeCode(mlir::Type ty, const KindMapping &kindMap)
Return the ISO_C_BINDING intrinsic module value of type ty.
Definition FIRType.cpp:497
bool isScalarBoxedRecordType(mlir::Type ty)
Definition FIRType.cpp:358
bool isa_builtin_event_type(mlir::Type t)
Is t type(event_type) type?
Definition FIRType.h:164
mlir::Type applyPathToType(mlir::Type rootTy, mlir::ValueRange path)
Definition FIROps.cpp:6285
std::string getTypeAsString(mlir::Type ty, const KindMapping &kindMap, llvm::StringRef prefix="")
Definition FIRType.cpp:594
fir::SequenceType unwrapUntilSeqType(mlir::Type t)
Definition FIRType.h:343
bool sequenceWithNonConstantShape(fir::SequenceType seqTy)
Definition FIRType.h:271
bool isa_ref_type(mlir::Type t)
Is t a FIR dialect type that implies a memory (de)reference?
Definition FIRType.h:135
bool isBoxAddressOrValue(mlir::Type t)
Is t a fir.box or class address or value type?
Definition FIRType.h:541
bool conformsWithPassByRef(mlir::Type t)
Definition FIRType.h:156
bool isa_volatile_type(mlir::Type t)
Definition FIRType.cpp:768
bool isa_builtin_cdevptr_type(mlir::Type t)
Is t type(c_devptr)?
Definition FIRType.h:187
mlir::Type updateTypeWithVolatility(mlir::Type type, bool isVolatile)
Definition FIRType.cpp:244
mlir::Type fromRealTypeID(mlir::MLIRContext *context, llvm::Type::TypeID typeID, fir::KindTy kind)
Convert llvm::Type::TypeID to mlir::Type.
Definition FIRType.cpp:1458
bool isUnlimitedPolymorphicType(mlir::Type ty)
Definition FIRType.cpp:418
bool isa_vector(mlir::Type t)
Is t a vector type?
Definition FIRType.h:215
mlir::Type unwrapPassByRefType(mlir::Type t)
Definition FIRType.h:314
bool isDerivedType(fir::BaseBoxType boxTy)
Return true iff boxTy wraps a fir::RecordType.
Definition FIRType.h:371
bool isa_char(mlir::Type t)
Is t a CHARACTER type? Does not check the length.
Definition FIRType.h:235
bool isBoxedRecordType(mlir::Type ty)
Definition FIRType.cpp:337
bool isBoxNone(mlir::Type ty)
Return true iff ty is !fir.box<none>.
Definition FIRType.cpp:331
mlir::Type unwrapSeqOrBoxedSeqType(mlir::Type ty)
Definition FIRType.cpp:472
bool isBoxAddress(mlir::Type t)
Is t an address to fir.box or class type?
Definition FIRType.h:535
mlir::Type updateTypeForUnlimitedPolymorphic(mlir::Type ty)
Definition FIRType.h:508
bool isa_derived(mlir::Type t)
Is t a derived (record) type?
Definition FIRType.h:161
bool isa_aggregate(mlir::Type t)
Is t a FIR dialect aggregate type?
Definition FIRType.h:194
bool isDerivedTypeWithLenParams(fir::BaseBoxType boxTy)
Return true iff boxTy wraps a fir::RecordType with length parameters.
Definition FIRType.h:365
bool isAssumedShape(mlir::Type ty)
Return true iff ty is the type of an assumed shape array.
Definition FIRType.cpp:385
bool isCharacterProcedureTuple(mlir::Type type, bool acceptRawFunc=true)
Is this tuple type holding a character function and its result length?
Definition FIRType.cpp:1440
mlir::Type dyn_cast_ptrEleTy(mlir::Type t)
Definition FIRType.cpp:257
mlir::Type getDerivedType(mlir::Type ty)
Return the nested RecordType if one if found. Return ty otherwise.
Definition FIRType.cpp:233
bool isa_fir_or_std_type(mlir::Type t)
Is t any of the FIR dialect or Standard dialect types?
Definition FIRType.cpp:226
mlir::Type getFortranElementType(mlir::Type ty)
Definition FIRType.cpp:467
bool isNoneOrSeqNone(mlir::Type type)
Return true iff ty is none or fir.array<none>.
Definition FIRType.h:481
std::optional< std::pair< uint64_t, unsigned short > > getTypeSizeAndAlignment(mlir::Location loc, mlir::Type ty, const mlir::DataLayout &dl, const fir::KindMapping &kindMap)
This variant returns std::nullopt if an unsupported type is passed.
Definition FIRType.cpp:1644
fir::RecordType unwrapIfDerived(fir::BaseBoxType boxTy)
Definition FIRType.h:359
bool boxHasAddendum(fir::BaseBoxType boxTy)
Definition FIRType.h:433
bool isRecordWithAllocatableMember(mlir::Type ty)
Return true iff ty is a RecordType with members that are allocatable.
Definition FIRType.cpp:426
unsigned getBoxRank(mlir::Type boxTy)
Get the rank from a !fir.box type.
Definition FIRType.cpp:483
bool isClassStarType(mlir::Type ty)
Return true if CLASS(*)
Definition FIRType.cpp:349
mlir::Type wrapInClassOrBoxType(mlir::Type eleTy, bool isPolymorphic=false, bool isAssumedType=false, unsigned corank=0)
Definition FIRType.h:489
mlir::Type dyn_cast_ptrOrBoxEleTy(mlir::Type t)
Definition FIRType.cpp:264
bool isPointerType(mlir::Type ty)
Definition FIRType.cpp:315
bool isTypeWithDescriptor(mlir::Type ty)
Return true iff ty is a type that contains descriptor information.
Definition FIRType.cpp:404
bool characterWithDynamicLen(mlir::Type t)
Returns true iff t is a fir.char type and has an unknown length.
Definition FIRType.h:263
bool isAllocatableType(mlir::Type ty)
Return true iff ty is the type of an ALLOCATABLE entity or value.
Definition FIRType.cpp:323
mlir::Type changeElementType(mlir::Type type, mlir::Type newElementType, bool turnBoxIntoClass)
Definition FIRType.cpp:731
bool isPolymorphicType(mlir::Type ty)
Definition FIRType.cpp:410
bool isa_builtin_cptr_type(mlir::Type t)
Is t type(c_ptr), type(c_funptr), or type(c_devptr)?
Definition FIRType.h:171
mlir::Type unwrapAllRefAndSeqType(mlir::Type ty)
Definition FIRType.cpp:456
unsigned getBoxCorank(mlir::Type boxTy)
Get the corank from a !fir.box type.
Definition FIRType.cpp:490
bool hasAbstractResult(mlir::FunctionType ty)
Definition FIRType.cpp:1448
bool isAllocatableOrPointerArray(mlir::Type ty)
Return true iff ty is the type of an allocatable array.
Definition FIRType.cpp:392
bool isa_integer(mlir::Type t)
Is t an integral type?
Definition FIRType.h:210
mlir::Type extractSequenceType(mlir::Type ty)
Return the nested sequence type if any.
Definition FIRType.cpp:303
bool isa_char_string(mlir::Type t)
Is t a CHARACTER type with a LEN other than 1?
Definition FIRType.h:245
bool isRecordWithDescriptorMember(mlir::Type ty)
Definition FIRType.cpp:442
bool isBoxProcAddressType(mlir::Type t)
Is this a fir.boxproc address type?
Definition FIRType.h:546
bool isa_std_type(mlir::Type t)
Is t any of the Standard dialect types?
Definition FIRType.cpp:222
bool isa_passbyref_type(mlir::Type t)
Definition FIRType.h:148
std::pair< std::uint64_t, unsigned short > getTypeSizeAndAlignmentOrCrash(mlir::Location loc, mlir::Type ty, const mlir::DataLayout &dl, const fir::KindMapping &kindMap)
This variant terminates the compilation if an unsupported type is passed.
Definition FIRType.cpp:1727
bool hasDynamicSize(mlir::Type t)
Returns true iff the type t does not have a constant size.
Definition FIRType.cpp:290
mlir::Type boxMemRefType(fir::BaseBoxType t)
Get the memory reference type of the data pointer from the box type,.
Definition FIRType.h:289
bool isRecordWithTypeParameters(mlir::Type ty)
Return true iff ty is a RecordType with type parameters.
Definition FIRType.h:452
bool isAssumedType(mlir::Type ty)
Definition FIRType.cpp:372
void verifyIntegralType(mlir::Type type)
Definition FIRType.cpp:746
bool isa_complex(mlir::Type t)
Is t a floating point complex type?
Definition FIRType.h:228
bool isa_fir_type(mlir::Type t)
Is t any of the FIR dialect types?
Definition FIRType.cpp:218
bool isa_trivial(mlir::Type t)
Definition FIRType.h:239
mlir::Type unwrapSequenceType(mlir::Type t)
If t is a SequenceType return its element type, otherwise return t.
Definition FIRType.h:297
bool isa_unknown_size_box(mlir::Type t)
Definition FIRType.cpp:758
bool isa_real(mlir::Type t)
Is t a real type?
Definition FIRType.h:207
Definition AbstractConverter.h:32
Derived type storage.
Definition FIRType.cpp:157