Commit Graph

31 Commits

Author SHA1 Message Date
Thomas A
a574ade231 Downgrading libcxx to llvmorg-13.0.1
It turns out that llvmorg-14.0.6 might be too new for dyld (the vector base class no longer exist in that release).
2022-06-26 13:05:32 -07:00
Thomas A
e3bbeb7fdc Update libcxx source to llvmorg-14.0.6 2022-06-26 09:13:52 -07:00
Eric Fiselier
6cebf7c36f Improve codegen for deque.
This patch rewrites a few loops in deque and split_buffer to better
optimize the codegen. For constructors like
`deque<unsigned char> d(500000, 0);` this patch results in a 2x speedup.

The patch improves the codegen  in roughly three ways:

1. Changes do { ... } while (...) loops into more typical for loops.
  The optimizer can reason about normal looking loops better.

2. Split the iteration over a range into (A) iteration over the blocks,
then (B) iteration within the block. This nested structure helps LLVM
lower the inner loop to `memset`.

3. Do fewer things each iteration. Some of these loops were incrementing
  or changing 4-5 variables every loop (in addition to the
  construction). Previously most loops would increment the end pointer,
  the size, and decrement the count of remaining items to construct.
  Now we only increment a single pointer for most iterations.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368547 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-12 07:51:05 +00:00
Eric Fiselier
018a3d51a4 [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows
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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304357 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 22:07:49 +00:00
Eric Fiselier
5875c1d527 Cleanup remaining _LIBCPP_HAS_NO_<c++11-feature> usages in container headers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300643 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 01:23:04 +00:00
Eric Fiselier
161ccc1a72 Fix most failures caused by r300140
r300140 introduced a bunch of failures by changing the internal
interface provided by __compressed_pair. This patch fixes all of
the failures caused by the new interface by changing the existing
code to use it.

In addition to those changes this patch also fixes two separate
issues causing test failures:

1) Fix the member swap definition for __map_value_compare. Previously
   the swap was incorrectly configured to swap the comparator as const.

2) Fix an assertion failure in futures.task.members/ctor_func_alloc.pass.cpp
that incorrectly expected a move to take place when a single copy is sufficient.

There is one remaining failure regarding make_shared. I'll commit a fix for that
shortly.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300148 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 00:34:24 +00:00
Evgeniy Stepanov
a3b25f81d1 Cleanup: move visibility/linkage attributes to the first declaration.
This change moves visibility attributes from out-of-class method
definitions to in-class declaration. This is needed for a switch to
attribute((internal_linkage)) (see http://reviews.llvm.org/D13925)
which can only appear on the first declaration.

This change does not touch istream/ostream/streambuf. They are
handled separately in http://reviews.llvm.org/D14409.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@252385 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-07 01:22:13 +00:00
Marshall Clow
7d914d1bff Implement the first part of N4258: 'Cleaning up noexcept in the Library'. This patch deals with swapping containers, and implements a more strict noexcept specification (a conforming extension) than the standard mandates.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242056 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-13 20:04:56 +00:00
Howard Hinnant
1e564246ec G M: Changes all references to "x inline" to "inline x" where x = _libcpp_always_inline or _libcpp_inline_visibility macros.
The patch touches these files:

locale
array
deque
new
string
utility
vector
__bit_reference
__split_buffer
locale_win32.h
 
There is no intended functionality change and it is expected that reversing the position of the inline keyword with regard to the other keywords does not change the meaning of anything, least not for apple/Linux etc.
 
It is intended to make libcxx more consistent with itself and to prevent the 1000 or so
"inline.cpp(3) : warning C4141: 'inline' : used more than once" warnings that MS's cl.exe compiler emits without this patch, i.e. if inline is not the first keyword before a function name etc.
 
Prefer "inline [other inline related keyword]" over "[other related keyword] inline".
After this patch, libcxx should be consistent to this pattern.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191987 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04 22:09:00 +00:00
Howard Hinnant
fcd8db7133 Implement full support for non-pointer pointers in custom allocators for deque.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@184673 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-23 21:17:24 +00:00
Howard Hinnant
635bbbb6d1 Revert accidental check-in. These changes are probably good, but premature at this point.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@174625 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-07 15:31:44 +00:00
Howard Hinnant
46c49d19aa Michael van der Westhuizen: The attached patch add support for building against libc++abi and libcxxrt to CMake builds of libc++.
Usage (with the appropriate CC and CXX environment variables) is:
$ cmake -DLIBCXX_CXX_ABI=libcxxabi '-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=/home/michael/libcxxabi/include' ../libcxx
and:
$ cmake -DLIBCXX_CXX_ABI=libcxxrt '-DLIBCXX_LIBCXXRT_INCLUDE_PATHS=/home/michael/libcxxrt/src' ../libcxx

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@174623 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-07 15:27:39 +00:00
Howard Hinnant
b0bfd9bdd6 Implement a few optimizations for vector push_back and insert. Fixes r10828365.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@150542 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 00:41:34 +00:00
Howard Hinnant
ec3773c2da Quash a whole bunch of warnings
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145624 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01 20:21:04 +00:00
Howard Hinnant
9996844df0 Further macro protection by replacing _[A-Z] with _[A-Z]p
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145410 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 18:15:50 +00:00
Howard Hinnant
66c6f9733b Add protection from min/max macros
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145407 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 16:45:27 +00:00
Howard Hinnant
08e17472e4 Windows support by Ruben Van Boxem.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@142235 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 20:05:10 +00:00
Howard Hinnant
9cbee430da Fix const correctness bug in __move_assign. Found and fixed by Ion Gaztañaga.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@139032 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-02 20:42:31 +00:00
Howard Hinnant
5f255944ac __split_buffer should only require default constructible. Bug found and fixed by Jared Hoberock
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@138726 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-28 15:21:29 +00:00
Howard Hinnant
0949eedbd6 _STD -> _VSTD to avoid macro clash on windows
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 21:18:19 +00:00
Howard Hinnant
009b2c4583 After sleeping on it I've decided that all special members that can be noexcept, should be declared so. The client has the traits to detect and branch on this information, and it is often an important optimization. Give deque() a noexcept. Add test for deque default constructor and deque destructor.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132549 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03 15:16:49 +00:00
Howard Hinnant
0a612b0891 I've become quite disatsified with the lack of noexcept specifications on container move construction, move assignment operator and swap. Without proper decoration on at least move construction, vectors of containers will have unacceptable performance. Here's the fix for deque.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132480 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 20:00:14 +00:00
Howard Hinnant
04240d90ef Reverting an old optimization that conflicts with the new allocator model, and causes some test casees to compile that shouldn't.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@122830 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-04 19:53:31 +00:00
Michael J. Spencer
626916fc25 Add CMake build and fix major Linux blockers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@121510 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 19:47:54 +00:00
Howard Hinnant
1468b668aa N3142. Many of these traits are just placeholders with medium quality emulation; waiting on compiler intrinsics to do it right.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 22:17:28 +00:00
Howard Hinnant
333f50d30c visibility-decoration.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@114470 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 20:16:37 +00:00
Howard Hinnant
73d21a4f07 Changed __config to react to all of clang's currently documented has_feature flags, and renamed _LIBCPP_MOVE to _LIBCPP_HAS_NO_RVALUE_REFERENCES to be more consistent with the rest of the libc++'s flags, and with clang's nomenclature.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@113086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 23:28:19 +00:00
Howard Hinnant
324bb03bb9 Fixing whitespace problems
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@111750 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 00:02:43 +00:00
Howard Hinnant
f8ce459f8d First loop test passed. The data structure and search algorithm is still crude and in-flux. But this milestone needed to be locked in. Right now every loop is implemented in terms of a structure that will handle the most complicated {min, max} loop. Though only *-loops are tested at the moment. In a future iteration *-loops will likely be optimized a little more. The only tests are for basic posix so far, but I have prototype code running for extended posix and ecma. The prototype code lacks the complicating properties of the real <regex> requirements though.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@107803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 19:14:52 +00:00
Howard Hinnant
03aad81afd [rand.dist.bern.bin]. The evaluation function for this binomial distribution is hopefully just a placeholder. It is using the simplest and slowest method for computing the distribution and needs to be upgraded.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103524 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 23:26:59 +00:00
Howard Hinnant
bc8d3f97eb libcxx initial import
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103490 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 19:42:16 +00:00