[flang-commits] [flang] [flang][OpenMP]Add symbls omp_in, omp_out and omp_priv in DECLARE RED… (PR #129908)
Kiran Chandramohan via flang-commits
flang-commits at lists.llvm.org
Fri Mar 7 08:56:18 PST 2025
================
@@ -1761,11 +1770,26 @@ void OmpVisitor::ProcessReductionSpecifier(
// Creating a new scope in case the combiner expression (or clauses) use
// reerved identifiers, like "omp_in". This is a temporary solution until
// we deal with these in a more thorough way.
- PushScope(Scope::Kind::OtherConstruct, nullptr);
- Walk(std::get<parser::OmpTypeNameList>(spec.t));
- Walk(std::get<std::optional<parser::OmpReductionCombiner>>(spec.t));
- Walk(clauses);
- PopScope();
+ auto &typeList = std::get<parser::OmpTypeNameList>(spec.t);
+ for (auto &t : typeList.v) {
+ PushScope(Scope::Kind::OtherConstruct, nullptr);
+ BeginDeclTypeSpec();
+ // We need to walk t.u because Walk(t) does it's own BeginDeclTypeSpec.
+ Walk(t.u);
+
+ auto *typeSpec = GetDeclTypeSpec();
+ assert(typeSpec && "We should have a type here");
+ const parser::CharBlock ompVarNames[] = {
+ {"omp_in", 6}, {"omp_out", 7}, {"omp_priv", 8}};
----------------
kiranchandramohan wrote:
I think it will be good to comment on what you are trying to do here. Are you trying to create as many sets of symbols as there are in the typeList? And you chose to do it here because this is where the typeList is processed?
Also, if these symbols are not tied to names, what is the use of these symbols?
It will be good to not generate symbols that are not required.
https://github.com/llvm/llvm-project/pull/129908
More information about the flang-commits
mailing list