[libc++] Always build with -fvisibility=hidden

Summary:
This avoids symbols being accidentally exported from the dylib when they
shouldn't. The next step is to use a pragma to apply hidden visibility
to all declarations (unless otherwise specified), which will allow us
to drop the per-declaration hidden visibility attributes we currently
have.

This also has the nice side effect of making sure the dylib exports the
same symbols regardless of the optimization level.

PR38138

Reviewers: EricWF, mclow.lists

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

llvm-svn: 368703
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 8a033a9e3fb96b9a1099325c4cd218c1c979d9d9
diff --git a/include/filesystem b/include/filesystem
index 3aaa798..9020a12 100644
--- a/include/filesystem
+++ b/include/filesystem
@@ -2583,6 +2583,7 @@
   void disable_recursion_pending() { __rec_ = false; }
 
 private:
+  _LIBCPP_FUNC_VIS
   recursive_directory_iterator(const path& __p, directory_options __opt,
                                error_code* __ec);