llvm/flang/runtime
Peter Klausler cd03e96f00 [flang] Add & use a better visit() (take 2)
Adds flang/include/flang/Common/log2-visit.h, which defines
a Fortran::common::visit() template function that is a drop-in
replacement for std::visit().  Modifies most use sites in
the front-end and runtime to use common::visit().

The C++ standard mandates that std::visit() have O(1) execution
time, which forces implementations to build dispatch tables.
This new common::visit() is O(log2 N) in the number of alternatives
in a variant<>, but that N tends to be small and so this change
produces a fairly significant improvement in compiler build
memory requirements, a 5-10% improvement in compiler build time,
and a small improvement in compiler execution time.

Building with -DFLANG_USE_STD_VISIT causes common::visit()
to be an alias for std::visit().

Calls to common::visit() with multiple variant arguments
are referred to std::visit(), pending further work.

This change is enabled only for GCC builds with GCC >= 9;
an earlier attempt (D122441) ran into bugs in some versions of
clang and was reverted rather than simply disabled; and it is
not well tested with MSVC. In non-GCC and older GCC builds,
common::visit() is simply an alias for std::visit().
2022-04-16 16:00:48 -07:00
..
allocatable.cpp
assign.cpp
buffer.cpp
buffer.h
character.cpp
CMakeLists.txt [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
command.cpp Fix invalid overflow check in flang 2022-03-30 16:47:33 +02:00
complex-reduction.c
complex-reduction.h
config.h.cmake
connection.cpp [flang] Honor RECL= in list-directed/namelist output 2022-03-02 12:07:18 -08:00
connection.h [flang] Always encode multi-byte output in UTF-8 2022-04-14 11:13:51 -07:00
copy.cpp
copy.h
derived-api.cpp
derived.cpp [flang] Fix extent computation in finalization 2022-03-09 09:01:02 -08:00
derived.h
descriptor-io.cpp
descriptor-io.h [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
descriptor.cpp [flang][runtime] Ensure PointerDeallocate actually deallocate pointers 2022-03-28 10:22:08 +02:00
dot-product.cpp
edit-input.cpp [flang][runtime] Don't skip input spaces when they are significant 2022-04-14 21:30:43 -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] Make F0.1 output editing of zero edge case consistent 2022-04-14 15:31:47 -07:00
edit-output.h [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -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
extrema.cpp [flang] Improve runtime crash messages 2022-03-12 15:15:56 -08:00
file.cpp [flang] Debugging of ACCESS='STREAM' I/O (take 2) 2022-02-04 18:02:34 -08:00
file.h [flang] Debugging of ACCESS='STREAM' I/O (take 2) 2022-02-04 18:02:34 -08:00
findloc.cpp [flang] Improve runtime crash messages 2022-03-12 15:15:56 -08:00
format-implementation.h [flang] Extension: don't require commas between most edit descriptors in formats 2022-03-01 15:15:59 -08:00
format.cpp
format.h [flang] Do not print format tabs 2022-02-23 20:03:10 -08:00
inquiry.cpp [flang] Improve runtime crash messages 2022-03-12 15:15:56 -08:00
internal-unit.cpp [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
internal-unit.h [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
io-api.cpp [flang] add a static assert in CheckUnitNumberInRangeImpl 2022-04-11 09:32:52 +02:00
io-error.cpp [flang] Error recovery improvement in runtime (IOMSG=) 2022-03-18 17:24:32 -07:00
io-error.h [flang] Error recovery improvement in runtime (IOMSG=) 2022-03-18 17:24:32 -07:00
io-stmt.cpp [flang] Add & use a better visit() (take 2) 2022-04-16 16:00:48 -07:00
io-stmt.h [flang] Add & use a better visit() (take 2) 2022-04-16 16:00:48 -07:00
iostat.cpp [flang][runtime] Don't skip input spaces when they are significant 2022-04-14 21:30:43 -07:00
ISO_Fortran_binding.cpp [flang] LBOUND() edge case: empty dimension 2022-03-14 11:16:09 -07:00
lock.h
main.cpp
matmul.cpp
memory.cpp
misc-intrinsic.cpp
namelist.cpp [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
namelist.h
numeric.cpp
pointer.cpp [flang][runtime] Ensure PointerDeallocate actually deallocate pointers 2022-03-28 10:22:08 +02:00
product.cpp
ragged.cpp
random.cpp [flang] Improve runtime crash messages 2022-03-12 15:15:56 -08:00
reduction-templates.h [flang] Improve runtime crash messages 2022-03-12 15:15:56 -08:00
reduction.cpp [flang] Improve runtime crash messages 2022-03-12 15:15:56 -08:00
stat.cpp
stat.h
stop.cpp
sum.cpp
support.cpp
terminator.cpp
terminator.h
time-intrinsic.cpp [flang] Use full result range for clock_gettime implementation of SYSTEM_CLOCK 2022-04-14 13:01:32 -07:00
tools.cpp
tools.h [flang] Allow more concurrently open NEWUNIT= values, with recycling 2022-02-28 16:13:22 -08:00
transformational.cpp [flang] Convert RUNTIME_CHECK to better error for user errors in transformational.cpp 2022-03-18 16:52:43 -07:00
type-code.cpp [flang] Hanlde COMPLEX 2/3/10 in runtime TypeCode(cat, kind) 2022-03-15 09:26:14 +01:00
type-info.cpp [flang] Allow for deferred-length character in EstablishDescriptor 2022-02-14 10:05:07 -08:00
type-info.h [flang] Allow for deferred-length character in EstablishDescriptor 2022-02-14 10:05:07 -08:00
unit-map.cpp [flang] Allow more concurrently open NEWUNIT= values, with recycling 2022-02-28 16:13:22 -08:00
unit-map.h [flang] Allow more concurrently open NEWUNIT= values, with recycling 2022-02-28 16:13:22 -08:00
unit.cpp [flang][runtime] Don't emit empty lines for bad writes 2022-04-15 20:32:32 -07:00
unit.h [flang] Respect left tab limit with Tn editing after ADVANCE='NO' 2022-04-13 21:45:53 -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