[libc++] Remove ios_base::__xindex_ from the ABI (#198994)
`__xindex_` is only ever used from the dylib from a single function. We can simplify the code a bit by making the variable function-local and avoiding exposing it to the ABI at all. This also fixes a TODO about whether it's safe to use `atomic` with the GCC ABI: yes, since it's not actually part of our ABI.
This commit is contained in:
1 parent
becc74f032
commit
762b77ac29
13 files changed
+25
-57
No files matched your search
+5
-11
@@ -235,10 +235,6 @@ storage-class-specifier const error_category& iostream_category() noexcept;
|
||||
# include <__verbose_abort>
|
||||
# include <version>
|
||||
|
||||
# if _LIBCPP_HAS_ATOMIC_HEADER
|
||||
# include <__atomic/atomic.h> // for __xindex_
|
||||
# endif
|
||||
|
||||
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
# endif
|
||||
@@ -406,13 +402,6 @@ private:
|
||||
int* __index_;
|
||||
size_t __event_size_;
|
||||
size_t __event_cap_;
|
||||
// TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
|
||||
// enabled with clang.
|
||||
# if _LIBCPP_HAS_C_ATOMIC_IMP && _LIBCPP_HAS_THREADS
|
||||
static atomic<int> __xindex_;
|
||||
# else
|
||||
static int __xindex_;
|
||||
# endif
|
||||
long* __iarray_;
|
||||
size_t __iarray_size_;
|
||||
size_t __iarray_cap_;
|
||||
@@ -886,6 +875,11 @@ _LIBCPP_POP_MACROS
|
||||
|
||||
# endif // _LIBCPP_HAS_LOCALIZATION
|
||||
|
||||
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
|
||||
# include <ctime>
|
||||
# include <ratio>
|
||||
# endif
|
||||
|
||||
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
|
||||
# include <atomic>
|
||||
# include <concepts>
|
||||
|
||||
@@ -12,13 +12,27 @@ To generate a summary, re-generate the new ABI list using the
|
||||
|
||||
New entries should be added directly below the "Version" header.
|
||||
|
||||
------------
|
||||
Version 23.0
|
||||
------------
|
||||
|
||||
* [libc++] Remove ios_base::__xindex_ from the ABI
|
||||
|
||||
`__xindex_` is only ever used from the dylib from a single function. We can simplify the code a bit by making the
|
||||
variable function-local and avoiding exposing it to the ABI at all. This also fixes a TODO about whether it's safe to
|
||||
use `atomic` with the GCC ABI: yes, since it's not actually part of our ABI.
|
||||
|
||||
All platforms
|
||||
-------------
|
||||
Symbol removed: __ZNSt3__18ios_base9__xindex_E
|
||||
|
||||
------------
|
||||
Version 22.0
|
||||
------------
|
||||
|
||||
* [libc++] Allows any types of size 4 and 8 to use native platform ulock_wait
|
||||
|
||||
This patch added symbols for platform wait functions with the size of the type
|
||||
This patch added symbols for platform wait functions with the size of the type
|
||||
|
||||
All platforms
|
||||
-------------
|
||||
|
||||
@@ -1869,7 +1869,6 @@
|
||||
{'is_defined': True, 'name': '__ZNSt3__18ios_base7unitbufE', 'size': 0, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '__ZNSt3__18ios_base8internalE', 'size': 0, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '__ZNSt3__18ios_base8showbaseE', 'size': 0, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '__ZNSt3__18ios_base9__xindex_E', 'size': 0, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '__ZNSt3__18ios_base9basefieldE', 'size': 0, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '__ZNSt3__18ios_base9boolalphaE', 'size': 0, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '__ZNSt3__18ios_base9showpointE', 'size': 0, 'type': 'OBJECT'}
|
||||
|
||||
@@ -1507,7 +1507,6 @@
|
||||
{'is_defined': True, 'name': '_ZNSt6__ndk18ios_base7unitbufE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt6__ndk18ios_base8internalE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt6__ndk18ios_base8showbaseE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt6__ndk18ios_base9__xindex_E', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt6__ndk18ios_base9basefieldE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt6__ndk18ios_base9boolalphaE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt6__ndk18ios_base9showpointE', 'size': 4, 'type': 'OBJECT'}
|
||||
|
||||
@@ -826,7 +826,6 @@
|
||||
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__18ios_base7unitbufE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
|
||||
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__18ios_base8internalE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
|
||||
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__18ios_base8showbaseE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
|
||||
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__18ios_base9__xindex_E', 'storage_mapping_class': 'RW', 'type': 'OBJECT'}
|
||||
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__18ios_base9basefieldE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
|
||||
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__18ios_base9boolalphaE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
|
||||
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__18ios_base9showpointE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
|
||||
|
||||
@@ -826,7 +826,6 @@
|
||||
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__18ios_base7unitbufE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
|
||||
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__18ios_base8internalE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
|
||||
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__18ios_base8showbaseE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
|
||||
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__18ios_base9__xindex_E', 'storage_mapping_class': 'RW', 'type': 'OBJECT'}
|
||||
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__18ios_base9basefieldE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
|
||||
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__18ios_base9boolalphaE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
|
||||
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__18ios_base9showpointE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
|
||||
|
||||
@@ -1859,7 +1859,6 @@
|
||||
{'is_defined': True, 'name': '__ZNSt3__18ios_base7unitbufE', 'size': 0, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '__ZNSt3__18ios_base8internalE', 'size': 0, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '__ZNSt3__18ios_base8showbaseE', 'size': 0, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '__ZNSt3__18ios_base9__xindex_E', 'size': 0, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '__ZNSt3__18ios_base9basefieldE', 'size': 0, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '__ZNSt3__18ios_base9boolalphaE', 'size': 0, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '__ZNSt3__18ios_base9showpointE', 'size': 0, 'type': 'OBJECT'}
|
||||
|
||||
@@ -1507,7 +1507,6 @@
|
||||
{'is_defined': True, 'name': '_ZNSt6__ndk18ios_base7unitbufE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt6__ndk18ios_base8internalE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt6__ndk18ios_base8showbaseE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt6__ndk18ios_base9__xindex_E', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt6__ndk18ios_base9basefieldE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt6__ndk18ios_base9boolalphaE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt6__ndk18ios_base9showpointE', 'size': 4, 'type': 'OBJECT'}
|
||||
|
||||
@@ -1519,7 +1519,6 @@
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base7unitbufE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base8internalE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base8showbaseE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base9__xindex_E', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base9basefieldE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base9boolalphaE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base9showpointE', 'size': 4, 'type': 'OBJECT'}
|
||||
|
||||
@@ -1518,7 +1518,6 @@
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base7unitbufE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base8internalE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base8showbaseE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base9__xindex_E', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base9basefieldE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base9boolalphaE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base9showpointE', 'size': 4, 'type': 'OBJECT'}
|
||||
|
||||
@@ -1489,7 +1489,6 @@
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base7unitbufE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base8internalE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base8showbaseE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base9__xindex_E', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base9basefieldE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base9boolalphaE', 'size': 4, 'type': 'OBJECT'}
|
||||
{'is_defined': True, 'name': '_ZNSt3__18ios_base9showpointE', 'size': 4, 'type': 'OBJECT'}
|
||||
|
||||
+5
-8
@@ -9,6 +9,7 @@
|
||||
#include <__config>
|
||||
#include <__locale>
|
||||
#include <algorithm>
|
||||
#include <atomic>
|
||||
#include <ios>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
@@ -111,13 +112,6 @@ locale ios_base::imbue(const locale& newloc) {
|
||||
|
||||
locale ios_base::getloc() const { return __loc_; }
|
||||
|
||||
// xalloc
|
||||
#if _LIBCPP_HAS_C_ATOMIC_IMP && _LIBCPP_HAS_THREADS
|
||||
atomic<int> ios_base::__xindex_{0};
|
||||
#else
|
||||
int ios_base::__xindex_ = 0;
|
||||
#endif
|
||||
|
||||
template <typename _Tp>
|
||||
static size_t __ios_new_cap(size_t __req_size, size_t __current_cap) { // Precondition: __req_size > __current_cap
|
||||
const size_t mx = std::numeric_limits<size_t>::max() / sizeof(_Tp);
|
||||
@@ -127,7 +121,10 @@ static size_t __ios_new_cap(size_t __req_size, size_t __current_cap) { // Precon
|
||||
return mx;
|
||||
}
|
||||
|
||||
int ios_base::xalloc() { return __xindex_++; }
|
||||
int ios_base::xalloc() {
|
||||
constinit static atomic<int> xindex = 0;
|
||||
return xindex++;
|
||||
}
|
||||
|
||||
long& ios_base::iword(int index) {
|
||||
size_t req_size = static_cast<size_t>(index) + 1;
|
||||
|
||||
@@ -73,7 +73,6 @@ ccomplex cstdint
|
||||
ccomplex cstdio
|
||||
ccomplex cstdlib
|
||||
ccomplex cstring
|
||||
ccomplex ctime
|
||||
ccomplex cwchar
|
||||
ccomplex cwctype
|
||||
ccomplex initializer_list
|
||||
@@ -81,7 +80,6 @@ ccomplex ios
|
||||
ccomplex iosfwd
|
||||
ccomplex istream
|
||||
ccomplex limits
|
||||
ccomplex ratio
|
||||
ccomplex sstream
|
||||
ccomplex stdexcept
|
||||
ccomplex streambuf
|
||||
@@ -166,7 +164,6 @@ complex cstdint
|
||||
complex cstdio
|
||||
complex cstdlib
|
||||
complex cstring
|
||||
complex ctime
|
||||
complex cwchar
|
||||
complex cwctype
|
||||
complex initializer_list
|
||||
@@ -174,7 +171,6 @@ complex ios
|
||||
complex iosfwd
|
||||
complex istream
|
||||
complex limits
|
||||
complex ratio
|
||||
complex sstream
|
||||
complex stdexcept
|
||||
complex streambuf
|
||||
@@ -214,7 +210,6 @@ ctgmath cstdint
|
||||
ctgmath cstdio
|
||||
ctgmath cstdlib
|
||||
ctgmath cstring
|
||||
ctgmath ctime
|
||||
ctgmath cwchar
|
||||
ctgmath cwctype
|
||||
ctgmath initializer_list
|
||||
@@ -222,7 +217,6 @@ ctgmath ios
|
||||
ctgmath iosfwd
|
||||
ctgmath istream
|
||||
ctgmath limits
|
||||
ctgmath ratio
|
||||
ctgmath sstream
|
||||
ctgmath stdexcept
|
||||
ctgmath streambuf
|
||||
@@ -264,7 +258,6 @@ experimental/iterator cstdint
|
||||
experimental/iterator cstdio
|
||||
experimental/iterator cstdlib
|
||||
experimental/iterator cstring
|
||||
experimental/iterator ctime
|
||||
experimental/iterator cwchar
|
||||
experimental/iterator cwctype
|
||||
experimental/iterator initializer_list
|
||||
@@ -272,7 +265,6 @@ experimental/iterator ios
|
||||
experimental/iterator iosfwd
|
||||
experimental/iterator iterator
|
||||
experimental/iterator limits
|
||||
experimental/iterator ratio
|
||||
experimental/iterator stdexcept
|
||||
experimental/iterator streambuf
|
||||
experimental/iterator string
|
||||
@@ -393,7 +385,6 @@ fstream cstdint
|
||||
fstream cstdio
|
||||
fstream cstdlib
|
||||
fstream cstring
|
||||
fstream ctime
|
||||
fstream cwchar
|
||||
fstream cwctype
|
||||
fstream initializer_list
|
||||
@@ -402,7 +393,6 @@ fstream ios
|
||||
fstream iosfwd
|
||||
fstream istream
|
||||
fstream limits
|
||||
fstream ratio
|
||||
fstream stdexcept
|
||||
fstream streambuf
|
||||
fstream string
|
||||
@@ -464,14 +454,12 @@ iomanip cstdint
|
||||
iomanip cstdio
|
||||
iomanip cstdlib
|
||||
iomanip cstring
|
||||
iomanip ctime
|
||||
iomanip cwchar
|
||||
iomanip cwctype
|
||||
iomanip initializer_list
|
||||
iomanip ios
|
||||
iomanip iosfwd
|
||||
iomanip limits
|
||||
iomanip ratio
|
||||
iomanip stdexcept
|
||||
iomanip string
|
||||
iomanip string_view
|
||||
@@ -488,13 +476,11 @@ ios cstdint
|
||||
ios cstdio
|
||||
ios cstdlib
|
||||
ios cstring
|
||||
ios ctime
|
||||
ios cwchar
|
||||
ios cwctype
|
||||
ios initializer_list
|
||||
ios iosfwd
|
||||
ios limits
|
||||
ios ratio
|
||||
ios stdexcept
|
||||
ios string
|
||||
ios string_view
|
||||
@@ -514,7 +500,6 @@ iostream cstdint
|
||||
iostream cstdio
|
||||
iostream cstdlib
|
||||
iostream cstring
|
||||
iostream ctime
|
||||
iostream cwchar
|
||||
iostream cwctype
|
||||
iostream format
|
||||
@@ -526,7 +511,6 @@ iostream limits
|
||||
iostream optional
|
||||
iostream ostream
|
||||
iostream print
|
||||
iostream ratio
|
||||
iostream stdexcept
|
||||
iostream streambuf
|
||||
iostream string
|
||||
@@ -545,14 +529,12 @@ istream cstdint
|
||||
istream cstdio
|
||||
istream cstdlib
|
||||
istream cstring
|
||||
istream ctime
|
||||
istream cwchar
|
||||
istream cwctype
|
||||
istream initializer_list
|
||||
istream ios
|
||||
istream iosfwd
|
||||
istream limits
|
||||
istream ratio
|
||||
istream stdexcept
|
||||
istream streambuf
|
||||
istream string
|
||||
@@ -601,14 +583,12 @@ locale cstdint
|
||||
locale cstdio
|
||||
locale cstdlib
|
||||
locale cstring
|
||||
locale ctime
|
||||
locale cwchar
|
||||
locale cwctype
|
||||
locale initializer_list
|
||||
locale ios
|
||||
locale iosfwd
|
||||
locale limits
|
||||
locale ratio
|
||||
locale stdexcept
|
||||
locale streambuf
|
||||
locale string
|
||||
@@ -699,7 +679,6 @@ ostream cstdint
|
||||
ostream cstdio
|
||||
ostream cstdlib
|
||||
ostream cstring
|
||||
ostream ctime
|
||||
ostream cwchar
|
||||
ostream cwctype
|
||||
ostream format
|
||||
@@ -709,7 +688,6 @@ ostream iosfwd
|
||||
ostream limits
|
||||
ostream optional
|
||||
ostream print
|
||||
ostream ratio
|
||||
ostream stdexcept
|
||||
ostream streambuf
|
||||
ostream string
|
||||
@@ -872,7 +850,6 @@ sstream cstdint
|
||||
sstream cstdio
|
||||
sstream cstdlib
|
||||
sstream cstring
|
||||
sstream ctime
|
||||
sstream cwchar
|
||||
sstream cwctype
|
||||
sstream initializer_list
|
||||
@@ -880,7 +857,6 @@ sstream ios
|
||||
sstream iosfwd
|
||||
sstream istream
|
||||
sstream limits
|
||||
sstream ratio
|
||||
sstream stdexcept
|
||||
sstream streambuf
|
||||
sstream string
|
||||
@@ -918,14 +894,12 @@ streambuf cstdint
|
||||
streambuf cstdio
|
||||
streambuf cstdlib
|
||||
streambuf cstring
|
||||
streambuf ctime
|
||||
streambuf cwchar
|
||||
streambuf cwctype
|
||||
streambuf initializer_list
|
||||
streambuf ios
|
||||
streambuf iosfwd
|
||||
streambuf limits
|
||||
streambuf ratio
|
||||
streambuf stdexcept
|
||||
streambuf string
|
||||
streambuf string_view
|
||||
@@ -970,7 +944,6 @@ strstream cstdint
|
||||
strstream cstdio
|
||||
strstream cstdlib
|
||||
strstream cstring
|
||||
strstream ctime
|
||||
strstream cwchar
|
||||
strstream cwctype
|
||||
strstream initializer_list
|
||||
@@ -978,7 +951,6 @@ strstream ios
|
||||
strstream iosfwd
|
||||
strstream istream
|
||||
strstream limits
|
||||
strstream ratio
|
||||
strstream stdexcept
|
||||
strstream streambuf
|
||||
strstream string
|
||||
|
||||
|
Reference in new issue
Block a user