================
@@ -1680,40 +1710,92 @@ void OmpStructureChecker::Leave(const
parser::OpenMPRequiresConstruct &) {
dirContext_.pop_back();
}
-void OmpStructureChecker::Enter(const parser::OpenMPDeclarativeAllocate &x) {
- isPredefinedAllocator = true;
- const auto &dir{std::get<parser::Verbatim>(x.t)};
- const auto &objectList{std::get<parser::OmpObjectList>(x.t)};
- PushContextAndClauseSets(dir.source, llvm::omp::Directive::OMPD_allocate);
- SymbolSourceMap currSymbols;
- GetSymbolsInObjectList(objectList, currSymbols);
- for (auto &[symbol, source] : currSymbols) {
- if (IsPointer(*symbol)) {
+void OmpStructureChecker::CheckAllocateDirective(parser::CharBlock source,
+ const parser::OmpObjectList &objects,
+ const parser::OmpClauseList &clauses) {
+ const Scope &thisScope{context_.FindScope(source)};
+ SymbolSourceMap symbols;
+ GetSymbolsInObjectList(objects, symbols);
+
+ auto hasPredefinedAllocator{[&](const parser::OmpClause *c) {
+ if (!c) {
+ return std::make_optional(false);
+ }
+ auto *allocator{std::get_if<parser::OmpClause::Allocator>(&c->u)};
+ if (auto val{ToInt64(GetEvaluateExpr(allocator->v))}) {
+ // Predefined allocators:
----------------
kparzysz wrote:
Done
https://github.com/llvm/llvm-project/pull/164420
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits