[PATCH] D114941: [flang][OpenMP] Add some semantic checks for threadprivate and declare target directives
Kiran Chandramohan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 4 05:36:43 PST 2022
kiranchandramohan accepted this revision.
kiranchandramohan added a comment.
LGTM.
In D114941#3214619 <https://reviews.llvm.org/D114941#3214619>, @shraiysh wrote:
> @peixin I think we can merge this to make progress and if Kiran has any post-commit comments, we can address them later.
+1
================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:1479-1480
+ context_.Say(name.source,
+ "A THREADPRIVATE variable cannot be in %s "
+ "clause"_err_en_US,
+ parser::ToUpperCaseLetters(
----------------
peixin wrote:
> shraiysh wrote:
> > This same error is reported above too. Can you please explain why there is a duplication of code and if possible, can we merge the objects on which this has loop has to run (`mem` and `name`) and run this loop only once?
> This is not duplication. The std::visit walks along the parse-tree from "ompObject.u". The "parse::Name" is for common block, and "parser::Designator" is for scalar, array, and so on. This is defined in parse-tree. You can write one simple correct example, and dump the parse-tree with the option "-fdebug-dump-parse-tree" to check it.
One trivial code-sharing will be to have a lambda that, given a symbol, tests the Threadprivate flag and prints the error.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114941/new/
https://reviews.llvm.org/D114941
More information about the llvm-commits
mailing list