[OpenMP][Clang] Allow ancestor device modifier only with reverse offloading
authorSaiyedul Islam <Saiyedul.Islam@amd.com>
Thu, 3 Feb 2022 11:28:04 +0000 (11:28 +0000)
committerSaiyedul Islam <Saiyedul.Islam@amd.com>
Fri, 4 Feb 2022 12:10:14 +0000 (12:10 +0000)
commitae9c0740648fd8f7010c895ddcf78380da94dd57
tree00ccb4575db54353751f560d46f6ae7b2b1634e3
parentb82da8b555603b172f826fdd5ea902eff3aeb7ad
[OpenMP][Clang] Allow ancestor device modifier only with reverse offloading

OpenMP Spec 5.0 [2.12.5, Restrictions]: If a device clause in which the
ancestor device-modifier appears is present on the target construct,
then a requires directive with the reverse_offload clause must be
specified.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D118887
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaOpenMP.cpp
clang/test/OpenMP/target_ast_print.cpp
clang/test/OpenMP/target_device_ancestor_messages.cpp [new file with mode: 0644]
clang/test/OpenMP/target_device_codegen.cpp