[llvm] [flang][runtime] Another try to fix build failure (PR #143702)

Peter Klausler via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 11 06:34:09 PDT 2025


https://github.com/klausler created https://github.com/llvm/llvm-project/pull/143702

Tweak accessibility to try to get code past whatever gcc is being used by the flang-runtime-cuda-gcc build bot.

>From 13869cac2b5051e453aa96ad71220d9d33404620 Mon Sep 17 00:00:00 2001
From: Peter Klausler <pklausler at nvidia.com>
Date: Wed, 11 Jun 2025 06:32:03 -0700
Subject: [PATCH] [flang][runtime] Another try to fix build failure

Tweak accessibility to try to get code past whatever gcc is being
used by the flang-runtime-cuda-gcc build bot.
---
 .../include/flang-rt/runtime/work-queue.h     | 22 +++++++++++--------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/flang-rt/include/flang-rt/runtime/work-queue.h b/flang-rt/include/flang-rt/runtime/work-queue.h
index f7f4777839836..f8cc820c06ca1 100644
--- a/flang-rt/include/flang-rt/runtime/work-queue.h
+++ b/flang-rt/include/flang-rt/runtime/work-queue.h
@@ -94,7 +94,7 @@ template <typename TICKET> class ImmediateTicketRunner {
 
 // Base class for ticket workers that operate elementwise over descriptors
 class Elementwise {
-protected:
+public:
   RT_API_ATTRS Elementwise(
       const Descriptor &instance, const Descriptor *from = nullptr)
       : instance_{instance}, from_{from} {
@@ -120,6 +120,7 @@ class Elementwise {
     }
   }
 
+protected:
   const Descriptor &instance_, *from_{nullptr};
   std::size_t elements_{instance_.Elements()};
   std::size_t elementAt_{0};
@@ -129,7 +130,7 @@ class Elementwise {
 
 // Base class for ticket workers that operate over derived type components.
 class Componentwise {
-protected:
+public:
   RT_API_ATTRS Componentwise(const typeInfo::DerivedType &);
   RT_API_ATTRS bool IsComplete() const { return componentAt_ >= components_; }
   RT_API_ATTRS void Advance() {
@@ -147,6 +148,7 @@ class Componentwise {
   }
   RT_API_ATTRS void GetComponent();
 
+protected:
   const typeInfo::DerivedType &derived_;
   std::size_t components_{0}, componentAt_{0};
   const typeInfo::Component *component_{nullptr};
@@ -155,8 +157,8 @@ class Componentwise {
 
 // Base class for ticket workers that operate over derived type components
 // in an outer loop, and elements in an inner loop.
-class ComponentsOverElements : protected Componentwise, protected Elementwise {
-protected:
+class ComponentsOverElements : public Componentwise, public Elementwise {
+public:
   RT_API_ATTRS ComponentsOverElements(const Descriptor &instance,
       const typeInfo::DerivedType &derived, const Descriptor *from = nullptr)
       : Componentwise{derived}, Elementwise{instance, from} {
@@ -187,13 +189,14 @@ class ComponentsOverElements : protected Componentwise, protected Elementwise {
     Componentwise::Reset();
   }
 
+protected:
   int phase_{0};
 };
 
 // Base class for ticket workers that operate over elements in an outer loop,
 // type components in an inner loop.
-class ElementsOverComponents : protected Elementwise, protected Componentwise {
-protected:
+class ElementsOverComponents : public Elementwise, public Componentwise {
+public:
   RT_API_ATTRS ElementsOverComponents(const Descriptor &instance,
       const typeInfo::DerivedType &derived, const Descriptor *from = nullptr)
       : Elementwise{instance, from}, Componentwise{derived} {
@@ -219,6 +222,7 @@ class ElementsOverComponents : protected Elementwise, protected Componentwise {
     Elementwise::Advance();
   }
 
+protected:
   int phase_{0};
 };
 
@@ -319,7 +323,7 @@ class AssignTicket : public ImmediateTicketRunner<AssignTicket> {
 template <bool IS_COMPONENTWISE>
 class DerivedAssignTicket
     : public ImmediateTicketRunner<DerivedAssignTicket<IS_COMPONENTWISE>>,
-      protected std::conditional_t<IS_COMPONENTWISE, ComponentsOverElements,
+      private std::conditional_t<IS_COMPONENTWISE, ComponentsOverElements,
           ElementsOverComponents> {
 public:
   using Base = std::conditional_t<IS_COMPONENTWISE, ComponentsOverElements,
@@ -348,7 +352,7 @@ namespace io::descr {
 template <io::Direction DIR>
 class DescriptorIoTicket
     : public ImmediateTicketRunner<DescriptorIoTicket<DIR>>,
-      protected Elementwise {
+      private Elementwise {
 public:
   RT_API_ATTRS DescriptorIoTicket(io::IoStatementState &io,
       const Descriptor &descriptor, const io::NonTbpDefinedIoTable *table,
@@ -372,7 +376,7 @@ class DescriptorIoTicket
 
 template <io::Direction DIR>
 class DerivedIoTicket : public ImmediateTicketRunner<DerivedIoTicket<DIR>>,
-                        protected ElementsOverComponents {
+                        private ElementsOverComponents {
 public:
   RT_API_ATTRS DerivedIoTicket(io::IoStatementState &io,
       const Descriptor &descriptor, const typeInfo::DerivedType &derived,



More information about the llvm-commits mailing list