Commit Graph

5523 Commits

Author SHA1 Message Date
Petr Hosek
af3bb36aa2 [libcxx] Update gen_link_script.py to support different input and output
This enables the use of this script from other build systems like
GN which don't support post-build actions as well as for static
archives.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358915 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-22 19:51:33 +00:00
Casey Carter
a4aa812bd2 [libc++][test] Update some wstring_convert tests for MSVC quirks
Due to MSVC's decision to encode `wchar_t` as UTF-16, it rejects wide
character/string literals that expect a character value greater than
`\xffff`. UTF-16 `wchar_t` is clearly non-conforming, given that the
standard requires wchar_t to be capable of representing all characters
in the supported wide character execution sets, but rejecting e.g.
`\x40003` is a reasonably sane compromise given that encoding choice:
there's an expectation that `\xFOO` produces a single character in the
resulting literal. Consequently `L'\x40003'`/`L"\x40003"` are ill-formed
literals on MSVC. `L'\U00040003'` is a high surrogate (and produces a
warning about ignoring the "second character" in a multi-character
literal), and `L"\U00040003"` is a perfectly-valid `const wchar_t[3]`.

This change updates these tests to use universal-character-names instead
of raw values for the intended character values, which technically makes
them portable even to implementations that don't use a unicode
transformation format encoding for their wide character execution
character set. The two-character literal `L"\u1005e"` is awkward - the
`e` looks like part of the UCN's hex encoding - but necessary to compile
in '03 mode since '03 didn't allow UCNs to be used for members of the
basic execution character set even in character/string literals.

I've also eliminated the extraneous `\x00` "bonus null-terminator" in
some of the string literals which doesn't affect the tested behavior.

I'm sorry about using `*L"\U00040003"` in `conversions.string/to_bytes.pass.cpp`,
but it's correct for platforms with 32-bit wchar_t, *and* doesn't
trigger narrowing warnings as did the prior `CharT(0x40003)`.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358908 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-22 19:08:13 +00:00
Casey Carter
6f21f89dc4 [libc++] [test] Silence C++20 deprecation warnings in the MSVC STL
... when including msvc_stdlib_force_include.hpp.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358782 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-19 20:39:41 +00:00
Thomas Anderson
a12cb9d211 [libc++] Make __debug_less::operator() constexpr
This is a followup to [1] which added a new `__debug_less::operator()` overload.
[2] added `_LIBCPP_CONSTEXPR_AFTER_CXX17` to the original
`__debug_less::operator()` between the time of writing [1] and landing it.  This
change adds `_LIBCPP_CONSTEXPR_AFTER_CXX17` to the new overload too.

[1] https://reviews.llvm.org/rL358423
[2] https://reviews.llvm.org/rL358252

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358725 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-19 00:52:54 +00:00
Louis Dionne
aa15214168 [libc++] Link against libc++abi in the libc++abi tests
PR27405

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358712 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-18 20:59:49 +00:00
Billy Robert O'Neal III
80e36e12fd [libc++] [test] Add missing required headers to midpoint.integer.pass.cpp
This change authored by Paolo Torres <t-pator@microsoft.com>

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358698 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-18 18:02:14 +00:00
Louis Dionne
2696247a2f [libc++] Make sure we re-export some missing libc++abi symbols from libc++
Summary:
Ensure we re-export __cxa_throw_bad_array_new_length and
__cxa_uncaught_exceptions from libc++, since they are now
provided by libc++abi.

Doing this allows us to stop linking explicitly against libc++abi in
the libc++abi tests, since libc++ re-exports all the necessary symbols.
However, there is one caveat to that. We don't want libc++ to re-export
__cxa_uncaught_exception (the singular form), since it's only provided
for backwards compatibility. Hence, for the single test where we check
this backwards compatibility, we explicitly link against libc++abi.

PR27405
PR22654

Reviewers: EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358690 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-18 17:18:15 +00:00
Louis Dionne
b6402fd7f2 [libc++] Unconditionally enable the __pad_and_output optimization
This used to be guarded on whether the deployment target was greater
than macosx10.8, however testing against the dylibs for 10.8 and earlier
with the function enabled works too. The revision that introduced
__pad_and_output is r164241 and it does not mention a reason for the
guard.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358677 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-18 15:19:35 +00:00
Louis Dionne
4db7791939 [libc++][CMake] Always provide new/delete in libc++ unless specified otherwise
Summary:
Let's not try to be clever and detect it based on the libc++abi setting.
The only build that puts new/delete in libc++abi is Apple's and we set
this CMake option explicitly in both libc++ and libc++abi. Complicated
dependent options hurt, let's avoid them when possible.

Reviewers: phosek, EricWF

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

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358671 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-18 14:47:46 +00:00
Louis Dionne
2b46448963 [libc++][CMake] Remove unnecessary conditional for defining new handlers
It turns out that whether the new handlers should be provided is orthogonal
to whether new/delete are provided in libc++ or libc++abi. The reason why
I initially added this conditional is because of an incorrect understanding
of the path we're taking when building on Apple platforms. In fact, we
always build libc++ on top of libc++abi on Apple platforms, so we take
the branch for `LIBCXX_BUILDING_LIBCXXABI` there.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358616 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 21:57:49 +00:00
Petr Hosek
8a82647271 [CMake] Split linked libraries for shared and static libc++
Some linker libraries are only needed for shared libc++, some only
for static libc++, combining these together in LIBCXX_LIBRARIES and
LIBCXX_INTERFACE_LIBRARIES can introduce unnecessary dependencies.

This changes splits those up into LIBCXX_SHARED_LIBRARIES and
LIBCXX_STATIC_LIBRARIES matching what libc++abi already does.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358614 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 21:41:09 +00:00
Louis Dionne
671f244ccc [libc++] (Take 2) Add a test that uses the debug database from multiple threads
In r358591, I added a test that uses the debug database from multiple
threads and that helped us uncover the problem that was fixed in r355367.
However, the test broke the tsan CI bots, and I think the problem is the
test allocator that was used in the test (which is not thread safe).

I'm committing again without using the test allocator, and in a separate
test file.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358610 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 20:07:39 +00:00
Louis Dionne
396cbee5c9 [libc++][CMake] Allow building neither the shared nor the static library
It's possible to build just the headers, and we actually do it.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358608 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 19:47:27 +00:00
Louis Dionne
40056acbb7 [libc++] Use the no_destroy attribute to avoid destroying debug DB statics
Summary:
Otherwise, we can run into problems when the program has static variables
that need to use the debug database during their deinitialization, if
the debug DB has already been deinitialized.

Reviewers: EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358602 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 18:20:19 +00:00
Louis Dionne
03a144c102 Revert "[libc++] Add a test that uses the debug database from multiple threads"
This reverts r358591, which seems to have uncovered an actual bug and
causes the tsan CI to fail. We need to fix the bug and re-commit the
test.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358593 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 16:43:03 +00:00
Louis Dionne
bf750a6d8c [libc++] Add a test that uses the debug database from multiple threads
This test helped us concurrently discover the problem that was fixed
in r355367.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358591 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 16:21:55 +00:00
Louis Dionne
fdf271a7e2 [libc++][NFC] Make size of allocation more self-documenting
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358588 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 16:11:41 +00:00
Eric Fiselier
6049636175 Fix visibility for coroutine types on Windows
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358551 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 04:31:46 +00:00
Marshall Clow
1b3740a663 Add tests for stability to list::sort and forward_list::sort. Thanks to Jonathan Wakely for the notice
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358541 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 00:11:00 +00:00
Marshall Clow
ef93f3843f Fix list/forward_list implementations of remove_if and unique to deal with predicates that are part of the sequence passed in. We already do this for remove.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358534 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-16 22:11:26 +00:00
Louis Dionne
8958979078 [NFC] Build libc++ verbosely in the macOS CI
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358529 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-16 21:16:58 +00:00
Louis Dionne
08c6f59615 [libc++] Make sure we use new/delete from libc++abi on CI for Apple platforms
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358524 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-16 20:46:03 +00:00
Louis Dionne
c85fc61ecf [libc++] Remove old workaround for buildit
Summary:
I'm not sure what the problem was at the time, however I don't think
this is necessary since buildit doesn't exist anymore.

Instead of the workaround, the correct thing to do is to leave out
the get_new_handler/set_new_handler definitions from libc++ when
we're getting them from libc++abi.

Reviewers: EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358518 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-16 19:26:56 +00:00
Louis Dionne
8fea411800 [libc++] Fix debug_less test in C++03
We were using C++11 features but the test needs to work in C++03 too.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358433 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-15 18:00:01 +00:00
Thomas Anderson
9b96c3dbd4 [libc++] Fix build failure with _LIBCPP_DEBUG=0 when iterators return values instead of references
There are many STL algorithms (such as lexicographical_compare) that compare
values pointed to by iterators like so:
    __comp(*it1, *it2);
	
When building with `_LIBCPP_DEBUG=0`, comparators are wrapped in `__debug_less`
which does some additional validation.  But `__debug_less::operator()` takes
non-const references, so if the type of `*it1` is int, not int&, then the build
will fail.

This change adds a `const&` overload for `operator()` to fix the build.

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358423 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-15 17:02:15 +00:00
Louis Dionne
2113da5756 [NFC] Add missing revision number in libc++ ABI changelog
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358411 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-15 14:29:33 +00:00
Louis Dionne
0f44da2d3d [libc++] Make sure that the symbol differ takes into account symbol types
Summary:
Otherwise, it doesn't take into account things like whether the symbol
is defined or undefined, and whether symbols are indirect references
(re-exports) or not.

Reviewers: EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358408 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-15 14:04:52 +00:00
Louis Dionne
31e72ae251 [libc++] Run back-deployment CI against previously-released libc++abi dylibs
We used to do it against the current system's libc++abi, which is not as
good as doing it with the libc++abi that matches the libc++ we're running
against.

Note that I made sure we were indeed picking up the provided libc++abi
by replacing it by something that doesn't work and watching it burn.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358294 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 16:58:25 +00:00
Eric Fiselier
ef753e35b1 Cleanup how debug comparators are created in <algorithm>
Instead of having an `#if` block in every algorithm using a debug
comparator, this patch introduces the __comp_ref_type trait that
selects __debug_less in debug mode and _Comp& otherwise.

This patch should have no observable functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358252 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 05:18:19 +00:00
Louis Dionne
ac7b2ece02 [libc++] Make sure we don't eagerly diagnose non-const comparators for containers of incomplete types
Summary:
In r348529, I improved the library-defined diagnostic for using containers
with a non-const comparator/hasher. However, the check is now performed
too early, which leads to the diagnostic being emitted in cases where it
shouldn't. See PR41360 for details.

This patch moves the diagnostic to the destructor of the containers, which
means that the diagnostic will only be emitted when the container is instantiated
at a point where the comparator and the key/value are required to be complete.
We still retain better diagnostics than before r348529, because the diagnostics
are performed in the containers themselves instead of __tree and __hash_table.

As a drive-by fix, I improved the diagnostic to mention that we can't find
a _viable_ const call operator, as suggested by EricWF in PR41360.

Reviewers: EricWF, mclow.lists

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

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358189 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-11 16:14:56 +00:00
Jonathan Metzman
3845da998d Remove repeated words from BuildingLibcxx.rst
Summary: Remove repeated words from docs.

Reviewers: phosek

Reviewed By: phosek

Subscribers: christof

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358147 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 23:44:27 +00:00
Martin Storsjo
56dd7238c9 [CMake] Fix statically linking in libcxxabi if built separately
In this case, CMake doesn't know about the c++abi target within the
same CMake run.

This reverts this aspect back to how it was before SVN r357811.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358009 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 14:31:09 +00:00
Louis Dionne
9f8a406c0e [libc++] Remove install_name and compatibility_version on OS X
CMake already specifies those, and we never actually want those to be
used. In fact, r357811 re-ordered those flags in a way that the
explicitly-provided install_name was overriding the CMake-provided
install_name (instead of the other way around). This caused the dylib
to be considered a system dylib, and hence the explicitly provided rpath
to be ignored. This, in turn, caused some unit tests to start linking
against the system libc++.dylib instead of the freshly-built one.
Specifically, the unit tests that started linking against the system
dylib are those that didn't specify a DYLD_LIBRARY_PATH, such as
last_write_time.sh.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357946 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 21:37:42 +00:00
Louis Dionne
2884b592ec [libc++][CMake] Make sure the benchmarks link against libc++abi
The refactoring in r357811 made it so that we didn't add the ABI library
to the list of LIBCXX_LIBRARIES. As a result, benchmarks didn't link to
the ABI library and were missing symbols. This broke the build bots.

As a drive-by fix, we also provide the SHARED ABI library to the linker
script instead of the STATIC ABI library.

This couldn't be discovered on Apple platforms because libc++.dylib
re-exports libc++abi.dylib symbols there.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357818 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 21:05:32 +00:00
Louis Dionne
dda98abc8d [libc++] Localize CMake code only related to the shared library
Summary:
There's a lot of CMake logic that's only relevant to the shared library,
yet it was using a code path and setting variables that impact both the
shared and the static libraries. This patch moves this logic so that it
clearly only impacts the shared library.

Reviewers: phosek, smeenai, EricWF

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

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357811 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 20:29:54 +00:00
Louis Dionne
5a9ebbf0d9 [libc++] Add XFAILs for istream tests that were added in r357775
We fixed incorrect behavior of input streams in r357775 and tests were
added accordingly. However, older versions of macOS don't have the
change in the dylib yet, so the tests fail on those platforms.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357794 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 18:50:47 +00:00
Louis Dionne
0f60e0a4a0 [libc++] Fix error flags and exceptions propagated from input stream operations
Summary:
This is a re-application of r357533 and r357531. They had been reverted
because we thought the commits broke the LLDB data formatters, but it
turns out this was because only r357531 had been included in the CI
run.

Before this patch, we would only ever throw an exception if the badbit
was set on the stream. The Standard is currently very unclear on how
exceptions should be propagated and what error flags should be set by
the input stream operations. This commit changes libc++ to behave under
a different (but valid) interpretation of the Standard. This interpretation
of the Standard matches what other implementations are doing.

This effectively implements the wording in p1264r0. It hasn't been voted
into the Standard yet, however there is wide agreement that the fix is
correct and it's just a matter of time before the fix is standardized.

PR21586
PR15949
rdar://problem/15347558

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357775 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 16:33:37 +00:00
Eric Fiselier
262a337a18 Handle TLS values in sym_check
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357705 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-04 15:37:10 +00:00
Nico Weber
8155c10e99 Try to suppress nodiscard_extension failures with Xcode 9
See https://crbug.com/949509 for the error message.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357692 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-04 13:37:15 +00:00
Eric Fiselier
77e2337b29 Cleanup test failures in no discard tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357637 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 21:17:34 +00:00
Eric Fiselier
b9e1a17a70 Attempt to upgrade compiler used by appveyor builds
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357632 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 20:40:01 +00:00
Eric Fiselier
7050d98b9a disable appveyor config for MSVC 2015
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357631 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 20:36:51 +00:00
Nico Weber
fbddc46986 libcxx: Add _LIBCPP_NODISCARD_EXT to 38 more functions
This builds on the work done in r342808 and adds _LIBCPP_NODISCARD_EXT
to 37 more functions, namely:

adjacent_find, all_of, any_of, binary_search, clamp, count_if, count,
equal_range, equal, find_end, find_first_not_of, find_first_of, find_if,
find, includes, is_heap_until, is_heap, is_partitioned, is_permutation,
is_sorted_until, is_sorted, lexicographical_compare, lower_bound,
max_element, max, min_element, min, minmax_element, minmax, mismatch,
none_of, remove_if, remove, search_n, search, unique, upper_bound

The motivation here is that we noticed that find_if is nodiscard with
Visual Studio's standard library, and we deemed that useful
(https://crbug.com/948122).
https://devblogs.microsoft.com/cppblog/c17-progress-in-vs-2017-15-5-and-15-6/
says "Our criteria for emitting the warning are: discarding the return
value is a guaranteed leak [...], discarding the return value is
near-guaranteed to be incorrect (e.g. remove()/remove_if()/unique()), or
the function is essentially a pure observer (e.g. vector::empty() and
std::is_sorted())." so I went through algorithm and tried to apply these
criteria.

Some of these, like vector::empty() are already nodiscard per C++
standard and didn't need changing.

I didn't (yet?) go over std::string::find* methods which should probably
have _LIBCPP_NODISCARD_EXT too (but not as part of this change).

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357619 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 18:13:08 +00:00
Louis Dionne
d8ae8539a7 [libc++] Use std::is_nothrow_callable for std::invoke according to LWG 2807
Thanks to Zoe Carver for the patch.
Differential Revision: https://reviews.llvm.org/D58097

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357616 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 17:54:37 +00:00
Samuel Benzaquen
6f0f0a6b27 Add more benchmarks for literal strings.
Summary:
Comparing against the empty string should generate much better code that
what it does today.
We can also generate better code when comparing against literals that
are larger than the SSO space.

Reviewers: EricWF

Subscribers: christof, jdoerfert, libcxx-commits

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357614 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 17:40:51 +00:00
Louis Dionne
77c439298e [libc++][NFC] Rename test file according to the libc++ convention
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357588 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 14:38:28 +00:00
Louis Dionne
572de35685 [libc++] (Take 2) Correctly handle Objective-C++ ARC qualifiers in std::is_pointer
Summary:
Otherwise, std::is_pointer<id __strong> works, but std::is_pointer<id __weak>
(and others) don't work as expected.

The previous patch (r357517) had to be reverted in r357569 because it
broke the Chromium build. This patch shouldn't have the same problem.

rdar://problem/49126333

Reviewers: ahatanak, EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357586 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 14:29:52 +00:00
Hans Wennborg
e42f32507a Revert "[libc++] Correctly handle Objective-C++ ARC qualifiers in std::is_pointer"
This broke the Chromium build on Mac, see https://crbug.com/949071

> Summary:
> Otherwise, std::is_pointer<id __strong> works, but std::is_pointer<id __weak>
> (and others) don't work as expected.
>
> rdar://problem/49126333
>
> Reviewers: ahatanak, EricWF
>
> Subscribers: christof, jkorous, dexonsmith, libcxx-commits
>
> Differential Revision: https://reviews.llvm.org/D60087

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357569 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 10:07:37 +00:00
Petr Hosek
d5529b8cd9 [CMake] Differentiate between static and shared libc++abi
This addresses the issue introduced in r354212 which broke the case when
static libc++abi is merged into static libc++, but shared libc++ is
linked against shared libc++. There are 4 different possible
combinations which is difficult to capture using a single variable. This
change splits LIBCXX_CXX_ABI_LIBRARY into two:
LIBCXX_CXX_SHARED_ABI_LIBRARY and LIBCXX_CXX_STATIC_ABI_LIBRARY to
handle the shared and static cases. This in turn allows simplification
of some of the logic around merging of static archives.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357556 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 01:33:14 +00:00
Billy Robert O'Neal III
306670a063 [libcxx] [test] Add missing <stdexcept> to name std::out_of_range to string.conversions\stold.pass.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357547 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 00:08:42 +00:00