[gcc/devel/omp/gcc-16] libgomp: Prototype "accel" 'build_indirect_map' in new 'target-indirect.h'

Sandra Loosemore via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:5c0817b0ff47423bd21460f2006788b15e2daf5a

commit 5c0817b0ff47423bd21460f2006788b15e2daf5a
Author: Thomas Schwinge <[email protected]>
Date:   Mon May 11 21:58:30 2026 +0200

    libgomp: Prototype "accel" 'build_indirect_map' in new 'target-indirect.h'
    
    ..., instead of repeating 'extern' prototypes in all "accel" 'team.c'
    files, as done in commit a49c7d3193bb0fd5589e12e725f5a130725ae171
    "openmp: Add support for the 'indirect' clause in C/C++".
    
            libgomp/
            * config/accel/target-indirect.h: New.
            * config/accel/target-indirect.c: Adjust.
            * config/gcn/team.c: Likewise.
            * config/nvptx/team.c: Likewise.
    
    (cherry picked from commit 187f26743786ef0e3920af000aab03afc8607a50)

Diff:
---
 libgomp/config/accel/target-indirect.c |  1 +
 libgomp/config/accel/target-indirect.h | 32 ++++++++++++++++++++++++++++++++
 libgomp/config/gcn/team.c              |  2 +-
 libgomp/config/nvptx/team.c            |  2 +-
 4 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/libgomp/config/accel/target-indirect.c b/libgomp/config/accel/target-indirect.c
index 39d713d913ef..475cd528a49e 100644
--- a/libgomp/config/accel/target-indirect.c
+++ b/libgomp/config/accel/target-indirect.c
@@ -26,6 +26,7 @@
 
 #include <assert.h>
 #include "libgomp.h"
+#include "target-indirect.h"
 
 void *GOMP_INDIRECT_ADDR_MAP = NULL;
 
diff --git a/libgomp/config/accel/target-indirect.h b/libgomp/config/accel/target-indirect.h
new file mode 100644
index 000000000000..d384e6acf48e
--- /dev/null
+++ b/libgomp/config/accel/target-indirect.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 2023-2026 Free Software Foundation, Inc.
+
+   This file is part of the GNU Offloading and Multi Processing Library
+   (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
+   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+   FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+   more details.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef GOMP_TARGET_INDIRECT_H
+#define GOMP_TARGET_INDIRECT_H 1
+
+#include "libgomp.h"
+
+extern void build_indirect_map (void);
+
+#endif /* GOMP_TARGET_INDIRECT_H */
diff --git a/libgomp/config/gcn/team.c b/libgomp/config/gcn/team.c
index 1ca4c6b1266a..c368aa37a475 100644
--- a/libgomp/config/gcn/team.c
+++ b/libgomp/config/gcn/team.c
@@ -27,6 +27,7 @@
 #include <assert.h>
 
 #include "libgomp.h"
+#include "target-indirect.h"
 #include <stdlib.h>
 #include <string.h>
 
@@ -41,7 +42,6 @@ extern void *GOMP_INDIRECT_ADDR_MAP;
 void __gcn_lowlat_init (void *heap, size_t size);
 
 static void gomp_thread_start (struct gomp_thread_pool *);
-extern void build_indirect_map (void);
 
 /* This externally visible function handles target region entry.  It
    sets up a per-team thread pool and transfers control by returning to
diff --git a/libgomp/config/nvptx/team.c b/libgomp/config/nvptx/team.c
index 39c8e8598b4d..50641ce50ce6 100644
--- a/libgomp/config/nvptx/team.c
+++ b/libgomp/config/nvptx/team.c
@@ -28,6 +28,7 @@
 #if defined __nvptx_softstack__ && defined __nvptx_unisimt__
 
 #include "libgomp.h"
+#include "target-indirect.h"
 #include <stdlib.h>
 #include <string.h>
 
@@ -39,7 +40,6 @@ struct gomp_thread *nvptx_thrs __attribute__((shared,nocommon));
 int __gomp_team_num __attribute__((shared,nocommon));
 
 static void gomp_thread_start (struct gomp_thread_pool *);
-extern void build_indirect_map (void);
 
 /* There should be some .shared space reserved for us.  There's no way to
    express this magic extern sizeless array in C so use asm.  */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.