[flang-commits] [PATCH] D100323: [flang] Correct TypeCode::IsLogical()

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Apr 12 10:17:19 PDT 2021


klausler created this revision.
klausler added a reviewer: jeanPerier.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
klausler requested review of this revision.

F18 <https://reviews.llvm.org/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.)


https://reviews.llvm.org/D100323

Files:
  flang/runtime/type-code.h


Index: flang/runtime/type-code.h
===================================================================
--- flang/runtime/type-code.h
+++ flang/runtime/type-code.h
@@ -45,7 +45,7 @@
   }
   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(); }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100323.336884.patch
Type: text/x-patch
Size: 562 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20210412/6c5ec9e4/attachment.bin>


More information about the flang-commits mailing list