Name resolution was probably failing in bug reported at
https://bugs.llvm.org/show_bug.cgi?id=48145
as the omp critical construct needs a new symbol for the name which was
missing. This is fixed by creating a new symbol during name resolution
for a new flag OmpCriticalLock.
Upgrade to OMP-5.0 standard.
Checks for restrictions from OMP-5.0 are added.
- If a name is specified on a critical directive, the same name must also be specified on the
end critical directive.
- If no name appears on the critical directive, no name can appear on the end critical
directive.
- Unless the effect is as if hint(omp_sync_hint_none) was specified, the critical
construct must specify a name.
A new routine CheckNameMatching mostly follows CheckEndName from resolve-labels.cpp.
Can you use parser::Unwrap<parser::Name> to simplify the code?