Skip to content

[libc][GPU] clean up includes #143203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 6, 2025

Conversation

michaelrj-google
Copy link
Contributor

The GPU stdio functions were depending on indirect inclusion for some of
their dependencies. This patch should fix all of that.

The GPU stdio functions were depending on indirect inclusion for some of
their dependencies. This patch should fix all of that.
@llvmbot llvmbot added the libc label Jun 6, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 6, 2025

@llvm/pr-subscribers-libc

Author: Michael Jones (michaelrj-google)

Changes

The GPU stdio functions were depending on indirect inclusion for some of
their dependencies. This patch should fix all of that.


Full diff: https://github.com/llvm/llvm-project/pull/143203.diff

32 Files Affected:

  • (modified) libc/src/stdio/gpu/CMakeLists.txt (+7-2)
  • (modified) libc/src/stdio/gpu/clearerr.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/fclose.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/feof.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/ferror.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/fflush.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/fgetc.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/fgets.cpp (+4-5)
  • (modified) libc/src/stdio/gpu/file.h (+2-5)
  • (modified) libc/src/stdio/gpu/fopen.cpp (+3-3)
  • (modified) libc/src/stdio/gpu/fprintf.cpp (+1)
  • (modified) libc/src/stdio/gpu/fputc.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/fputs.cpp (+3-4)
  • (modified) libc/src/stdio/gpu/fread.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/fseek.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/ftell.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/fwrite.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/getc.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/getchar.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/printf.cpp (+1)
  • (modified) libc/src/stdio/gpu/putc.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/putchar.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/puts.cpp (+5-6)
  • (modified) libc/src/stdio/gpu/remove.cpp (+3-2)
  • (modified) libc/src/stdio/gpu/rename.cpp (+3-3)
  • (modified) libc/src/stdio/gpu/stderr.cpp (+1-1)
  • (modified) libc/src/stdio/gpu/stdin.cpp (+1-1)
  • (modified) libc/src/stdio/gpu/stdout.cpp (+1-1)
  • (modified) libc/src/stdio/gpu/ungetc.cpp (+2-2)
  • (modified) libc/src/stdio/gpu/vfprintf.cpp (+1-1)
  • (modified) libc/src/stdio/gpu/vfprintf_utils.h (+1-1)
  • (modified) libc/src/stdio/gpu/vprintf.cpp (+1-1)
diff --git a/libc/src/stdio/gpu/CMakeLists.txt b/libc/src/stdio/gpu/CMakeLists.txt
index c4ad333e25163..bea1134092633 100644
--- a/libc/src/stdio/gpu/CMakeLists.txt
+++ b/libc/src/stdio/gpu/CMakeLists.txt
@@ -59,6 +59,7 @@ add_entrypoint_object(
   DEPENDS
     libc.hdr.types.FILE
     libc.src.__support.RPC.rpc_client
+    .gpu_file
 )
 
 add_entrypoint_object(
@@ -70,6 +71,7 @@ add_entrypoint_object(
   DEPENDS
     libc.hdr.types.FILE
     libc.src.__support.RPC.rpc_client
+    .gpu_file
 )
 
 add_entrypoint_object(
@@ -114,6 +116,7 @@ add_entrypoint_object(
   DEPENDS
     libc.hdr.types.FILE
     libc.src.__support.RPC.rpc_client
+    .gpu_file
 )
 
 add_entrypoint_object(
@@ -124,6 +127,7 @@ add_entrypoint_object(
     ../fopen.h
   DEPENDS
     libc.hdr.types.FILE
+    .gpu_file
 )
 
 add_entrypoint_object(
@@ -134,6 +138,8 @@ add_entrypoint_object(
     ../fclose.h
   DEPENDS
     libc.hdr.types.FILE
+    libc.hdr.stdio_macros
+    .gpu_file
 )
 
 add_entrypoint_object(
@@ -144,6 +150,7 @@ add_entrypoint_object(
     ../fread.h
   DEPENDS
     libc.hdr.types.FILE
+    .gpu_file
 )
 
 add_entrypoint_object(
@@ -254,8 +261,6 @@ add_entrypoint_object(
   DEPENDS
     libc.hdr.types.FILE
     .gpu_file
-    .feof
-    .ferror
 )
 
 add_entrypoint_object(
diff --git a/libc/src/stdio/gpu/clearerr.cpp b/libc/src/stdio/gpu/clearerr.cpp
index 4d843e4be33ee..5a0ca52e33fa0 100644
--- a/libc/src/stdio/gpu/clearerr.cpp
+++ b/libc/src/stdio/gpu/clearerr.cpp
@@ -7,10 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/clearerr.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
 
+#include "file.h"
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/fclose.cpp b/libc/src/stdio/gpu/fclose.cpp
index 847d6b8461729..1e00515e0650b 100644
--- a/libc/src/stdio/gpu/fclose.cpp
+++ b/libc/src/stdio/gpu/fclose.cpp
@@ -7,11 +7,11 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/fclose.h"
-#include "src/__support/macros/config.h"
-#include "src/stdio/gpu/file.h"
 
 #include "hdr/stdio_macros.h"
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
+#include "src/stdio/gpu/file.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/feof.cpp b/libc/src/stdio/gpu/feof.cpp
index a15e4874d0e2a..3ae308bad60b2 100644
--- a/libc/src/stdio/gpu/feof.cpp
+++ b/libc/src/stdio/gpu/feof.cpp
@@ -7,10 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/feof.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
 
+#include "file.h"
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/ferror.cpp b/libc/src/stdio/gpu/ferror.cpp
index 8273820370677..64d62e7065258 100644
--- a/libc/src/stdio/gpu/ferror.cpp
+++ b/libc/src/stdio/gpu/ferror.cpp
@@ -7,10 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/ferror.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
 
+#include "file.h"
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/fflush.cpp b/libc/src/stdio/gpu/fflush.cpp
index 5a5137be6a4af..0b6ef92f346af 100644
--- a/libc/src/stdio/gpu/fflush.cpp
+++ b/libc/src/stdio/gpu/fflush.cpp
@@ -7,10 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/fflush.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
 
+#include "file.h"
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/fgetc.cpp b/libc/src/stdio/gpu/fgetc.cpp
index cb42f3100a9fe..aaeb1591d3fa7 100644
--- a/libc/src/stdio/gpu/fgetc.cpp
+++ b/libc/src/stdio/gpu/fgetc.cpp
@@ -7,11 +7,11 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/fgetc.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
 
+#include "file.h"
 #include "hdr/stdio_macros.h" // for EOF.
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/fgets.cpp b/libc/src/stdio/gpu/fgets.cpp
index d90b7aa4aa669..5447e86d1c765 100644
--- a/libc/src/stdio/gpu/fgets.cpp
+++ b/libc/src/stdio/gpu/fgets.cpp
@@ -7,14 +7,13 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/fgets.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
-#include "src/stdio/feof.h"
-#include "src/stdio/ferror.h"
 
+#include "file.h"
 #include "hdr/stdio_macros.h" // for EOF.
 #include "hdr/types/FILE.h"
-#include <stddef.h>
+#include "src/__support/common.h"
+
+#include <stdint.h>
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/file.h b/libc/src/stdio/gpu/file.h
index 020f88880b570..102c6c601b30b 100644
--- a/libc/src/stdio/gpu/file.h
+++ b/libc/src/stdio/gpu/file.h
@@ -6,14 +6,11 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "hdr/stdio_macros.h" // For stdin/out/err
+#include "hdr/types/FILE.h"
 #include "src/__support/RPC/rpc_client.h"
 #include "src/__support/common.h"
 #include "src/__support/macros/attributes.h"
-#include "src/__support/macros/config.h"
-#include "src/string/string_utils.h"
-
-#include "hdr/stdio_macros.h" // For stdin/out/err
-#include "hdr/types/FILE.h"
 
 namespace LIBC_NAMESPACE_DECL {
 namespace file {
diff --git a/libc/src/stdio/gpu/fopen.cpp b/libc/src/stdio/gpu/fopen.cpp
index 0148e32a332d2..eee3edaac1c13 100644
--- a/libc/src/stdio/gpu/fopen.cpp
+++ b/libc/src/stdio/gpu/fopen.cpp
@@ -7,12 +7,12 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/fopen.h"
-#include "src/__support/CPP/string_view.h"
-#include "src/__support/macros/config.h"
-#include "src/stdio/gpu/file.h"
 
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
+#include "src/stdio/gpu/file.h"
 #include "src/string/memory_utils/inline_memcpy.h"
+#include "src/string/string_utils.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/fprintf.cpp b/libc/src/stdio/gpu/fprintf.cpp
index 46196d7d2b10f..5b8f01d7d5346 100644
--- a/libc/src/stdio/gpu/fprintf.cpp
+++ b/libc/src/stdio/gpu/fprintf.cpp
@@ -11,6 +11,7 @@
 #include "hdr/types/FILE.h"
 #include "src/__support/CPP/string_view.h"
 #include "src/__support/arg_list.h"
+#include "src/__support/common.h"
 #include "src/errno/libc_errno.h"
 #include "src/stdio/gpu/vfprintf_utils.h"
 
diff --git a/libc/src/stdio/gpu/fputc.cpp b/libc/src/stdio/gpu/fputc.cpp
index ad2db03df0ca4..8a8959b04d20d 100644
--- a/libc/src/stdio/gpu/fputc.cpp
+++ b/libc/src/stdio/gpu/fputc.cpp
@@ -7,11 +7,11 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/fputc.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
 
+#include "file.h"
 #include "hdr/stdio_macros.h" // for EOF.
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/fputs.cpp b/libc/src/stdio/gpu/fputs.cpp
index 7a08244bc26e4..780a40d1eb057 100644
--- a/libc/src/stdio/gpu/fputs.cpp
+++ b/libc/src/stdio/gpu/fputs.cpp
@@ -7,13 +7,12 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/fputs.h"
-#include "src/__support/CPP/string_view.h"
-#include "src/__support/macros/config.h"
-#include "src/errno/libc_errno.h"
-#include "src/stdio/gpu/file.h"
 
 #include "hdr/stdio_macros.h" // for EOF.
 #include "hdr/types/FILE.h"
+#include "src/__support/CPP/string_view.h"
+#include "src/__support/common.h"
+#include "src/stdio/gpu/file.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/fread.cpp b/libc/src/stdio/gpu/fread.cpp
index 57fa5b6111ff6..5619b54b8890d 100644
--- a/libc/src/stdio/gpu/fread.cpp
+++ b/libc/src/stdio/gpu/fread.cpp
@@ -7,10 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/fread.h"
-#include "src/__support/macros/config.h"
-#include "src/stdio/gpu/file.h"
 
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
+#include "src/stdio/gpu/file.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/fseek.cpp b/libc/src/stdio/gpu/fseek.cpp
index 5ada5de50db8b..468d65ff77e2a 100644
--- a/libc/src/stdio/gpu/fseek.cpp
+++ b/libc/src/stdio/gpu/fseek.cpp
@@ -7,10 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/fseek.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
 
+#include "file.h"
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/ftell.cpp b/libc/src/stdio/gpu/ftell.cpp
index 04bb0ddfa06ae..7ee33d7b05d9c 100644
--- a/libc/src/stdio/gpu/ftell.cpp
+++ b/libc/src/stdio/gpu/ftell.cpp
@@ -7,10 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/ftell.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
 
+#include "file.h"
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/fwrite.cpp b/libc/src/stdio/gpu/fwrite.cpp
index 6c548690039a4..73c265158103e 100644
--- a/libc/src/stdio/gpu/fwrite.cpp
+++ b/libc/src/stdio/gpu/fwrite.cpp
@@ -7,10 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/fwrite.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
 
+#include "file.h"
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/getc.cpp b/libc/src/stdio/gpu/getc.cpp
index 9c329749ee1fc..6dfb5cef0ad91 100644
--- a/libc/src/stdio/gpu/getc.cpp
+++ b/libc/src/stdio/gpu/getc.cpp
@@ -7,11 +7,11 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/getc.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
 
+#include "file.h"
 #include "hdr/stdio_macros.h" // for EOF.
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/getchar.cpp b/libc/src/stdio/gpu/getchar.cpp
index d99b97b5c5a00..7bf561fe6a907 100644
--- a/libc/src/stdio/gpu/getchar.cpp
+++ b/libc/src/stdio/gpu/getchar.cpp
@@ -7,10 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/getchar.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
 
+#include "file.h"
 #include "hdr/stdio_macros.h" // for EOF and stdin.
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/printf.cpp b/libc/src/stdio/gpu/printf.cpp
index be1885fd6801d..53fe69d5e2ebe 100644
--- a/libc/src/stdio/gpu/printf.cpp
+++ b/libc/src/stdio/gpu/printf.cpp
@@ -10,6 +10,7 @@
 
 #include "src/__support/CPP/string_view.h"
 #include "src/__support/arg_list.h"
+#include "src/__support/common.h"
 #include "src/errno/libc_errno.h"
 #include "src/stdio/gpu/vfprintf_utils.h"
 
diff --git a/libc/src/stdio/gpu/putc.cpp b/libc/src/stdio/gpu/putc.cpp
index f8ae98d26cf0e..da80d6c35a532 100644
--- a/libc/src/stdio/gpu/putc.cpp
+++ b/libc/src/stdio/gpu/putc.cpp
@@ -7,11 +7,11 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/putc.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
 
+#include "file.h"
 #include "hdr/stdio_macros.h" // for EOF.
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/putchar.cpp b/libc/src/stdio/gpu/putchar.cpp
index c49b02e2f1f10..da2d0a8376192 100644
--- a/libc/src/stdio/gpu/putchar.cpp
+++ b/libc/src/stdio/gpu/putchar.cpp
@@ -7,10 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/putchar.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
 
+#include "file.h"
 #include "hdr/stdio_macros.h" // for EOF and stdout.
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/puts.cpp b/libc/src/stdio/gpu/puts.cpp
index fc252abe52d17..9b4ae661b148b 100644
--- a/libc/src/stdio/gpu/puts.cpp
+++ b/libc/src/stdio/gpu/puts.cpp
@@ -7,19 +7,18 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/puts.h"
-#include "src/__support/CPP/string_view.h"
-#include "src/__support/macros/config.h"
-#include "src/errno/libc_errno.h"
-#include "src/stdio/gpu/file.h"
 
 #include "hdr/stdio_macros.h" // for EOF and stdout.
+#include "src/__support/CPP/string_view.h"
+#include "src/__support/common.h"
+#include "src/stdio/gpu/file.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(int, puts, (const char *__restrict str)) {
   cpp::string_view str_view(str);
-  auto written = file::write_impl<LIBC_WRITE_TO_STDOUT_NEWLINE>(stdout, str,
-                                                               str_view.size());
+  auto written = file::write_impl<LIBC_WRITE_TO_STDOUT_NEWLINE>(
+      stdout, str, str_view.size());
   if (written != str_view.size() + 1)
     return EOF;
   return 0;
diff --git a/libc/src/stdio/gpu/remove.cpp b/libc/src/stdio/gpu/remove.cpp
index 4bfb5d3fe8ed7..3cd72745cb6d3 100644
--- a/libc/src/stdio/gpu/remove.cpp
+++ b/libc/src/stdio/gpu/remove.cpp
@@ -7,10 +7,11 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/remove.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
 
+#include "file.h"
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
+#include "src/string/string_utils.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/rename.cpp b/libc/src/stdio/gpu/rename.cpp
index 589bf2456c8d0..d7c71fc826824 100644
--- a/libc/src/stdio/gpu/rename.cpp
+++ b/libc/src/stdio/gpu/rename.cpp
@@ -7,11 +7,11 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/rename.h"
-#include "src/__support/CPP/string_view.h"
-#include "src/__support/macros/config.h"
-#include "src/stdio/gpu/file.h"
 
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
+#include "src/stdio/gpu/file.h"
+#include "src/string/string_utils.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/stderr.cpp b/libc/src/stdio/gpu/stderr.cpp
index efbc3b407d60e..d0fa1aeb54ee3 100644
--- a/libc/src/stdio/gpu/stderr.cpp
+++ b/libc/src/stdio/gpu/stderr.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "hdr/types/FILE.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 static struct {
diff --git a/libc/src/stdio/gpu/stdin.cpp b/libc/src/stdio/gpu/stdin.cpp
index 66618fd0b4db8..fef4c3e8f2dfc 100644
--- a/libc/src/stdio/gpu/stdin.cpp
+++ b/libc/src/stdio/gpu/stdin.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "hdr/types/FILE.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 static struct {
diff --git a/libc/src/stdio/gpu/stdout.cpp b/libc/src/stdio/gpu/stdout.cpp
index e3869f9e26b77..e458dccf917d4 100644
--- a/libc/src/stdio/gpu/stdout.cpp
+++ b/libc/src/stdio/gpu/stdout.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "hdr/types/FILE.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 static struct {
diff --git a/libc/src/stdio/gpu/ungetc.cpp b/libc/src/stdio/gpu/ungetc.cpp
index fd1db467975ee..fadd1d7db13cf 100644
--- a/libc/src/stdio/gpu/ungetc.cpp
+++ b/libc/src/stdio/gpu/ungetc.cpp
@@ -7,10 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/stdio/ungetc.h"
-#include "file.h"
-#include "src/__support/macros/config.h"
 
+#include "file.h"
 #include "hdr/types/FILE.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/stdio/gpu/vfprintf.cpp b/libc/src/stdio/gpu/vfprintf.cpp
index c92685f48c728..16a5ed4e47d19 100644
--- a/libc/src/stdio/gpu/vfprintf.cpp
+++ b/libc/src/stdio/gpu/vfprintf.cpp
@@ -11,7 +11,7 @@
 #include "hdr/types/FILE.h"
 #include "src/__support/CPP/string_view.h"
 #include "src/__support/arg_list.h"
-#include "src/errno/libc_errno.h"
+#include "src/__support/common.h"
 #include "src/stdio/gpu/vfprintf_utils.h"
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/stdio/gpu/vfprintf_utils.h b/libc/src/stdio/gpu/vfprintf_utils.h
index df157d36c5166..a4c665c79fbc9 100644
--- a/libc/src/stdio/gpu/vfprintf_utils.h
+++ b/libc/src/stdio/gpu/vfprintf_utils.h
@@ -10,7 +10,7 @@
 #include "src/__support/GPU/utils.h"
 #include "src/__support/RPC/rpc_client.h"
 #include "src/__support/arg_list.h"
-#include "src/__support/macros/config.h"
+
 #include "src/stdio/gpu/file.h"
 #include "src/string/string_utils.h"
 
diff --git a/libc/src/stdio/gpu/vprintf.cpp b/libc/src/stdio/gpu/vprintf.cpp
index 54012f3071844..65f5dbfe7c76c 100644
--- a/libc/src/stdio/gpu/vprintf.cpp
+++ b/libc/src/stdio/gpu/vprintf.cpp
@@ -10,7 +10,7 @@
 
 #include "src/__support/CPP/string_view.h"
 #include "src/__support/arg_list.h"
-#include "src/errno/libc_errno.h"
+#include "src/__support/common.h"
 #include "src/stdio/gpu/vfprintf_utils.h"
 
 namespace LIBC_NAMESPACE_DECL {

@michaelrj-google michaelrj-google requested a review from jhuber6 June 6, 2025 20:54
Copy link
Contributor

@jhuber6 jhuber6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@michaelrj-google michaelrj-google merged commit 3695d6c into llvm:main Jun 6, 2025
12 of 13 checks passed
@michaelrj-google michaelrj-google deleted the libcGPUStdioCleanup branch June 6, 2025 21:12
rorth pushed a commit to rorth/llvm-project that referenced this pull request Jun 11, 2025
The GPU stdio functions were depending on indirect inclusion for some of
their dependencies. This patch should fix all of that.
DhruvSrivastavaX pushed a commit to DhruvSrivastavaX/lldb-for-aix that referenced this pull request Jun 12, 2025
The GPU stdio functions were depending on indirect inclusion for some of
their dependencies. This patch should fix all of that.
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
The GPU stdio functions were depending on indirect inclusion for some of
their dependencies. This patch should fix all of that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants