[PATCH] D86051: [flang]Add Semantic Checks for OpenMP Allocate Clause
Kiran Chandramohan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 20 09:53:30 PDT 2020
kiranchandramohan added a comment.
Thanks Rin for making the changes. A few more comments.
================
Comment at: flang/lib/Semantics/resolve-directives.cpp:231
bool Pre(const parser::OpenMPBlockConstruct &);
- void Post(const parser::OpenMPBlockConstruct &) { PopContext(); }
+ void Post(const parser::OpenMPBlockConstruct &) {
+ std::set<SymbolRef>::iterator it = allocateObjects_.begin();
----------------
Do all OpenMPBlockConstructs have allocate clause?
If not should we restrict this check to only those OpenMPBlockConstructs which have allocate clause?
================
Comment at: flang/lib/Semantics/resolve-directives.cpp:306
+ SymbolSet allocateObjects_;
+ void AddAllocateObject(SymbolRef object) { allocateObjects_.insert(object); }
+
----------------
Is a line required above?
================
Comment at: flang/lib/Semantics/resolve-directives.cpp:335-337
+ (object.test(Symbol::Flag::OmpPrivate) ||
+ object.test(Symbol::Flag::OmpFirstPrivate) ||
+ object.test(Symbol::Flag::OmpLastPrivate))) {
----------------
Can this check be done before the find on dataSharingAttributeObjects?
================
Comment at: flang/test/Semantics/omp-resolve06.f90:17
+ !$omp end parallel
+end
----------------
We need more error tests.
Use a mix of firstprivate, lastprivate + allocate and private with same and different variables.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86051/new/
https://reviews.llvm.org/D86051
More information about the llvm-commits
mailing list