summaryrefslogtreecommitdiffstats
path: root/flang/include/flang/Optimizer/Dialect/FIRType.h
diff options
context:
space:
mode:
Diffstat (limited to 'flang/include/flang/Optimizer/Dialect/FIRType.h')
-rw-r--r--flang/include/flang/Optimizer/Dialect/FIRType.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/flang/include/flang/Optimizer/Dialect/FIRType.h b/flang/include/flang/Optimizer/Dialect/FIRType.h
index f1f8910e7090..516d8e56189c 100644
--- a/flang/include/flang/Optimizer/Dialect/FIRType.h
+++ b/flang/include/flang/Optimizer/Dialect/FIRType.h
@@ -184,6 +184,13 @@ inline bool singleIndirectionLevel(mlir::Type ty) {
}
#endif
+/// Return true iff `ty` is a RecordType with type parameters.
+inline bool isRecordWithTypeParameters(mlir::Type ty) {
+ if (auto recTy = ty.dyn_cast_or_null<fir::RecordType>())
+ return recTy.getNumLenParams() != 0;
+ return false;
+}
+
/// Apply the components specified by `path` to `rootTy` to determine the type
/// of the resulting component element. `rootTy` should be an aggregate type.
/// Returns null on error.