| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
'!= 0'. Thanks to Arthur for the catch
llvm-svn: 363557
|
|
|
|
|
|
| |
_and_ the input has no grouping characters at all. We continue to reject cases when the input has grouping characters in the wrong place. Fixes PR#28704
llvm-svn: 362508
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
A few places in the library seem to behave unexpectedly when the library
is compiled or used with exceptions disabled. For example, not throwing
an exception when a pointer is NULL can lead us to dereference the pointer
later on, which is UB. This patch fixes such occurences.
It's hard to tell whether there are other places where the no-exceptions
mode misbehaves like this, because the replacement for throwing an
exception does not always seem to be abort()ing, but at least this
patch will improve the situation somewhat.
See http://lists.llvm.org/pipermail/libcxx-dev/2019-January/000172.html
Reviewers: mclow.lists, EricWF
Subscribers: christof, jkorous, dexonsmith, libcxx-commits
Differential Revision: https://reviews.llvm.org/D57761
llvm-svn: 353850
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to reflect the new license. These used slightly different spellings that
defeated my regular expressions.
We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.
Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.
llvm-svn: 351648
|
|
|
|
|
|
|
|
| |
GLIBC 2.27 changed the locale data for fr_FR and ru_RU. In particular
they change the decimal and thousands separators used. This patch
makes the locale tests tolerate the updated locales.
llvm-svn: 329143
|
|
|
|
|
|
| |
D28217
llvm-svn: 322295
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch replaces __sync_* with __libcpp_atomic_* and adds a wrapper
function for __atomic_exchange to support _LIBCPP_HAS_NO_THREADS.
Reviewers: EricWF, jroelofs, mclow.lists, compnerd
Reviewed By: EricWF, compnerd
Subscribers: compnerd, efriedma, cfe-commits, joerg, llvm-commits
Differential Revision: https://reviews.llvm.org/D35235
llvm-svn: 313694
|
|
|
|
|
|
|
| |
This reverts commit r307595. The commit had some issues that needed
to first be addressed in review.
llvm-svn: 307746
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Wrap __sync_* builtins with __libcpp_ functions to facility future customizations as atomic operations are unavailable on some targets.
Reviewers: danalbert, EricWF, jroelofs
Subscribers: joerg, llvm-commits
Differential Revision: https://reviews.llvm.org/D34918
llvm-svn: 307595
|
|
|
|
|
|
| |
This reverts commit 72ff8866bca49ee7d24c87673293b4ce88a039ec.
llvm-svn: 307593
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Wrap __sync_* builtins with __libcpp_ functions to facility future customizations as atomic operations are unavailable on some targets.
Reviewers: danalbert, EricWF, jroelofs
Subscribers: joerg, llvm-commits
Differential Revision: https://reviews.llvm.org/D34918
llvm-svn: 307591
|
|
|
|
|
|
|
|
| |
Previously the explicit instantiation for this was in locale.cpp,
but that didn't make much sense. This patch creates a new vector.cpp
source file to contain the explicit instantiation.
llvm-svn: 305442
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch improves how libc++ handles min/max macros within the headers. Previously libc++ would undef them and emit a warning.
This patch changes libc++ to use `#pragma push_macro` to save the macro before undefining it, and `#pragma pop_macro` to restore the macros and the end of the header.
Reviewers: mclow.lists, bcraig, compnerd, EricWF
Reviewed By: EricWF
Subscribers: cfe-commits, krytarowski
Differential Revision: https://reviews.llvm.org/D33080
llvm-svn: 304357
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously <locale> used std::unique_ptr<remove_ptr<locale_t>, locale-mgmt-function>
as a scope guard for (A) creating new locales, and (B) setting the thread specific locale
in RAII safe manner.
However using unique_ptr has some problems, first it requires that locale_t is a pointer
type, which may not be the case (Windows will need a non-pointer locale_t type that emulates _locale_t).
The second problem is that users of the guards had to supply the locale management function to the custom
deleter at every call site. However these locale management functions don't exist natively Windows, making
a good Windows implementation of locale more difficult.
This patch creates distinct and simply RAII guards that replace unique_ptr. These guards handle calling
the correct locale management function so that callers don't have too. This simplification will
aid in upcoming Windows fixes.
llvm-svn: 302474
|
|
|
|
| |
llvm-svn: 302280
|
|
|
|
|
|
|
|
|
|
|
| |
LLVM dropped support for Visual Studio versions older than 2015 quite
some time ago, so I consider it safe to drop libc++'s support for older
CRTs. The CRT in Visual Studio 2015 provides a lot of previously missing
functions, so targeting it requires less special casing.
Differential Revision: https://reviews.llvm.org/D31798
llvm-svn: 299743
|
|
|
|
|
|
|
| |
CloudABI has gained the setlocale() function in the meantime, meaning
there is no longer a need to conditionalize this.
llvm-svn: 294833
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch refactors the compiler detection done in `__config` by creating a
set of `_LIBCPP_COMPILER_<TYPE>` macros. The goal of this patch is to make
it easier to detect what compiler is being used outside of `__config`.
Additionally this patch removes workarounds for GCC in `__bit_reference`. I
tested GCC 4.8 and 4.9 without the workaround and neither seemed to need it
anymore.
llvm-svn: 291286
|
|
|
|
|
|
|
|
|
| |
Replace the use of _WIN32 in libc++. Replace most use with a C runtime
check _LIBCPP_MSVCRT or the new _LIBCPP_WIN32 to indicate that we are
using the Win32 API. Use a new _LIBCPP_WCHAR_IS_UCS2 to indicate that we
are on an environment that has a short wchar_t.
llvm-svn: 290910
|
|
|
|
|
|
|
|
|
|
|
| |
Visual C++ 14 and newer split msvcrt into msvcrt and ucrt with flavours
of the ucrt for different environments. This changed the access to the
ctype table by introducing the `__pctype_func` and `__pwctype_func`
accessors. Use this rather than directly accessing `_ctype` which
allows us to be safer in threaded situations by going through the libc
locking.
llvm-svn: 290823
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
moneypunct_byname and numpunct_byname.
Summary:
The underlying C locales provide the `thousands_sep` and `decimal_point` as strings, possible with more than one character. We currently don't handle this case even for `wchar_t`.
This patch properly converts the mbs -> wide character for `moneypunct_byname<wchar_t>`. For the `moneypunct_byname<char>` case we attempt to narrow the WC and if that fails we also attempt to translate it to some reasonable value. For example we translate U00A0 (non-breaking space) into U0020 (regular space). If none of these conversions succeed then we simply allow the base class to provide a fallback value.
Reviewers: mclow.lists, EricWF
Subscribers: vangyzen, george.burgess.iv, cfe-commits
Differential Revision: https://reviews.llvm.org/D24218
llvm-svn: 289347
|
|
|
|
|
|
|
|
|
|
| |
On Windows, marking an `extern template class` declaration as exported
actually forces an instantiation, which is not the desired behavior.
Instead, the actual explicit instantiations need to be exported.
Differential Revision: https://reviews.llvm.org/D24679
llvm-svn: 281925
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
None of these checks are specific to Android devices. If libc++ was
used with Bionic on a normal Linux system these checks would still be
needed.
Reviewers: mclow.lists, EricWF
Subscribers: compnerd, tberghammer, danalbert, srhines, cfe-commits
Differential Revision: https://reviews.llvm.org/D24690
llvm-svn: 281921
|
|
|
|
|
|
| |
type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855.
llvm-svn: 279744
|
|
|
|
|
|
|
|
| |
CloudABI has gained the mblen_l() function in the meantime that does
properly return whether the character set has shift-states (read:
never).
llvm-svn: 272886
|
|
|
|
| |
llvm-svn: 267074
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of checking _LIBCPP_LOCALE_L_EXTENSIONS all over, instead check it
once, and define the various *_l symbols once. The private redirector symbol
names are all prefixed with _libcpp_* so that they won't conflict with user
symbols, and so they won't conflict with future C library symbols. In
particular, glibc likes providing private symbols such as __locale_t, so we
should follow a different naming pattern (like _libcpp_*) to avoid problems
on that front.
Tested on Linux with glibc. Hoping for the best on OSX and the various BSDs.
http://reviews.llvm.org/D17456
llvm-svn: 263016
|
|
|
|
|
|
|
|
|
| |
by -Wpadded.
We don't need these pragmas anymore because -Wpadded was removed from
buildit in r258900.
llvm-svn: 259023
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Also, there are no exported character type tables from Musl so we have to
Fallback to the standard functions. This reduces the number of libcxx's
test-suite failures down to ~130 for MIPS. Most of the remaining failures
come from the atomics (due to the lack of 8-byte atomic-ops in MIPS32) and
thread tests.
Reviewers: mclow.lists, EricWF, dalias, jroelofs
Subscribers: tberghammer, danalbert, srhines, cfe-commits
Differential Revision: http://reviews.llvm.org/D14926
llvm-svn: 253972
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch adds the LIBCXX_LIBC_IS_MUSL cmake option to allow the
building of libcxx with the Musl C library. The option is necessary as
Musl does not provide any predefined macro in order to test for its
presence, like GLIBC. Most of the changes specify the correct path to
choose through the various #if/#else constructs in the locale code.
Depends on D13407.
Reviewers: mclow.lists, jroelofs, EricWF
Subscribers: jfb, tberghammer, danalbert, srhines, cfe-commits
Differential Revision: http://reviews.llvm.org/D13673
llvm-svn: 252457
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After r241454 landed, libc++'s locale code compiles on CloudABI, with
the exception of the following two bits:
- CloudABI doesn't have setlocale(), as the C library does not keep
track of any global state. The global locale is always set to "C".
Disable the call to setlocale() on this system.
- Similarly, mbtowc_l() is also not present, as it is also not
thread-safe. As CloudABI does not support state-dependent encodings,
simply disable that part of the logic.
The locale code now compiles out of the box on CloudABI.
Differential Revision: http://reviews.llvm.org/D10729
Reviewed by: jroelofs
llvm-svn: 241455
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The __cloc() function is only present in case the environment does not
provide a way to refer to the C locale using a compile-time constant
expression. _LIBCPP_GET_C_LOCALE seems to be defined unconditionally.
This improves compilation of the locale code on CloudABI.
Differential Revision: http://reviews.llvm.org/D10690
Reviewed by: jroelofs
llvm-svn: 241454
|
|
|
|
|
|
| |
including libc++ header files. This is so that the dylib gets built with our headers; rather than the system-installed ones. We do this in most places already, just fixing a couple of inconsistent uses.
llvm-svn: 240412
|
|
|
|
| |
llvm-svn: 239160
|
|
|
|
|
|
| |
the bug open because (1) I'm not sure that we're correct here, only better than before, and (2) no tests
llvm-svn: 233012
|
|
|
|
|
|
|
|
|
| |
Solaris apparently doesn't have iswblank_l.
Thanks to C Bergstrom for the report!
llvm-svn: 232172
|
|
|
|
|
|
|
|
|
| |
This basically reverts the revert in r216508, and fixes a few more cases while
I'm at it. Reading my commit message on that commit again, I think it's bupkis.
http://reviews.llvm.org/D8237
llvm-svn: 231940
|
|
|
|
| |
llvm-svn: 231897
|
|
|
|
|
|
| |
_LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
llvm-svn: 231255
|
|
|
|
|
|
| |
expectation is that some targets (Android, cough) will enable it. Note that this is an implementation detail, not an interface change.
llvm-svn: 231252
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Newlib supports ctype differently from other platforms, this patch teaches libc++ about yet another platform that does ctype differently.
Reviewers: jroelofs
Subscribers: cfe-commits, danalbert, EricWF, jvoung, jfb, mclow.lists
Differential Revision: http://reviews.llvm.org/D7888
llvm-svn: 230557
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After discussing implementing more tests for this with @danalbert & @mclow, I
realized this change is not correct.
The C++ standard requires do_is() to behave as if it were a loop that checked
is(). Furthermore, it requires is() to check "The first form returns the result
of the expression (M & m) != 0; i.e., true if the character has the
characteristics specified"... which the reverted patch definitely does not
conform to. Even further, furthermore, this requires that ctype's mask be an
actual bitmask, unlike what android and newlib provide for _ctype_.
Fixing the original bug that instigated this patch remains TBD.
llvm-svn: 216508
|
|
|
|
|
|
|
| |
This patch: http://reviews.llvm.org/D5081
Original patch: http://reviews.llvm.org/D5071 (from @danalbert)
llvm-svn: 216497
|
|
|
|
|
|
|
|
|
|
|
| |
Turning off explicit template instantiation leads to a pretty
significant build time and code size cost. We're better off dealing
with ABI incompatibility issues that come up in a less heavy handed
way.
This reverts commit r189610.
llvm-svn: 215740
|
|
|
|
|
|
|
| |
Keeping the regex code sane is much easier if we match the other
platforms and use an unsigned mask.
llvm-svn: 214442
|
|
|
|
|
|
| |
Android's classic_locale begins at _ctype_ + 1.
llvm-svn: 213672
|
|
|
|
| |
llvm-svn: 212724
|
|
|
|
| |
llvm-svn: 198505
|
|
|
|
| |
llvm-svn: 195144
|