================
@@ -3321,27 +3321,33 @@ SemaOpenMP::CheckOMPThreadPrivateDecl(SourceLocation
Loc,
}
return D;
}
-
static OMPAllocateDeclAttr::AllocatorTypeTy
getAllocatorKind(Sema &S, DSAStackTy *Stack, Expr *Allocator) {
+ // No allocator expression → Null mem alloc (matches existing tests).
if (!Allocator)
return OMPAllocateDeclAttr::OMPNullMemAlloc;
+
if (Allocator->isTypeDependent() || Allocator->isValueDependent() ||
Allocator->isInstantiationDependent() ||
Allocator->containsUnexpandedParameterPack())
return OMPAllocateDeclAttr::OMPUserDefinedMemAlloc;
+
auto AllocatorKindRes = OMPAllocateDeclAttr::OMPUserDefinedMemAlloc;
+
llvm::FoldingSetNodeID AEId;
const Expr *AE = Allocator->IgnoreParenImpCasts();
- AE->IgnoreImpCasts()->Profile(AEId, S.getASTContext(), /*Canonical=*/true);
+ AE->Profile(AEId, S.getASTContext(), /*Canonical=*/true);
+
for (int I = 0; I < OMPAllocateDeclAttr::OMPUserDefinedMemAlloc; ++I) {
- auto AllocatorKind = static_cast<OMPAllocateDeclAttr::AllocatorTypeTy>(I);
- const Expr *DefAllocator = Stack->getAllocator(AllocatorKind);
+ auto K = static_cast<OMPAllocateDeclAttr::AllocatorTypeTy>(I);
+ const Expr *Def = Stack->getAllocator(K);
----------------
shafik wrote:
Same comment, please keep the old more descriptive name.
https://github.com/llvm/llvm-project/pull/158146
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits