[llvm-branch-commits] [flang] [flang][OpenMP] Use OmpDirectiveSpecification in THREADPRIVATE (PR #159632)

Tom Eccles via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Sep 22 07:26:51 PDT 2025


================
@@ -2611,12 +2611,11 @@ class UnparseVisitor {
   }
   void Unparse(const OpenMPThreadprivate &x) {
     BeginOpenMP();
-    Word("!$OMP THREADPRIVATE (");
-    Walk(std::get<parser::OmpObjectList>(x.t));
-    Put(")\n");
+    Word("!$OMP ");
+    Walk(x.v);
+    Put("\n");
     EndOpenMP();
----------------
tblah wrote:

Not for this PR but I wonder if we could generalise this as more get converted.

A simple approach would be a helper function for all OmpDirectiveSpecification, but I actually wonder if we could manage that automatically with an overload matching a trait in these wrapped classes?

https://github.com/llvm/llvm-project/pull/159632


More information about the llvm-branch-commits mailing list