[flang-commits] [flang] 5fe83b0 - [flang] Correct TypeCode::IsLogical()
peter klausler via flang-commits
flang-commits at lists.llvm.org
Mon Apr 12 12:57:32 PDT 2021
Author: peter klausler
Date: 2021-04-12T12:57:22-07:00
New Revision: 5fe83b048a23ab1dabba047bfc551a0c2ac78e1b
URL: https://github.com/llvm/llvm-project/commit/5fe83b048a23ab1dabba047bfc551a0c2ac78e1b
DIFF: https://github.com/llvm/llvm-project/commit/5fe83b048a23ab1dabba047bfc551a0c2ac78e1b.diff
LOG: [flang] Correct TypeCode::IsLogical()
F18 is using the type codes for C's "least" int types to encode
the various kinds of Fortran's LOGICAL intrinsic type; update
the IsLogical() predicate accordingly. (This member function
isn't yet used anywhere, so this patch is nearly an NFC.)
Differential Revision: https://reviews.llvm.org/D100323
Added:
Modified:
flang/runtime/type-code.h
Removed:
################################################################################
diff --git a/flang/runtime/type-code.h b/flang/runtime/type-code.h
index 3c5891ba6c68..c859edecd40f 100644
--- a/flang/runtime/type-code.h
+++ b/flang/runtime/type-code.h
@@ -45,7 +45,7 @@ class TypeCode {
}
constexpr bool IsLogical() const {
return raw_ == CFI_type_Bool ||
- (raw_ >= CFI_type_int_fast8_t && raw_ <= CFI_type_int_fast64_t);
+ (raw_ >= CFI_type_int_least8_t && raw_ <= CFI_type_int_least64_t);
}
constexpr bool IsDerived() const { return raw_ == CFI_type_struct; }
constexpr bool IsIntrinsic() const { return IsValid() && !IsDerived(); }
More information about the flang-commits
mailing list