Add map info for dereference pointer.
This is to fix run time problem when use: int **a; map((*a)[:3]), (*a)[1] or map(**a). 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. map((*a)[:3]): &(*a), &(*a), sizeof(pointer), TARGET_PARAM | TO | FROM &(*a), &(*a)[0], 3*sizeof(int), PTR_AND_OBJ | TO | FROM map(**a): &(*a), &(*a), sizeof(pointer), TARGET_PARAM | TO | FROM &(*a), &(**a), 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. Differential Revision: https://reviews.llvm.org/D145093
Loading
Please sign in to comment