[all-commits] [llvm/llvm-project] 564035: [flang][OpenMP] Organize `genOMP` functions in Ope...

Krzysztof Parzyszek via All-commits all-commits at lists.llvm.org
Mon Mar 25 07:54:27 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 564035edb0e67a177fd911fc779cd64300a9b5ef
      https://github.com/llvm/llvm-project/commit/564035edb0e67a177fd911fc779cd64300a9b5ef
  Author: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
  Date:   2024-03-25 (Mon, 25 Mar 2024)

  Changed paths:
    M flang/lib/Lower/OpenMP/OpenMP.cpp

  Log Message:
  -----------
  [flang][OpenMP] Organize `genOMP` functions in OpenMP.cpp, NFC (#86309)

Put all of the genOMP functions together, organize them in two groups:
for declarative constructs and for other (executable) constructs.

Replace visit functions for OpenMPDeclarativeConstruct and
OpenMPConstruct from listing individual visitors for each variant
alternative to using a single generic visitor. Essentially, going from
```
  std::visit(
    [](foo x) { genOMP(foo); }
    [](bar x) { TODO }
    [](baz x) { genOMP(baz); }
  )
```
to
```
void genOMP(bar x) {  // Separate visitor for an unhandled case
  TODO
}

[...]
  std::visit([&](auto &&s) { genOMP(s); })  // generic
```

This doesn't change any functionality, just reorganizes the functions a
bit. The intent here is to improve the readability of this file.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list