[OPENMP]Fix PR49698: OpenMP declare mapper causes segmentation fault.
authorAlexey Bataev <a.bataev@outlook.com>
Fri, 16 Apr 2021 18:29:01 +0000 (11:29 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Wed, 21 Apr 2021 17:38:31 +0000 (10:38 -0700)
commit079884225a5571f4caf1a9c71b6748db8192e383
tree557f33e2491ed6d78106178f2f3b3927bc941f00
parent4cbe4881882edd64a7ff53da52970c4b6333de1c
[OPENMP]Fix PR49698: OpenMP declare mapper causes segmentation fault.

The implicitly generated mappings for allocation/deallocation in mappers
runtime should be mapped as implicit, also no need to clear member_of
flag to avoid ref counter increment. Also, the ref counter should not be
incremented for the very first element that comes from the mapper
function.

Differential Revision: https://reviews.llvm.org/D100673
clang/lib/CodeGen/CGOpenMPRuntime.cpp
clang/test/OpenMP/declare_mapper_codegen.cpp
openmp/libomptarget/src/omptarget.cpp
openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_array.cpp [new file with mode: 0644]
openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_array_subscript.cpp [new file with mode: 0644]
openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_complex_structure.cpp [new file with mode: 0644]
openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_ptr_subscript.cpp [new file with mode: 0644]
openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_var.cpp [new file with mode: 0644]