[libc-commits] [libc] [libc] Add LIBC_NAMESPACE_DECL macro (PR #97109)

Roland McGrath via libc-commits libc-commits at lists.llvm.org
Wed Jul 3 16:36:03 PDT 2024


================
@@ -27,4 +27,12 @@
 #define LIBC_HAS_FEATURE(f) 0
 #endif
 
+// Declare a LIBC_NAMESPACE with hidden visibility. `namespace
+// LIBC_NAMESPACE_DECL {` should be used around all declarations and definitions
+// for libc internals as opposed to just `namespace LIBC_NAMESPACE {`. This
+// ensures that all internal implementations within this namespace have hidden
----------------
frobtech wrote:

There are other ways that would achieve that "implementations have hidden visibility". I think it's more important to emphasize that all the *declarations* indicate hidden visibility, which optimizes codegen for *uses* of symbols defined in other TUs in ways that can be necessary for correctness by avoiding dynamic relocation.

https://github.com/llvm/llvm-project/pull/97109


More information about the libc-commits mailing list