This is a work in progress
Some comments about this patch:
There seem to be a few issues with the parser.
Currently for this fortran code:
!$omp allocate(zarray) allocator(omp_const_mem_alloc) !$omp allocate(z) allocator(omp_large_cap_mem_alloc) !$omp allocate(a) allocator(omp_default_mem_alloc) !$omp allocate allocate ( zarray(z,t) )
The parse tree looks like this:
| | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPDeclarativeAllocate | | | Verbatim | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'zarray' | | | OmpClauseList -> OmpClause -> Allocator -> Scalar -> Integer -> Expr = '1_4' | | | | Designator -> DataRef -> Name = 'omp_const_mem_alloc' | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPDeclarativeAllocate | | | Verbatim | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'z' | | | OmpClauseList -> OmpClause -> Allocator -> Scalar -> Integer -> Expr = '1_4' | | | | Designator -> DataRef -> Name = 'omp_large_cap_mem_alloc' | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPDeclarativeAllocate | | | Verbatim | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'a' | | | OmpClauseList -> OmpClause -> Allocator -> Scalar -> Integer -> Expr = '1_4' | | | | Designator -> DataRef -> Name = 'omp_default_mem_alloc' | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPExecutableAllocate
Whereas it should look something like this.
| | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPExecutableAllocate | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPDeclarativeAllocate | | | | Verbatim | | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'zarray' | | | | OmpClauseList -> OmpClause -> Allocator -> Scalar -> Integer -> Expr = '1_4' | | | | | Designator -> DataRef -> Name = 'omp_const_mem_alloc' | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPDeclarativeAllocate | | | | Verbatim | | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'z' | | | | OmpClauseList -> OmpClause -> Allocator -> Scalar -> Integer -> Expr = '1_4' | | | | | Designator -> DataRef -> Name = 'omp_large_cap_mem_alloc' | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPDeclarativeAllocate | | | | Verbatim | | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'a' | | | | OmpClauseList -> OmpClause -> Allocator -> Scalar -> Integer -> Expr = '1_4' | | | | | Designator -> DataRef -> Name = 'omp_default_mem_alloc'
This is affecting the Semantic checks as the list of OpenMPDeclarativeAllocate will always be empty, since they come before the OpenMPExecutableAllocate.
Test also need to be added.
This functioned is removed and a different one is reused In the General Semantic Checks patch. This should be taken care of after a rebase.