[PATCH] D102400: [flang] [openmp] Add Fortran specific semantic check 4 for OpenMP Allocate directive.

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 3 06:15:02 PDT 2021


kiranchandramohan requested changes to this revision.
kiranchandramohan added a comment.
This revision now requires changes to proceed.

The test omp-allocate08.f90 is failing, please check.



================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:663
+  CheckAllowed(llvm::omp::Clause::OMPC_allocator);
+  const auto &allocatorValue{GetIntValue(x.v)};
+  isPredefinedAllocator = !IsAllocatorCustom(*allocatorValue);
----------------
For a predefined allocator, this obtains the integer value corresponding to the allocator. But for a custom allocator a string is obtained now. I believe the GetIntValue can be any random value based on the name of the string. We need to do something different here. (like one of the following)
1) Check whether the Expression contains an int or string before calling GetIntValue. 
2) Change the parsing to place the custom allocator's value in Expr


```
Predefined Allocator
| | | OmpClauseList -> OmpClause -> Allocator -> Scalar -> Integer -> Expr = '1_4'
Custom Allocator
| | | OmpClauseList -> OmpClause -> Allocator -> Scalar -> Integer -> Expr = 'custom_allocator'
```



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102400/new/

https://reviews.llvm.org/D102400



More information about the llvm-commits mailing list