This patch adds semantics checks for REQUIRES directives appearing after other directives that are affected by them. In particular, it adds checks for device constructs appearing after device-related REQUIRES directives and for the atomic_default_mem_order clause appearing after atomic operations where the memory order is not explicitly specified.
This is patch 2/5 of a series splitting D149337 to simplify review.
Depends on D157710.
Nit: Add a comment here that this for combined constructs having target and loop.