[flang-commits] [PATCH] D101658: [flang] Use CFI_TYPE_LAST instead of CFI_type_struct

Diana Picus via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon May 3 01:17:44 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG32f901bdf9b5: [flang] Use CFI_TYPE_LAST instead of CFI_type_struct (authored by rovka).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101658/new/

https://reviews.llvm.org/D101658

Files:
  flang/runtime/ISO_Fortran_binding.cpp
  flang/unittests/Evaluate/ISO-Fortran-binding.cpp


Index: flang/unittests/Evaluate/ISO-Fortran-binding.cpp
===================================================================
--- flang/unittests/Evaluate/ISO-Fortran-binding.cpp
+++ flang/unittests/Evaluate/ISO-Fortran-binding.cpp
@@ -130,7 +130,7 @@
     ++numErr;
     expectedRetCode = CFI_INVALID_RANK;
   }
-  if (type < 0 || type > CFI_type_struct) {
+  if (type < 0 || type > CFI_TYPE_LAST) {
     ++numErr;
     expectedRetCode = CFI_INVALID_TYPE;
   }
@@ -166,7 +166,7 @@
   CFI_attribute_t attrCases[]{
       CFI_attribute_pointer, CFI_attribute_allocatable, CFI_attribute_other};
   CFI_type_t typeCases[]{CFI_type_int, CFI_type_struct, CFI_type_double,
-      CFI_type_char, CFI_type_other, CFI_type_struct + 1};
+      CFI_type_char, CFI_type_other, CFI_TYPE_LAST + 1};
   CFI_index_t *extentCases[]{extents, nullptr};
   void *baseAddrCases[]{dummyAddr, nullptr};
   CFI_rank_t rankCases[]{0, 1, CFI_MAX_RANK, CFI_MAX_RANK + 1};
@@ -330,7 +330,7 @@
     ++numErr;
     expectedRetCode = CFI_INVALID_RANK;
   }
-  if (type < 0 || type > CFI_type_struct) {
+  if (type < 0 || type > CFI_TYPE_LAST) {
     ++numErr;
     expectedRetCode = CFI_INVALID_TYPE;
   }
@@ -375,7 +375,7 @@
   CFI_attribute_t attrCases[]{
       CFI_attribute_pointer, CFI_attribute_allocatable, CFI_attribute_other};
   CFI_type_t typeCases[]{CFI_type_int, CFI_type_struct, CFI_type_double,
-      CFI_type_char, CFI_type_other, CFI_type_struct + 1};
+      CFI_type_char, CFI_type_other, CFI_TYPE_LAST + 1};
   void *baseAddrCases[]{dummyAddr, nullptr};
   CFI_rank_t rankCases[]{0, 1, CFI_MAX_RANK, CFI_MAX_RANK + 1};
   std::size_t lenCases[]{0, 42};
Index: flang/runtime/ISO_Fortran_binding.cpp
===================================================================
--- flang/runtime/ISO_Fortran_binding.cpp
+++ flang/runtime/ISO_Fortran_binding.cpp
@@ -56,7 +56,7 @@
     return CFI_INVALID_RANK;
   }
   if (descriptor->type < CFI_type_signed_char ||
-      descriptor->type > CFI_type_struct) {
+      descriptor->type > CFI_TYPE_LAST) {
     return CFI_INVALID_TYPE;
   }
   if (!IsCharacterType(descriptor->type)) {
@@ -228,7 +228,7 @@
   if (rank > 0 && base_addr && !extents) {
     return CFI_INVALID_EXTENT;
   }
-  if (type < CFI_type_signed_char || type > CFI_type_struct) {
+  if (type < CFI_type_signed_char || type > CFI_TYPE_LAST) {
     return CFI_INVALID_TYPE;
   }
   if (!descriptor) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101658.342324.patch
Type: text/x-patch
Size: 2393 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20210503/13499dfc/attachment.bin>


More information about the flang-commits mailing list