This is to fix run time problem when use:
int **a;
map((*a)[:3]) or (*a)[1].
current we skip generate map info for dereference pointer:
&(*a), &(*a)[0], 3*sizeof(int), TARGET_PARAM | TO | FROM
One way to fix runtime problem is to generate map info for dereference
pointer.
&(*a), &(*a), sizeof(pointer), ALLOC | TARGET_PARAM
&(*a), &(*a)[0], 3*sizeof(int), PTR_AND_OBJ | TO | FROM
The change in CGOpenMPRuntime.cpp add that.
The change in SemaOpenMP is to fix variable of dereference pointer to array
captured by reference. That is wrong. That cause run time to fail.
The rule is:
If variable is identified in a map clause it is always captured by
reference except if it is a pointer that is dereferenced somehow.
What if we have something like:
? Shall it work? I.e. mapping of the whole array by dereferening the pointer to the array.