llvm-project/flang/lib/Semantics
Peter Klausler 2ab9990c9e [flang] Add & use a better visit()
Adds flang/include/flang/Common/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.

Differential Revision: https://reviews.llvm.org/D122441
2022-03-25 13:15:20 -07:00
..
CMakeLists.txt [flang] Save binding labels as strings 2021-03-24 11:25:23 -07:00
assignment.cpp [flang][nfc] Fix comments, remove needless API, tweak script 2021-01-22 10:55:53 -08:00
assignment.h
attr.cpp
canonicalize-acc.cpp [flang] Add clang-tidy check for braces around if 2021-06-16 09:13:53 +00:00
canonicalize-acc.h [flang][openacc] Semantic checks for OpenACC 3.0 clauses validity 2020-07-14 20:44:35 -04:00
canonicalize-do.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
canonicalize-do.h
canonicalize-omp.cpp
canonicalize-omp.h
check-acc-structure.cpp [flang] Add clang-tidy check for braces around if 2021-06-16 09:13:53 +00:00
check-acc-structure.h [flang][directive] Enforce basic semantic check for all clauses 2021-02-01 13:33:30 -05:00
check-allocate.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
check-allocate.h
check-arithmeticif.cpp
check-arithmeticif.h
check-call.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
check-call.h [flang] Fix generic resolution case 2021-10-22 13:38:47 -07:00
check-case.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
check-case.h
check-coarray.cpp [flang] Support for image selectors 2020-07-08 07:31:54 -07:00
check-coarray.h [flang] Support for image selectors 2020-07-08 07:31:54 -07:00
check-data.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
check-data.h [flang] Implement semantics for DEC STRUCTURE/RECORD 2022-01-13 13:17:13 -08:00
check-deallocate.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
check-deallocate.h
check-declarations.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
check-declarations.h [flang] Improve initializer semantics, esp. for component default values 2020-12-07 14:40:41 -08:00
check-directive-structure.h The device expression must evaluate to a non-negative integer value. 2022-02-13 16:51:19 +05:30
check-do-forall.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
check-do-forall.h
check-if-stmt.cpp
check-if-stmt.h
check-io.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
check-io.h [flang] Catch I/O of bad derived type at compile time 2022-02-28 15:40:12 -08:00
check-namelist.cpp
check-namelist.h
check-nullify.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
check-nullify.h
check-omp-structure.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
check-omp-structure.h Added OpenMP 5.0 specification based semantic checks for atomic update construct 2022-01-24 13:24:00 +05:30
check-purity.cpp
check-purity.h
check-return.cpp [flang] Distinguish usage and portability warning messages 2022-03-08 17:24:52 -08:00
check-return.h
check-select-rank.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
check-select-rank.h
check-select-type.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
check-select-type.h
check-stop.cpp
check-stop.h
compute-offsets.cpp [flang][NFC] rename IsKindParameterizedDerivedType and fix comment typos 2022-03-11 19:03:27 +01:00
compute-offsets.h [flang] Implement STORAGE_SIZE(), SIZEOF(), C_SIZEOF() 2020-12-15 17:26:20 -08:00
data-to-inits.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
data-to-inits.h [flang] Implement semantics for DEC STRUCTURE/RECORD 2022-01-13 13:17:13 -08:00
expression.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
mod-file.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
mod-file.h [flang] Distinguish intrinsic from non-intrinsic modules 2022-01-31 13:31:27 -08:00
pointer-assignment.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
pointer-assignment.h [flang] DATA stmt processing (part 3/4): Remaining prep work 2020-06-19 09:09:05 -07:00
program-tree.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
program-tree.h [flang] Fix edge case in USE-associated generics 2022-02-11 16:55:05 -08:00
resolve-directives.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
resolve-directives.h [flang][NFC] Extract name resolution for OpenACC & OpenMP into new file 2020-07-28 16:38:36 -07:00
resolve-labels.cpp [flang] Distinguish usage and portability warning messages 2022-03-08 17:24:52 -08:00
resolve-labels.h
resolve-names-utils.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
resolve-names-utils.h [flang] Add nonfatal message classes 2022-03-08 11:40:45 -08:00
resolve-names.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
resolve-names.h [flang] Distinguish intrinsic from non-intrinsic modules 2022-01-31 13:31:27 -08:00
rewrite-parse-tree.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
rewrite-parse-tree.h
runtime-type-info.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
scope.cpp [flang][NFC] rename IsKindParameterizedDerivedType and fix comment typos 2022-03-11 19:03:27 +01:00
semantics.cpp [flang] Distinguish usage and portability warning messages 2022-03-08 17:24:52 -08:00
symbol.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
tools.cpp [flang] Add & use a better visit() 2022-03-25 13:15:20 -07:00
type.cpp [flang] Allow DATA initialization of derived types w/ allocatable components 2022-02-14 10:43:49 -08:00
unparse-with-symbols.cpp [flang][openacc] Basic name resolution infrastructure for OpenACC construct 2020-07-26 20:01:35 -04:00