ABataev added inline comments.

================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:6181-6190
+      checkNestingOfRegions(*this, DSAStack, Kind, DirName, CancelRegion,
+                            BindKind, StartLoc);
       Kind = OMPD_for;
       DSAStack->setCurrentDirective(OMPD_for);
       DSAStack->setMappedDirective(OMPD_loop);
       PrevMappedDirective = OMPD_loop;
       break;
----------------
koops wrote:
> ABataev wrote:
> > Need to drop these extra calls of checkNestingOfRegions(), all check must 
> > be handled in the single call. Can we do it?
> 1) Default binding in "#pragma omp loop" is handled in the beginning of 
> mapLoopConstruct.
> #pragma omp parallel
> ....
> #pragma omp loop
> ...
> indicates "omp loop" will be "omp loop bind(parallel)". So, I cannot call 
> checkNestingOfRegions() before call to mapLoopConstruct()
> 2) In mapLoopConstruct the directive/construct of "omp loop" is changed to 
> other directives like "omp for". So, it is not possible to call 
> checkNestingOfRegions() after the call to mapLoopConstruct.
> Because of the above 2 reasons the current code seems correct. Please let me 
> know if you have any alternative in mind.
Can you perform mapLoopConstruct earlier, before  the very first 
checkNestingOfRegions()? Current code structure ovrcomplicates the code, makes 
it much harder to understand and to maintain


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158266/new/

https://reviews.llvm.org/D158266

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to