llvm-project/flang/runtime
Slava Zakharin d37250c9db [flang][runtime] Fixes for element size calculation.
BytesFor() used to return KIND for the size, which is not always
correct, so I changed it to return the size of the actual CppType
corresponding to the given category and kind.

MinElemLen() used to calculate size incorrectly (e.g. CFI_type_extended_double
was sized 10, whereas it may occupy more bytes on a target), so I changed it
to call BytesFor().

Additional changes were needed to resolve new failures for transformational
intrinsics. These intrinsics used to work for not fully supported
data types (e.g. REAL(3)), but now stopped working because CppType
cannot be computed for those categories/kinds. The solution is to use
known element size from the source argument(s) for establishing
the destination descriptor - the element size is all that is needed
for transformational intrinsics to keep working.

Note that this does not help cases, where runtime still has to
compute the element size, e.g. when it creates descriptors for
components of derived types. If the component has unsupported
data type, BytesFor() will still fail. So these cases require
adding support for the missing types.

New regression unit test in Runtime/Transformational.cpp
demonstrates the case that will start working properly with
this commit.
2022-09-22 10:10:42 -07:00
..
FortranMain [flang] Install runtime libs with the toolchain 2022-08-15 07:43:47 +00:00
CMakeLists.txt [flang] Allow configuring building the flang runtime standalone 2022-08-23 17:25:21 +03:00
ISO_Fortran_binding.cpp [flang][runtime] Fixes for element size calculation. 2022-09-22 10:10:42 -07:00
ISO_Fortran_util.h [flang][runtime] Fixes for element size calculation. 2022-09-22 10:10:42 -07:00
allocatable.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
assign.cpp [flang] Make subscript list argument a nullable pointer 2021-11-08 11:53:13 -08:00
buffer.cpp [flang] Remove *- C++ -* incantation from runtime .cpp files. NFC 2021-09-03 07:17:45 +00:00
buffer.h [flang][runtime] Keep frame buffer in sync with file when truncating 2022-07-13 16:12:12 -07:00
character.cpp [flang][runtime] ensure character compares to blank are unsigned 2022-09-13 10:42:53 +02:00
command.cpp [flang] Single entry point for GET_COMMAND_ARGUMENT 2022-07-27 10:27:25 +00:00
complex-reduction.c [flang][runtime] Use __float128 where possible & needed in runtime 2022-06-05 09:16:57 -07:00
complex-reduction.h [flang] Change complex type define in runtime for clang-cl 2021-09-22 06:54:33 +00:00
config.h.cmake
connection.cpp [flang] Honor RECL= in list-directed/namelist output 2022-03-02 12:07:18 -08:00
connection.h [flang][runtime] Support internal I/O to CHARACTER(KIND/=1) 2022-08-09 08:46:21 -07:00
copy.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
copy.h [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
derived-api.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
derived.cpp [flang] Fix extent computation in finalization 2022-03-09 09:01:02 -08:00
derived.h [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
descriptor-io.cpp [flang] Fix repeated "DT" editing 2022-01-21 17:22:51 -08:00
descriptor-io.h [flang][runtime] Corrections for byte-swapped I/O 2022-08-26 12:30:29 -07:00
descriptor.cpp [flang][runtime] Fixes for element size calculation. 2022-09-22 10:10:42 -07:00
dot-product.cpp [flang][runtime] Enable real/complex kind 10 and 16 variants of dot_product. 2022-08-31 15:17:17 -07:00
edit-input.cpp [flang][runtime] Catch input error case of missing integer value 2022-08-18 15:51:11 -07:00
edit-input.h [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
edit-output.cpp [flang][runtime] Support internal I/O to CHARACTER(KIND/=1) 2022-08-09 08:46:21 -07:00
edit-output.h [flang][runtime] Detect overflow of fixed-sized exponent output field 2022-06-13 16:10:32 -07:00
emit-encoded.h [flang][runtime] Support internal I/O to CHARACTER(KIND/=1) 2022-08-09 08:46:21 -07:00
environment.cpp [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
environment.h [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
extensions.cpp [flang] Add CALL FLUSH(n) legacy extension 2021-12-08 08:56:54 -08:00
extrema.cpp [flang][runtime] Fixes for element size calculation. 2022-09-22 10:10:42 -07:00
file.cpp [flang] [runtime] Fix build warnings if built with mingw 2022-08-25 11:56:10 +03:00
file.h [flang][runtime] Catch OPEN of connected file 2022-06-04 11:06:37 -07:00
findloc.cpp [flang][runtime] Use __float128 where possible & needed in runtime 2022-06-05 09:16:57 -07:00
format-implementation.h [flang] Noncontiguous formats 2022-08-24 13:51:16 -07:00
format.cpp [flang] Remove *- C++ -* incantation from runtime .cpp files. NFC 2021-09-03 07:17:45 +00:00
format.h [flang] Support for character array formats 2022-08-18 15:35:47 -07:00
inquiry.cpp [flang] Improve runtime crash messages 2022-03-12 15:15:56 -08:00
internal-unit.cpp [flang][runtime] Support internal I/O to CHARACTER(KIND/=1) 2022-08-09 08:46:21 -07:00
internal-unit.h [flang][runtime] Support internal I/O to CHARACTER(KIND/=1) 2022-08-09 08:46:21 -07:00
io-api.cpp [flang] Noncontiguous formats 2022-08-24 13:51:16 -07:00
io-error.cpp [flang] Error recovery improvement in runtime (IOMSG=) 2022-03-18 17:24:32 -07:00
io-error.h [flang][runtime] Clean up asynchronous I/O APIs 2022-05-24 07:54:57 -07:00
io-stmt.cpp [flang] Noncontiguous formats 2022-08-24 13:51:16 -07:00
io-stmt.h [flang] Give explicit convert= specifiers precedence over FORT_CONVERT 2022-09-19 20:40:51 -07:00
iostat.cpp [flang][runtime] FLUSH(bad or unconnected unit number) is an error 2022-06-23 11:08:53 -07:00
lock.h [flang][runtime] Remove dependency on C++ <mutex> on Windows 2022-06-10 11:25:45 +00:00
main.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
matmul.cpp [flang][runtime] Improve error message for incompatible MATMUL arguments 2022-08-18 13:59:13 -07:00
memory.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
misc-intrinsic.cpp [flang] Error detection/avoidance for TRANSFER with empty MOLD= type 2022-07-13 16:50:57 -07:00
namelist.cpp [flang][runtime] Catch input error case of missing integer value 2022-08-18 15:51:11 -07:00
namelist.h [flang][runtime] Catch input error case of missing integer value 2022-08-18 15:51:11 -07:00
numeric.cpp [flang] Support intrinsic `selected_int_kind` for variables 2022-07-26 00:33:27 +08:00
pointer.cpp [flang][runtime] Make ASSOCIATED() conform with standard 2022-06-16 11:39:44 -07:00
product.cpp [flang][runtime] Use __float128 where possible & needed in runtime 2022-06-05 09:16:57 -07:00
ragged.cpp [flang] Simplify RaggedArrayHeader and make it plain C struct 2021-12-09 22:28:06 +01:00
random.cpp [flang] Intrinsic RANDOM_SEED calls with dynamically absent/present arguments 2022-08-09 09:08:55 -07:00
reduction-templates.h [flang][runtime] Fixes for element size calculation. 2022-09-22 10:10:42 -07:00
reduction.cpp [flang][runtime] Fixes for element size calculation. 2022-09-22 10:10:42 -07:00
stat.cpp [flang] Implement GET_ENVIRONMENT_VARIABLE(VALUE) 2021-11-01 09:19:20 +00:00
stat.h [flang] Implement GET_ENVIRONMENT_VARIABLE(VALUE) 2021-11-01 09:19:20 +00:00
stop.cpp [flang] Support extention intrinsic ABORT 2022-08-02 23:02:12 +08:00
sum.cpp [flang][runtime] Use __float128 where possible & needed in runtime 2022-06-05 09:16:57 -07:00
support.cpp [flang] Define & implement a lowering support API IsContiguous() in runtime 2021-11-30 14:15:56 -08:00
terminator.cpp [flang] Remove *- C++ -* incantation from runtime .cpp files. NFC 2021-09-03 07:17:45 +00:00
terminator.h [flang] Define & implement a lowering support API IsContiguous() in runtime 2021-11-30 14:15:56 -08:00
time-intrinsic.cpp [flang][MSVC] Fix building with `/permissive-` flag 2022-05-24 23:36:04 -05:00
tools.cpp [flang] Change "bad kind" messages in the runtime to "not yet implemented" 2022-05-10 20:08:03 -07:00
tools.h [flang][runtime] Use __float128 where possible & needed in runtime 2022-06-05 09:16:57 -07:00
transformational.cpp [flang][runtime] Fix runtime CSHIFT of rank>1 array case of negative shift count 2022-06-13 11:34:25 -07:00
type-code.cpp [flang][runtime] Fixes for element size calculation. 2022-09-22 10:10:42 -07:00
type-info.cpp [flang] Fix character length calculation for Unicode component 2022-05-23 17:48:12 -07:00
type-info.h [flang] Allow for deferred-length character in EstablishDescriptor 2022-02-14 10:05:07 -08:00
unit-map.cpp [flang][runtime] Catch OPEN of connected file 2022-06-04 11:06:37 -07:00
unit-map.h [flang][runtime] Catch more (all?) negative unit number errors 2022-06-15 17:29:50 -07:00
unit.cpp [flang] Give explicit convert= specifiers precedence over FORT_CONVERT 2022-09-19 20:40:51 -07:00
unit.h [flang][runtime] Handle endian-swapped record headers & footers on input 2022-08-18 15:36:32 -07:00
utf.cpp [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
utf.h [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00