/// Create a sequence of `eleTy` with `rank` dimensions of unknown size.
mlir::Type getVarLenSeqTy(mlir::Type eleTy, unsigned rank = 1);
- /// Get character length type
+ /// Get character length type.
mlir::Type getCharacterLengthType() { return getIndexType(); }
/// Get the integer type whose bit width corresponds to the width of pointer
/// \p exv is an extended value holding a memory reference to the object that
/// must be boxed. This function will crash if provided something that is not
/// a memory reference type.
- /// Array entities are boxed with a shape and character with their length.
+ /// Array entities are boxed with a shape and possibly a shift. Character
+ /// entities are boxed with a LEN parameter.
mlir::Value createBox(mlir::Location loc, const fir::ExtendedValue &exv);
/// Create constant i1 with value 1. if \p b is true or 0. otherwise
getNonDefaultLowerBounds(fir::FirOpBuilder &builder, mlir::Location loc,
const fir::ExtendedValue &exv);
-/// Return length parameters associated to \p exv that are not deferred (that
-/// are available without having to read any fir.box values).
-/// Empty if \p exv has no length parameters or if they are all deferred.
+/// Return LEN parameters associated to \p exv that are not deferred (that are
+/// available without having to read any fir.box values). Empty if \p exv has no
+/// LEN parameters or if they are all deferred.
llvm::SmallVector<mlir::Value>
getNonDeferredLengthParams(const fir::ExtendedValue &exv);
// String literal helper helpers
//===----------------------------------------------------------------------===//
-/// Create a !fir.char<1> string literal global and returns a
-/// fir::CharBoxValue with its address and length.
+/// Create a !fir.char<1> string literal global and returns a fir::CharBoxValue
+/// with its address and length.
fir::ExtendedValue createStringLiteral(fir::FirOpBuilder &, mlir::Location,
llvm::StringRef string);
/// Given the address of an array element and the ExtendedValue describing the
/// array, returns the ExtendedValue describing the array element. The purpose
-/// is to propagate the length parameters of the array to the element.
-/// This can be used for elements of `array` or `array(i:j:k)`. If \p element
-/// belongs to an array section `array%x` whose base is \p array,
+/// is to propagate the LEN parameters of the array to the element. This can be
+/// used for elements of `array` or `array(i:j:k)`. If \p element belongs to an
+/// array section `array%x` whose base is \p array,
/// arraySectionElementToExtendedValue must be used instead.
fir::ExtendedValue arrayElementToExtendedValue(fir::FirOpBuilder &builder,
mlir::Location loc,
/// allocatable variable. Initialization of such variable has to be done at the
/// beginning of the variable lifetime by storing the created box in the memory
/// for the variable box.
-/// \p nonDeferredParams must provide the non deferred length parameters so that
+/// \p nonDeferredParams must provide the non deferred LEN parameters so that
/// they can already be placed in the unallocated box (inquiries about these
/// parameters are legal even in unallocated state).
mlir::Value createUnallocatedBox(fir::FirOpBuilder &builder, mlir::Location loc,
const fir::MutableBoxValue &box);
/// Generate code to conditionally reallocate a MutableBoxValue with a new
-/// shape, lower bounds, and length parameters if it is unallocated or if its
-/// current shape or deferred length parameters do not match the provided ones.
+/// shape, lower bounds, and LEN parameters if it is unallocated or if its
+/// current shape or deferred LEN parameters do not match the provided ones.
/// Lower bounds are only used if the entity needs to be allocated, otherwise,
/// the MutableBoxValue will keep its current lower bounds.
/// If the MutableBoxValue is an array, the provided shape can be empty, in
/// which case the MutableBoxValue must already be allocated at runtime and its
-/// shape and lower bounds will be kept. If \p shape is empty, only a length
+/// shape and lower bounds will be kept. If \p shape is empty, only a LEN
/// parameter mismatch can trigger a reallocation. See Fortran 10.2.1.3 point 3
/// that this function is implementing for more details. The polymorphic
/// requirements are not yet covered by this function.