[flang-commits] [flang] [flang][OpenMP][NFC] Hoist variant match-info construction into Semantics (PR #204387)
Abid Qadeer via flang-commits
flang-commits at lists.llvm.org
Wed Jun 24 03:38:10 PDT 2026
abidh wrote:
> * Have you tried using LLVM idioms/utilities in your code? I am not sure if this is standard practice in flang.
> * Have you been able to run LLVM test suite runs.
> * Why have you not added test cases for all the scenarios of declare variant that are being supported? If you have individual test cases then adopt them into llvm-lit.
Thanks for the review. This PR is a pure NFC refactor, it hoists the existing variant match-info construction out of Lower/OpenMP into a shared Semantics/openmp-utils helper. The purpose is to share code between existing metadirective and future declare variant work. There's no new functionality or behavior change:
LLVM idioms/utilities: Yes. The moved code keeps using the standard utilities — llvm::SmallVector, the llvm::omp::* trait/context types (VariantMatchInfo, TraitSet, etc.), std::variant visitation, and CHECK for invariants. If you spot a specific line where a different helper reads better, happy to adjust.
Testing: I run ninja check-flang and all of flang tests pass. GitHub CI runs the flang test suite on every commit pushed here, so behavior changes would surface automatically.
New test cases: Since this is NFC with no new behavior, no new tests are added. The declare variant functionality itself, with its dedicated tests, will come in the separate PRs.
Happy to expand on any of these if something specific looks off.
https://github.com/llvm/llvm-project/pull/204387
More information about the flang-commits
mailing list