| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
llvm-svn: 224658
|
|
|
|
| |
llvm-svn: 224064
|
|
|
|
|
|
| |
in 32-bit mode because they assumed that std::size_type and make_unsigned<ptrdiff_t>::type were always the same type. No change to libc++, just the tests.
llvm-svn: 212538
|
|
|
|
| |
llvm-svn: 208870
|
|
|
|
|
|
| |
containers. Libc++ already does this, but now we have tests for it.
llvm-svn: 203494
|
|
|
|
|
|
| |
containers. Still no changes to libc++
llvm-svn: 203480
|
|
|
|
|
|
| |
explicit. Note that libc++ already did this for string/deque/forward_list/list/vector and the unordered containers; implement it for set/multiset/map/multimap. Add tests for all the containers. Two drive-by fixes as well: add a missing explicit in <deque>, and remove a tab that snuck into a container test. This issue is also LLVM bug 15724, and resolves it.
llvm-svn: 202994
|
|
|
|
|
|
| |
in C++03
llvm-svn: 201021
|
|
|
|
|
|
| |
test suite. Moved one to /support, made it a superset, and removed all but one of the others, and iupdated all the includes. Left the odd one (thread/futures/test_allocator.h) for later.
llvm-svn: 196174
|
|
|
|
|
|
| |
/support and delete the other. Then adjust all the tests that used them to include the moved one. No functionality change.
llvm-svn: 195785
|
|
|
|
|
|
| |
missed when I went on vacation
llvm-svn: 191705
|
|
|
|
|
|
| |
associative and unordered containers. I beleive lack of support for this was accidentally recently introduced (by me) and this is fixing a regression. This time tests are put in to prevent such a regression in the future.
llvm-svn: 191692
|
|
|
|
| |
llvm-svn: 190576
|
|
|
|
| |
llvm-svn: 189140
|
|
|
|
|
|
| |
__tree_const_iterator constructor. Fix comment typos in other tests
llvm-svn: 188019
|
|
|
|
| |
llvm-svn: 187915
|
|
|
|
|
|
| |
unordered_multimap. This wraps up debug mode for the unordered containers.
llvm-svn: 187659
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. I had been detecting and trapping iterator == and \!= among iterators
in different containers as an error. But the trapping itself is actually
an error.
Consider:
#include <iostream>
#include <vector>
#include <algorithm>
template <class C>
void
display(const C& c)
{
std::cout << "{";
bool first = true;
for (const auto& x : c)
{
if (\!first)
std::cout << ", ";
first = false;
std::cout << x;
}
std::cout << "}\n";
}
int
main()
{
typedef std::vector<int> V;
V v1 = {1, 3, 5};
V v2 = {2, 4, 6};
display(v1);
display(v2);
V::iterator i = std::find(v1.begin(), v1.end(), 1);
V::iterator j = std::find(v2.begin(), v2.end(), 2);
if (*i == *j)
i = j; // perfectly legal
// ...
if (i \!= j) // the only way to check
v2.push_back(*i);
display(v1);
display(v2);
}
It is legal to assign an iterator from one container to another of the
same type. This is required to work. One might want to test whether or
not such an assignment had been made. The way one performs such a check
is using the iterator's ==, \!= operator. This is a logical and necessary
function and does not constitute an error.
2. I had a header circular dependence bug when _LIBCPP_DEBUG2 is defined.
This caused a problem in several of the libc++ tests.
Fixed.
3. There is a serious problem when _LIBCPP_DEBUG2=1 at the moment in that
std::basic_string is inoperable. std::basic_string uses __wrap_iterator
to implement its iterators. __wrap_iterator has been rigged up in debug
mode to support vector. But string hasn't been rigged up yet. This means
that one gets false positives when using std::string in debug mode. I've
upped std::string's priority in www/debug_mode.html.
llvm-svn: 187636
|
|
|
|
|
|
| |
well to keep all the tests passing. However unordered_map is at the very least still missing tests, if not functionality (if it isn't tested, it probably isn't working).
llvm-svn: 187446
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
missed on unordered_set, so I picked those up as well.
There are actually two debug modes:
1. -D_LIBCPP_DEBUG2 or -D_LIBCPP_DEBUG2=1
This is a relatively expensive debug mode, but very thorough. This is normally what you want to debug with, but may turn O(1) operations into O(N) operations.
2. -D_LIBCPP_DEBUG2=0
This is "debug lite." Only preconditions that can be checked with O(1) expense are checked. For example range checking on an indexing operation. But not iterator validity.
llvm-svn: 187369
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
unordered_set, however it is not complete yet for unordered_multiset,
unordered_map or unordered_multimap. There has been a lot of work done
for these other three containers, however that work was done just to
keep all of the tests passing.
You can try this out with -D_LIBCPP_DEBUG2. You will have to link to a
libc++.dylib that has been compiled with src/debug.cpp. So far, vector
(but not vector<bool>), list, and unordered_set are treated. I hope to
get the other three unordered containers up fairly quickly now that
unordered_set is done.
The flag _LIBCPP_DEBUG2 will eventually be changed to _LIBCPP_DEBUG, but
not today. This is my second effort at getting debug mode going for
libc++, and I'm not quite yet ready to throw all of the work under the
first attempt away.
The basic design is that all of the debug information is kept in a
central database, instead of in the containers. This has been done as
an attempt to have debug mode and non-debug mode be ABI compatible with
each other. There are some circumstances where if you construct a
container in an environment without debug mode and pass it into debug
mode, the checking will get confused and let you know with a readable
error message. Passing containers the other way: from debug mode out to
a non-debugging mode container should be 100% safe (at least that is the
goal).
llvm-svn: 186991
|
|
|
|
|
|
| |
[unordered_][multi]map. This fixes http://llvm.org/bugs/show_bug.cgi?id=16549
llvm-svn: 185711
|
|
|
|
|
|
| |
using just an argument for the key, as opposed to using piecewise_construct. However a bug report exposed that this created an unfortunate ambiguity. People who are currently using the extension will be notified the next time they compile, and will have to change to using piecewise_construct. There are no ABI issues with the removal of this extension. This fixes http://llvm.org/bugs/show_bug.cgi?id=16542
llvm-svn: 185666
|
|
|
|
|
|
| |
http://llvm.org/bugs/show_bug.cgi?id=16538
llvm-svn: 185665
|
|
|
|
|
|
| |
for the unordered containers only. This work still needs to be done on the sequence containers.
llvm-svn: 184635
|
|
|
|
|
|
| |
-I to that directory; rename 'iterators.h' to 'iterator_test.h'; remove hard-coded paths to include files from more than 350 source files
llvm-svn: 171594
|
|
|
|
| |
llvm-svn: 171452
|
|
|
|
|
|
| |
containers: The policy now allows a power-of-2 number of buckets to be requested (and that request honored) by the client. And if the number of buckets is set to a power of 2, then the constraint of the hash to the number of buckets uses & instead of %. If the client does not specify a number of buckets, then the policy remains unchanged: a prime number of buckets is selected. The growth policy is that the number of buckets is roughly doubled when needed. While growing, either the prime, or the power-of-2 strategy will be preserved. There is a small run time cost for putting in this switch. For very cheap hash functions, e.g. identity for int, the cost can be as high as 18%. However with more typical use cases, e.g. strings, the cost is in the noise level. I've measured cases with very cheap hash functions (int) that using a power-of-2 number of buckets can make look up about twice as fast. However I've also noted that a power-of-2 number of buckets is more susceptible to accidental catastrophic collisions. Though I've also noted that accidental catastrophic collisions are also possible when using a prime number of buckets (but seems far less likely). In short, this patch adds an extra tuning knob for those clients trying to get the last bit of performance squeezed out of their hash containers. Casual users of the hash containers will not notice the introduction of this tuning knob. Those clients who swear by power-of-2 hash containers can now opt-in to that strategy. Clients who prefer a prime number of buckets can continue as they have.
llvm-svn: 159836
|
|
|
|
|
|
| |
changed a while back and I'm just now updating to these new rules. In a nutshell, you've got to know you're emplacing to a pair and use one of pair's constructors. I made one extension: If you want to emplace the key and default construct the mapped_type, you can just emplace(key), as opposed to emplace(piecewise_construct, forward_as_tuple(key), forward_as_tuple()).
llvm-svn: 157503
|
|
|
|
| |
llvm-svn: 145707
|
|
|
|
| |
llvm-svn: 137522
|
|
|
|
| |
llvm-svn: 132647
|
|
|
|
| |
llvm-svn: 132646
|
|
|
|
| |
llvm-svn: 124508
|
|
|
|
| |
llvm-svn: 119395
|
|
|
|
| |
llvm-svn: 116515
|
|
|
|
|
|
| |
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.
llvm-svn: 113086
|
|
|
|
| |
llvm-svn: 111755
|
|
|
|
| |
llvm-svn: 103516
|
|
llvm-svn: 103490
|