[libcxx-commits] [libcxx] 3c4bad0 - [libc++] Remove a few incorrect _LIBCPP_EXPORTED_FROM_ABI annotations (#132602)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 25 23:04:31 PDT 2025
Author: Nikolas Klauser
Date: 2025-08-26T08:04:28+02:00
New Revision: 3c4bad0504417fe06a2348d62f3589a83e47c177
URL: https://github.com/llvm/llvm-project/commit/3c4bad0504417fe06a2348d62f3589a83e47c177
DIFF: https://github.com/llvm/llvm-project/commit/3c4bad0504417fe06a2348d62f3589a83e47c177.diff
LOG: [libc++] Remove a few incorrect _LIBCPP_EXPORTED_FROM_ABI annotations (#132602)
This has two benefits:
- It is less likely that the macro will be copy-pasted around when
unnecessary
- We can drop `_LIBCPP_HIDE_FROM_ABI` from any member functions once we
are able to make `_LIBCPP_HIDE_FROM_ABI` the default within libc++
Added:
Modified:
libcxx/docs/DesignDocs/VisibilityMacros.rst
libcxx/include/__charconv/from_chars_result.h
libcxx/include/__charconv/to_chars_result.h
libcxx/include/__filesystem/file_status.h
libcxx/include/__filesystem/path.h
libcxx/include/__filesystem/space_info.h
libcxx/include/__format/formatter_output.h
libcxx/include/__memory_resource/pool_options.h
libcxx/include/__mutex/tag_types.h
libcxx/include/__new/nothrow_t.h
libcxx/include/__system_error/error_category.h
libcxx/include/__thread/id.h
libcxx/include/__tuple/sfinae_helpers.h
libcxx/include/__utility/in_place.h
Removed:
################################################################################
diff --git a/libcxx/docs/DesignDocs/VisibilityMacros.rst b/libcxx/docs/DesignDocs/VisibilityMacros.rst
index e9f88118b7ef3..db54b35386b19 100644
--- a/libcxx/docs/DesignDocs/VisibilityMacros.rst
+++ b/libcxx/docs/DesignDocs/VisibilityMacros.rst
@@ -31,7 +31,9 @@ Visibility Macros
Mark a symbol as being part of our ABI. This includes functions that are part
of the libc++ library, type information and other symbols. On Windows,
this macro applies `dllimport`/`dllexport` to the symbol, and on other
- platforms it gives the symbol default visibility.
+ platforms it gives the symbol default visibility. This macro should never be
+ used on class templates. On classes it should only be used if the vtable
+ lives in the built library.
**_LIBCPP_OVERRIDABLE_FUNC_VIS**
Mark a symbol as being exported by the libc++ library, but allow it to be
diff --git a/libcxx/include/__charconv/from_chars_result.h b/libcxx/include/__charconv/from_chars_result.h
index a7bfd6530a8a0..b4ecea3d11451 100644
--- a/libcxx/include/__charconv/from_chars_result.h
+++ b/libcxx/include/__charconv/from_chars_result.h
@@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 17
-struct _LIBCPP_EXPORTED_FROM_ABI from_chars_result {
+struct from_chars_result {
const char* ptr;
errc ec;
# if _LIBCPP_STD_VER >= 20
diff --git a/libcxx/include/__charconv/to_chars_result.h b/libcxx/include/__charconv/to_chars_result.h
index 41dea4ab14723..a3cd4e28d0175 100644
--- a/libcxx/include/__charconv/to_chars_result.h
+++ b/libcxx/include/__charconv/to_chars_result.h
@@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 17
-struct _LIBCPP_EXPORTED_FROM_ABI to_chars_result {
+struct to_chars_result {
char* ptr;
errc ec;
# if _LIBCPP_STD_VER >= 20
diff --git a/libcxx/include/__filesystem/file_status.h b/libcxx/include/__filesystem/file_status.h
index da316c8b02746..eecaf3c492f03 100644
--- a/libcxx/include/__filesystem/file_status.h
+++ b/libcxx/include/__filesystem/file_status.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-class _LIBCPP_EXPORTED_FROM_ABI file_status {
+class file_status {
public:
// constructors
_LIBCPP_HIDE_FROM_ABI file_status() noexcept : file_status(file_type::none) {}
diff --git a/libcxx/include/__filesystem/path.h b/libcxx/include/__filesystem/path.h
index 381e5678a5855..7f5121020275e 100644
--- a/libcxx/include/__filesystem/path.h
+++ b/libcxx/include/__filesystem/path.h
@@ -861,7 +861,7 @@ class _LIBCPP_EXPORTED_FROM_ABI path {
}
// iterators
- class _LIBCPP_EXPORTED_FROM_ABI iterator;
+ class iterator;
typedef iterator const_iterator;
iterator begin() const;
diff --git a/libcxx/include/__filesystem/space_info.h b/libcxx/include/__filesystem/space_info.h
index 3fa57d33096fc..28f7ced40d27d 100644
--- a/libcxx/include/__filesystem/space_info.h
+++ b/libcxx/include/__filesystem/space_info.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-struct _LIBCPP_EXPORTED_FROM_ABI space_info {
+struct space_info {
uintmax_t capacity;
uintmax_t free;
uintmax_t available;
diff --git a/libcxx/include/__format/formatter_output.h b/libcxx/include/__format/formatter_output.h
index cc74e3858a401..d53b6cec707d8 100644
--- a/libcxx/include/__format/formatter_output.h
+++ b/libcxx/include/__format/formatter_output.h
@@ -45,7 +45,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace __formatter {
-struct _LIBCPP_EXPORTED_FROM_ABI __padding_size_result {
+struct __padding_size_result {
size_t __before_;
size_t __after_;
};
diff --git a/libcxx/include/__memory_resource/pool_options.h b/libcxx/include/__memory_resource/pool_options.h
index 324b8aaa8502b..fd20ced56795f 100644
--- a/libcxx/include/__memory_resource/pool_options.h
+++ b/libcxx/include/__memory_resource/pool_options.h
@@ -24,7 +24,7 @@ namespace pmr {
// [mem.res.pool.options]
-struct _LIBCPP_EXPORTED_FROM_ABI pool_options {
+struct pool_options {
size_t max_blocks_per_chunk = 0;
size_t largest_required_pool_block = 0;
};
diff --git a/libcxx/include/__mutex/tag_types.h b/libcxx/include/__mutex/tag_types.h
index 2b2dd58ee4e80..36b1a3d92b14e 100644
--- a/libcxx/include/__mutex/tag_types.h
+++ b/libcxx/include/__mutex/tag_types.h
@@ -17,15 +17,15 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-struct _LIBCPP_EXPORTED_FROM_ABI defer_lock_t {
+struct defer_lock_t {
explicit defer_lock_t() = default;
};
-struct _LIBCPP_EXPORTED_FROM_ABI try_to_lock_t {
+struct try_to_lock_t {
explicit try_to_lock_t() = default;
};
-struct _LIBCPP_EXPORTED_FROM_ABI adopt_lock_t {
+struct adopt_lock_t {
explicit adopt_lock_t() = default;
};
diff --git a/libcxx/include/__new/nothrow_t.h b/libcxx/include/__new/nothrow_t.h
index a286bf7af628f..a099772123934 100644
--- a/libcxx/include/__new/nothrow_t.h
+++ b/libcxx/include/__new/nothrow_t.h
@@ -19,7 +19,7 @@
# include <new.h>
#else
_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
-struct _LIBCPP_EXPORTED_FROM_ABI nothrow_t {
+struct nothrow_t {
explicit nothrow_t() = default;
};
extern _LIBCPP_EXPORTED_FROM_ABI const nothrow_t nothrow;
diff --git a/libcxx/include/__system_error/error_category.h b/libcxx/include/__system_error/error_category.h
index 7233e22110447..191f4d83a90c0 100644
--- a/libcxx/include/__system_error/error_category.h
+++ b/libcxx/include/__system_error/error_category.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_EXPORTED_FROM_ABI error_condition;
+class error_condition;
class _LIBCPP_EXPORTED_FROM_ABI error_code;
class _LIBCPP_HIDDEN __do_message;
diff --git a/libcxx/include/__thread/id.h b/libcxx/include/__thread/id.h
index c9c86c80c8599..14a51fc9ee880 100644
--- a/libcxx/include/__thread/id.h
+++ b/libcxx/include/__thread/id.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_HAS_THREADS
-class _LIBCPP_EXPORTED_FROM_ABI __thread_id;
+class __thread_id;
namespace this_thread {
diff --git a/libcxx/include/__tuple/sfinae_helpers.h b/libcxx/include/__tuple/sfinae_helpers.h
index f314381d0a48d..f81048f4062bd 100644
--- a/libcxx/include/__tuple/sfinae_helpers.h
+++ b/libcxx/include/__tuple/sfinae_helpers.h
@@ -19,7 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_CXX03_LANG
-struct _LIBCPP_EXPORTED_FROM_ABI __check_tuple_constructor_fail {
+struct __check_tuple_constructor_fail {
static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_explicit_default() { return false; }
static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit_default() { return false; }
template <class...>
diff --git a/libcxx/include/__utility/in_place.h b/libcxx/include/__utility/in_place.h
index ade4b6685a116..c5bfa947058fb 100644
--- a/libcxx/include/__utility/in_place.h
+++ b/libcxx/include/__utility/in_place.h
@@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 17
-struct _LIBCPP_EXPORTED_FROM_ABI in_place_t {
+struct in_place_t {
explicit in_place_t() = default;
};
inline constexpr in_place_t in_place{};
More information about the libcxx-commits
mailing list