[PATCH] D91373: [OpenMP5.0] Support more kinds of lvalues in map clauses

Jacob Weightman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 12 11:50:06 PST 2020


jacobdweightman created this revision.
jacobdweightman added a reviewer: ABataev.
jacobdweightman added a project: OpenMP.
Herald added subscribers: cfe-commits, guansong, yaxunl.
Herald added a project: clang.
jacobdweightman requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

This patch aims to fully support this change from OpenMP 4.5 to 5.0:

> The to and from clauses on the target update construct (see Section 2.12.6 on page 176), the depend clause on task generating constructs (see Section 2.17.11 on page 255), and the map clause (see Section 2.19.7.1 on page 315) were extended to allow any lvalue expression as a list item for C/C++.

Specifically, support is added for:

- calling functions which return references/constexprs
- cast expressions as part of a larger lvalue expression
- expressions with the ternary Elvis operators (A ? B : C and A ?: C)

This patch modifies Sema to accept such expressions. A few small changes in CodeGen were required to avoid asserts, but CodeGen appeared to already handle such expressions correctly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91373

Files:
  clang/lib/CodeGen/CGOpenMPRuntime.cpp
  clang/lib/Sema/SemaOpenMP.cpp
  clang/test/OpenMP/target_map_messages.cpp
  clang/test/OpenMP/target_parallel_for_map_messages.cpp
  clang/test/OpenMP/target_parallel_for_simd_map_messages.cpp
  clang/test/OpenMP/target_parallel_map_messages.cpp
  clang/test/OpenMP/target_simd_map_messages.cpp
  clang/test/OpenMP/target_teams_distribute_map_messages.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp
  clang/test/OpenMP/target_teams_distribute_simd_map_messages.cpp
  clang/test/OpenMP/target_teams_map_messages.cpp
  clang/test/OpenMP/target_update_from_messages.cpp
  clang/test/OpenMP/target_update_to_messages.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91373.304914.patch
Type: text/x-patch
Size: 68229 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201112/d9350821/attachment-0001.bin>


More information about the cfe-commits mailing list