[OpenMP] Fix C-only clang assert on parsing use_allocator clause of target directive
authorAlexey Bataev <a.bataev@outlook.com>
Mon, 14 Jun 2021 17:04:59 +0000 (10:04 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Mon, 14 Jun 2021 17:36:27 +0000 (10:36 -0700)
commit44f197e94b83d389b59ce6a2a1977f972e6d34e3
tree4397a4ada63aee5211fcba571e7179cffb3998ae
parent863184dd6920a65dd122603be7e595bc88d89e8b
[OpenMP] Fix C-only clang assert on parsing use_allocator clause of target directive

The parser code assumes building with C++ compiler and asserts when using clang (not clang++) on C file. I made the code dependent on input language. This shows up for amdgpu target.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D103899
clang/lib/Parse/ParseOpenMP.cpp
clang/test/OpenMP/target_uses_allocators.c [new file with mode: 0644]