[libcxx-commits] [PATCH] D59550: [libc++] Mark internal types of std::filesystem as hidden

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 19 09:13:48 PDT 2019


ldionne created this revision.
ldionne added a reviewer: EricWF.
Herald added subscribers: libcxx-commits, jdoerfert, dexonsmith, jkorous, christof.

Otherwise, implicit instantiations of templates with these types can
cause the dylib to start exporting the vtable/RTTI of the instantiation.
Giving hidden visibility to those types causes the compiler to understand
that they are not used outside the dylib, and as a result implicitly
instantiated vtables/RTTI of templates with those internal types will
get hidden visibility.


Repository:
  rCXX libc++

https://reviews.llvm.org/D59550

Files:
  libcxx/include/filesystem


Index: libcxx/include/filesystem
===================================================================
--- libcxx/include/filesystem
+++ libcxx/include/filesystem
@@ -1350,7 +1350,7 @@
   void __create_what(int __num_paths);
 
 private:
-  struct _Storage {
+  struct _LIBCPP_HIDDEN _Storage {
     _LIBCPP_INLINE_VISIBILITY
     _Storage(const path& __p1, const path& __p2) : __p1_(__p1), __p2_(__p2) {}
 
@@ -1934,7 +1934,7 @@
 
 class directory_iterator;
 class recursive_directory_iterator;
-class __dir_stream;
+class _LIBCPP_HIDDEN __dir_stream;
 
 class directory_entry {
   typedef _VSTD_FS::path _Path;
@@ -2597,7 +2597,7 @@
   operator==(const recursive_directory_iterator&,
              const recursive_directory_iterator&) noexcept;
 
-  struct __shared_imp;
+  struct _LIBCPP_HIDDEN __shared_imp;
   shared_ptr<__shared_imp> __imp_;
   bool __rec_;
 }; // class recursive_directory_iterator


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59550.191327.patch
Type: text/x-patch
Size: 903 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190319/760c6778/attachment.bin>


More information about the libcxx-commits mailing list