This patch adds semantic checks for the General Restrictions of the Allocate Directive.
Since the requires directive is not yet implemented in Flang, the restriction
"allocate directives that appear in a target region must specify an allocator clause unless a requires directive with the dynamic_allocators clause is present in the same compilation unit"
will need to be updated at a later time.
A different patch will be made with the Fortran specific restrictions of this directive.
I have used the code from https://reviews.llvm.org/D89395 for the CheckObjectListStructure function.
Can you post another patch without these conflicts?