[clang][HIP][OpenMP] Add warning if mixed HIP / OpenMP offloading
authorMichael Halkenhaeuser <MichaelGerald.Halkenhauser@amd.com>
Wed, 22 Mar 2023 09:45:08 +0000 (10:45 +0100)
committerMichael Halkenhaeuser <MichaelGerald.Halkenhauser@amd.com>
Wed, 29 Mar 2023 09:31:17 +0000 (11:31 +0200)
commit55916de2d37742fe334c0726ccf9e584bdaed09f
treeb6626e4aaca6e4ecdaaeeecef8a45f6c7381c5b1
parentf4b2360cecd4c92e85bccb1443f2ef425fc6a77b
[clang][HIP][OpenMP] Add warning if mixed HIP / OpenMP offloading

Adds a warning, issued by the clang semantic analysis, if HIP and OpenMP target offloading is requested concurrently.
That is, if HIP language mode is active but OpenMP target directives are encountered.
Previously, a user might not have been aware that target directives are ignored in such a case.

Generation of this warning is (lit-)tested via "make check-clang-semaopenmp".
The warning can be ignored via "-Wno-hip-omp-target-directives".

Differential Revision: https://reviews.llvm.org/D145591
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaOpenMP.cpp
clang/test/SemaOpenMP/hip-omp-mix.cpp [new file with mode: 0644]