[libcxx-commits] [libcxx] a6ba74e - [libcxx] Move the private header __std_stream into the src subdir

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 12 00:27:16 PDT 2023


Author: Martin Storsjö
Date: 2023-04-12T10:26:55+03:00
New Revision: a6ba74e471ac7df8fbe59abfd8ddd62ef9e39a59

URL: https://github.com/llvm/llvm-project/commit/a6ba74e471ac7df8fbe59abfd8ddd62ef9e39a59
DIFF: https://github.com/llvm/llvm-project/commit/a6ba74e471ac7df8fbe59abfd8ddd62ef9e39a59.diff

LOG: [libcxx] Move the private header __std_stream into the src subdir

This header isn't used by any public header, so there shouldn't
be any need to install it or treat it as a heder.

Once it's part of the src subdirectory, I guess one could consider
giving it a more traditional name too.

Differential Revision: https://reviews.llvm.org/D147855

Added: 
    libcxx/src/__std_stream

Modified: 
    libcxx/include/CMakeLists.txt
    libcxx/include/libcxx.imp
    libcxx/include/module.modulemap.in
    libcxx/src/iostream.cpp
    libcxx/test/libcxx/private_headers.verify.cpp
    libcxx/utils/data/ignore_format.txt
    libcxx/utils/generate_iwyu_mapping.py

Removed: 
    libcxx/include/__std_stream


################################################################################
diff  --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 65b3d30300daf..35b1f46ad482a 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -568,7 +568,6 @@ set(files
   __ranges/views.h
   __ranges/zip_view.h
   __split_buffer
-  __std_stream
   __string/char_traits.h
   __string/constexpr_c_functions.h
   __string/extern_template_lists.h

diff  --git a/libcxx/include/libcxx.imp b/libcxx/include/libcxx.imp
index dd256403eaf41..4660eb987abae 100644
--- a/libcxx/include/libcxx.imp
+++ b/libcxx/include/libcxx.imp
@@ -8,7 +8,6 @@
   { include: [ "<__node_handle>", "private", "<unordered_set>", "public" ] },
   { include: [ "<__split_buffer>", "private", "<deque>", "public" ] },
   { include: [ "<__split_buffer>", "private", "<vector>", "public" ] },
-  { include: [ "<__std_stream>", "private", "<iostream>", "public" ] },
   { include: [ "<__threading_support>", "private", "<atomic>", "public" ] },
   { include: [ "<__threading_support>", "private", "<mutex>", "public" ] },
   { include: [ "<__threading_support>", "private", "<semaphore>", "public" ] },

diff  --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in
index b7dbfbcb8765a..243b96e643ad3 100644
--- a/libcxx/include/module.modulemap.in
+++ b/libcxx/include/module.modulemap.in
@@ -1725,10 +1725,6 @@ module std [system] {
   module __mbstate_t         { private header "__mbstate_t.h"       export * }
   module __node_handle       { private header "__node_handle"       export * }
   module __split_buffer      { private header "__split_buffer"      export * }
-  module __std_stream        {
-    @requires_LIBCXX_ENABLE_LOCALIZATION@
-    private header "__std_stream" export *
-  }
   module __threading_support {         header "__threading_support" export * }
   module __tree              {         header "__tree"              export * }
   module __undef_macros      {         header "__undef_macros"      export * }

diff  --git a/libcxx/include/__std_stream b/libcxx/src/__std_stream
similarity index 100%
rename from libcxx/include/__std_stream
rename to libcxx/src/__std_stream

diff  --git a/libcxx/src/iostream.cpp b/libcxx/src/iostream.cpp
index a8948ac55608b..ba9cff06bfd81 100644
--- a/libcxx/src/iostream.cpp
+++ b/libcxx/src/iostream.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include <__locale>
-#include <__std_stream>
+#include "__std_stream"
 #include <new>
 #include <string>
 

diff  --git a/libcxx/test/libcxx/private_headers.verify.cpp b/libcxx/test/libcxx/private_headers.verify.cpp
index e72de07067f04..2287f1f6e4f0c 100644
--- a/libcxx/test/libcxx/private_headers.verify.cpp
+++ b/libcxx/test/libcxx/private_headers.verify.cpp
@@ -599,7 +599,6 @@ END-SCRIPT
 #include <__ranges/views.h> // expected-error@*:* {{use of private header from outside its module: '__ranges/views.h'}}
 #include <__ranges/zip_view.h> // expected-error@*:* {{use of private header from outside its module: '__ranges/zip_view.h'}}
 #include <__split_buffer> // expected-error@*:* {{use of private header from outside its module: '__split_buffer'}}
-#include <__std_stream> // expected-error@*:* {{use of private header from outside its module: '__std_stream'}}
 #include <__string/char_traits.h> // expected-error@*:* {{use of private header from outside its module: '__string/char_traits.h'}}
 #include <__string/constexpr_c_functions.h> // expected-error@*:* {{use of private header from outside its module: '__string/constexpr_c_functions.h'}}
 #include <__string/extern_template_lists.h> // expected-error@*:* {{use of private header from outside its module: '__string/extern_template_lists.h'}}

diff  --git a/libcxx/utils/data/ignore_format.txt b/libcxx/utils/data/ignore_format.txt
index 803bd3b32525c..de1834c8e27bf 100644
--- a/libcxx/utils/data/ignore_format.txt
+++ b/libcxx/utils/data/ignore_format.txt
@@ -592,7 +592,6 @@ libcxx/include/stdexcept
 libcxx/include/stdint.h
 libcxx/include/stdio.h
 libcxx/include/stdlib.h
-libcxx/include/__std_stream
 libcxx/include/streambuf
 libcxx/include/string
 libcxx/include/__string/char_traits.h
@@ -806,6 +805,7 @@ libcxx/src/random_shuffle.cpp
 libcxx/src/regex.cpp
 libcxx/src/shared_mutex.cpp
 libcxx/src/stdexcept.cpp
+libcxx/src/__std_stream
 libcxx/src/string.cpp
 libcxx/src/strstream.cpp
 libcxx/src/support/ibm/mbsnrtowcs.cpp

diff  --git a/libcxx/utils/generate_iwyu_mapping.py b/libcxx/utils/generate_iwyu_mapping.py
index 1e0242b954d36..c4c502ee42178 100644
--- a/libcxx/utils/generate_iwyu_mapping.py
+++ b/libcxx/utils/generate_iwyu_mapping.py
@@ -53,7 +53,6 @@ def generate_map(include):
         elif i == '__mutex_base': continue
         elif i == '__node_handle': public = ['map', 'set', 'unordered_map', 'unordered_set']
         elif i == '__split_buffer': public = ['deque', 'vector']
-        elif i == '__std_stream': public = ['iostream']
         elif i == '__threading_support': public = ['atomic', 'mutex', 'semaphore', 'thread']
         elif i == '__tree': public = ['map', 'set']
         elif i == '__undef_macros': continue


        


More information about the libcxx-commits mailing list