bool ForceCapturing = false;
CriticalsWithHintsTy Criticals;
- typedef SmallVector<SharingMapTy, 8>::reverse_iterator reverse_iterator;
+ typedef StackTy::reverse_iterator reverse_iterator;
- DSAVarData getDSA(StackTy::reverse_iterator &Iter, ValueDecl *D);
+ DSAVarData getDSA(reverse_iterator &Iter, ValueDecl *D);
/// \brief Checks if the variable is a local for OpenMP region.
- bool isOpenMPLocal(VarDecl *D, StackTy::reverse_iterator Iter);
+ bool isOpenMPLocal(VarDecl *D, reverse_iterator Iter);
bool isStackEmpty() const {
return Stack.empty() ||
/// match specified \a CPred predicate in any directive which matches \a DPred
/// predicate.
DSAVarData hasDSA(ValueDecl *D,
- const llvm::function_ref<bool(OpenMPClauseKind)> &CPred,
- const llvm::function_ref<bool(OpenMPDirectiveKind)> &DPred,
+ const llvm::function_ref<bool(OpenMPClauseKind)> CPred,
+ const llvm::function_ref<bool(OpenMPDirectiveKind)> DPred,
bool FromParent);
/// \brief Checks if the specified variables has data-sharing attributes which
/// match specified \a CPred predicate in any innermost directive which
/// matches \a DPred predicate.
DSAVarData
hasInnermostDSA(ValueDecl *D,
- const llvm::function_ref<bool(OpenMPClauseKind)> &CPred,
- const llvm::function_ref<bool(OpenMPDirectiveKind)> &DPred,
+ const llvm::function_ref<bool(OpenMPClauseKind)> CPred,
+ const llvm::function_ref<bool(OpenMPDirectiveKind)> DPred,
bool FromParent);
/// \brief Checks if the specified variables has explicit data-sharing
/// attributes which match specified \a CPred predicate at the specified
/// OpenMP region.
bool hasExplicitDSA(ValueDecl *D,
- const llvm::function_ref<bool(OpenMPClauseKind)> &CPred,
+ const llvm::function_ref<bool(OpenMPClauseKind)> CPred,
unsigned Level, bool NotLastprivate = false);
/// \brief Returns true if the directive at level \Level matches in the
/// specified \a DPred predicate.
bool hasExplicitDirective(
- const llvm::function_ref<bool(OpenMPDirectiveKind)> &DPred,
+ const llvm::function_ref<bool(OpenMPDirectiveKind)> DPred,
unsigned Level);
/// \brief Finds a directive which matches specified \a DPred predicate.
- bool hasDirective(const llvm::function_ref<bool(OpenMPDirectiveKind,
- const DeclarationNameInfo &,
- SourceLocation)> &DPred,
- bool FromParent);
+ bool hasDirective(
+ const llvm::function_ref<bool(
+ OpenMPDirectiveKind, const DeclarationNameInfo &, SourceLocation)>
+ DPred,
+ bool FromParent);
/// \brief Returns currently analyzed directive.
OpenMPDirectiveKind getCurrentDirective() const {
ValueDecl *VD, bool CurrentRegionOnly,
const llvm::function_ref<
bool(OMPClauseMappableExprCommon::MappableExprComponentListRef,
- OpenMPClauseKind)> &Check) {
+ OpenMPClauseKind)>
+ Check) {
if (isStackEmpty())
return false;
auto SI = Stack.back().first.rbegin();
ValueDecl *VD, unsigned Level,
const llvm::function_ref<
bool(OMPClauseMappableExprCommon::MappableExprComponentListRef,
- OpenMPClauseKind)> &Check) {
+ OpenMPClauseKind)>
+ Check) {
if (isStackEmpty())
return false;
return D;
}
-DSAStackTy::DSAVarData DSAStackTy::getDSA(StackTy::reverse_iterator &Iter,
+DSAStackTy::DSAVarData DSAStackTy::getDSA(reverse_iterator &Iter,
ValueDecl *D) {
D = getCanonicalDecl(D);
auto *VD = dyn_cast<VarDecl>(D);
return DSAVarData();
}
-bool DSAStackTy::isOpenMPLocal(VarDecl *D, StackTy::reverse_iterator Iter) {
+bool DSAStackTy::isOpenMPLocal(VarDecl *D, reverse_iterator Iter) {
D = D->getCanonicalDecl();
if (!isStackEmpty()) {
reverse_iterator I = Iter, E = Stack.back().first.rend();
DSAStackTy::DSAVarData DSAStackTy::getImplicitDSA(ValueDecl *D,
bool FromParent) {
if (isStackEmpty()) {
- StackTy::reverse_iterator I;
+ reverse_iterator I;
return getDSA(I, D);
}
D = getCanonicalDecl(D);
DSAStackTy::DSAVarData
DSAStackTy::hasDSA(ValueDecl *D,
- const llvm::function_ref<bool(OpenMPClauseKind)> &CPred,
- const llvm::function_ref<bool(OpenMPDirectiveKind)> &DPred,
+ const llvm::function_ref<bool(OpenMPClauseKind)> CPred,
+ const llvm::function_ref<bool(OpenMPDirectiveKind)> DPred,
bool FromParent) {
if (isStackEmpty())
return {};
}
DSAStackTy::DSAVarData DSAStackTy::hasInnermostDSA(
- ValueDecl *D, const llvm::function_ref<bool(OpenMPClauseKind)> &CPred,
- const llvm::function_ref<bool(OpenMPDirectiveKind)> &DPred,
+ ValueDecl *D, const llvm::function_ref<bool(OpenMPClauseKind)> CPred,
+ const llvm::function_ref<bool(OpenMPDirectiveKind)> DPred,
bool FromParent) {
if (isStackEmpty())
return {};
}
bool DSAStackTy::hasExplicitDSA(
- ValueDecl *D, const llvm::function_ref<bool(OpenMPClauseKind)> &CPred,
+ ValueDecl *D, const llvm::function_ref<bool(OpenMPClauseKind)> CPred,
unsigned Level, bool NotLastprivate) {
if (isStackEmpty())
return false;
}
bool DSAStackTy::hasExplicitDirective(
- const llvm::function_ref<bool(OpenMPDirectiveKind)> &DPred,
- unsigned Level) {
+ const llvm::function_ref<bool(OpenMPDirectiveKind)> DPred, unsigned Level) {
if (isStackEmpty())
return false;
auto StartI = Stack.back().first.begin();
bool DSAStackTy::hasDirective(
const llvm::function_ref<bool(OpenMPDirectiveKind,
const DeclarationNameInfo &, SourceLocation)>
- &DPred,
+ DPred,
bool FromParent) {
// We look only in the enclosing region.
if (isStackEmpty())
};
} // namespace
-template <typename T>
-static T filterLookupForUDR(SmallVectorImpl<UnresolvedSet<8>> &Lookups,
- const llvm::function_ref<T(ValueDecl *)> &Gen) {
+template <typename T, typename U>
+static T filterLookupForUDR(SmallVectorImpl<U> &Lookups,
+ const llvm::function_ref<T(ValueDecl *)> Gen) {
for (auto &Set : Lookups) {
for (auto *D : Set) {
if (auto Res = Gen(cast<ValueDecl>(D)))