[flang-commits] [flang] 21c8e1b - [flang][fir][NFC] Update comments.
Eric Schweitz via flang-commits
flang-commits at lists.llvm.org
Thu Mar 4 13:31:37 PST 2021
Author: Eric Schweitz
Date: 2021-03-04T13:31:21-08:00
New Revision: 21c8e1b00aef074750dd681d89099ed7864ba87a
URL: https://github.com/llvm/llvm-project/commit/21c8e1b00aef074750dd681d89099ed7864ba87a
DIFF: https://github.com/llvm/llvm-project/commit/21c8e1b00aef074750dd681d89099ed7864ba87a.diff
LOG: [flang][fir][NFC] Update comments.
Added:
Modified:
flang/include/flang/Optimizer/Dialect/FIRTypes.td
Removed:
################################################################################
diff --git a/flang/include/flang/Optimizer/Dialect/FIRTypes.td b/flang/include/flang/Optimizer/Dialect/FIRTypes.td
index a5bbbbdc0798..b1df67186ae9 100644
--- a/flang/include/flang/Optimizer/Dialect/FIRTypes.td
+++ b/flang/include/flang/Optimizer/Dialect/FIRTypes.td
@@ -108,20 +108,27 @@ def fir_CharacterType : FIR_Type<"Character", "char"> {
using KindTy = unsigned;
using LenType = std::int64_t;
- // Return unknown length CHARACTER type.
+ /// Return unknown length Character type. e.g., CHARACTER(LEN=n).
static CharacterType getUnknownLen(mlir::MLIRContext *ctxt, KindTy kind) {
return get(ctxt, kind, unknownLen());
}
- // Return length 1 CHARACTER type.
+ /// Return length 1 Character type. e.g., CHARACTER(LEN=1).
static CharacterType getSingleton(mlir::MLIRContext *ctxt, KindTy kind) {
return get(ctxt, kind, singleton());
}
- // CHARACTER is a singleton and has a LEN of 1.
+ /// Character is a singleton and has a LEN of 1.
static constexpr LenType singleton() { return 1; }
- // CHARACTER has an unknown LEN property.
+
+ /// Character has a LEN value which is not a compile-time known constant.
static constexpr LenType unknownLen() { return -1; }
+
+ /// Character LEN is a runtime value.
+ bool hasDynamicLen() { return getLen() == unknownLen(); }
+
+ /// Character LEN is a compile-time cpnstant value.
+ bool hasConstantLen() { return !hasDynamicLen(); }
}];
}
More information about the flang-commits
mailing list