OmpClauseSet allowed{
OmpClause::IF, OmpClause::MAP, OmpClause::USE_DEVICE_PTR};
SetContextAllowed(allowed);
- OmpClauseSet allowedOnce{OmpClause::DEVICE};
- SetContextAllowedOnce(allowedOnce);
- SetContextRequired(OmpClauseSet{OmpClause::MAP});
+ SetContextAllowedOnce({OmpClause::DEVICE});
+ SetContextRequired({OmpClause::MAP});
} break;
default:
// TODO others
SetContextAllowed(allowed);
OmpClauseSet allowedOnce{OmpClause::DEVICE, OmpClause::IF};
SetContextAllowedOnce(allowedOnce);
- SetContextRequired(OmpClauseSet{OmpClause::MAP});
+ SetContextRequired({OmpClause::MAP});
} break;
case parser::OmpSimpleStandaloneDirective::Directive::TargetExitData: {
// 2.10.3 target-exit-data
SetContextAllowed(allowed);
OmpClauseSet allowedOnce{OmpClause::DEVICE, OmpClause::IF};
SetContextAllowedOnce(allowedOnce);
- SetContextRequired(OmpClauseSet{OmpClause::MAP});
+ SetContextRequired({OmpClause::MAP});
} break;
case parser::OmpSimpleStandaloneDirective::Directive::TargetUpdate: {
// 2.10.5 target-update
}
}
}
+
+ GetContext().requiredClauses.IterateOverMembers(
+ [this](OmpClause c) { CheckRequired(c); });
}
void OmpStructureChecker::Enter(const parser::OmpClause &x) {
if (type != Type::To && type != Type::From && type != Type::Tofrom &&
type != Type::Alloc) {
context_.Say(GetContext().clauseSource,
- "Only the TO, FROM, TOFROM or ALLOC map types are permitted "
+ "Only the TO, FROM, TOFROM, or ALLOC map types are permitted "
"for MAP clauses on the %s directive"_err_en_US,
ContextDirectiveAsFortran());
}
case OmpDirective::TARGET_EXIT_DATA: {
if (type != Type::Delete && type != Type::Release && type != Type::From) {
context_.Say(GetContext().clauseSource,
- "Only the FROM, RELEASE or DELETE map types are permitted "
+ "Only the FROM, RELEASE, or DELETE map types are permitted "
"for MAP clauses on the %s directive"_err_en_US,
ContextDirectiveAsFortran());
}
enddo
!$omp end target
- !ERROR: Only the TO, FROM, TOFROM or ALLOC map types are permitted for MAP clauses on the TARGET directive
+ !ERROR: Only the TO, FROM, TOFROM, or ALLOC map types are permitted for MAP clauses on the TARGET directive
!$omp target map(delete:a)
do i = 1, N
a = 3.14
!ERROR: At most one DEVICE clause can appear on the TARGET EXIT DATA directive
!$omp target exit data map(from:a) device(0) device(1)
- !ERROR: Only the FROM, RELEASE or DELETE map types are permitted for MAP clauses on the TARGET EXIT DATA directive
+ !ERROR: Only the FROM, RELEASE, or DELETE map types are permitted for MAP clauses on the TARGET EXIT DATA directive
!$omp target exit data map(to:a)
end program main