[OpenMP] Fix incorrect diagnostics in map clause
authorKelvin Li <kkwli0@gmail.com>
Mon, 18 Jul 2016 22:49:16 +0000 (22:49 +0000)
committerKelvin Li <kkwli0@gmail.com>
Mon, 18 Jul 2016 22:49:16 +0000 (22:49 +0000)
commit9f645ae63b18be693987b6cc9a764aafc7ece409
tree63083b73448baeb638678549b7b11ac5aab039c1
parentcb2ba5a5a7f2667f7da016b00f9408ae0fccb3f8
[OpenMP] Fix incorrect diagnostics in map clause

Having the following code pattern will result in incorrect diagnostic

int main() {
  int arr[10];
#pragma omp target data map(arr[:])
#pragma omp target map(arr)
  {}
}

t.cpp:4:24: error: original storage of expression in data environment is shared
      but data environment do not fully contain mapped expression storage
#pragma omp target map(arr)
                       ^~~
t.cpp:3:29: note: used here
#pragma omp target data map(arr[:])
                            ^~~~~~
1 error generated.

Patch by David S.

Differential Revision: https://reviews.llvm.org/D22075

llvm-svn: 275926
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