ABataev added inline comments.
================
Comment at: lib/Sema/SemaOpenMP.cpp:358-360
+ /// Do the check specified in \a Check to all component lists at a given
level
+ /// and return true if any issue is found.
+ bool checkMappableExprComponentListsForDeclAtLevel(
----------------
gtbercea wrote:
> ABataev wrote:
> > Could you join these 2 functions into one?
> Since SI and StarI use different types of iterations the functions cannot be
> merged.
I still believe you can reuse this new code:
```
bool checkMappableExprComponentListsForDecl(
ValueDecl *VD, bool CurrentRegionOnly,
const llvm::function_ref<
bool(OMPClauseMappableExprCommon::MappableExprComponentListRef,
OpenMPClauseKind)> &Check) {
if (Stack.empty())
return false;
if (CurrentRegionOnly)
return checkMappableExprComponentListsForDeclAtLevel(VD, Stack.size() -
1, Check);
for (unsigned I = Stack.size(); I > 0; --I)
if (checkMappableExprComponentListsForDeclAtLevel(VD, I - 1, Check))
return true;
return false;
}
```
or something like this.
Repository:
rL LLVM
https://reviews.llvm.org/D29905
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits