[flang-commits] [PATCH] D104586: [flang] Update Reshape runtime library routine and its corresponding unit test

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Jun 21 01:19:33 PDT 2021


jeanPerier added a comment.

Looks good to me.



================
Comment at: flang/runtime/transformational.cpp:397-401
+    auto *addr = order->OffsetElement<char>(orderSubscript);
+    std::size_t orderElementBytes{order->ElementBytes()};
+    for (SubscriptValue j{0}; j < resultRank; ++j) {
+      auto k{GetInt64(addr, 1, terminator)};
+      addr += orderElementBytes;
----------------
I think `auto k{GetInt64(shape.Element<char>(&orderSubscript), orderElementBytes, terminator)}` might be more idiomatic than manually incrementing the byte offset. @klausler, is this correct ?


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

https://reviews.llvm.org/D104586



More information about the flang-commits mailing list