summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove unused code. NFCMarshall Clow2015-08-311-12/+0
| | | | llvm-svn: 246445
* Move __lazy_* metafunctions to type traits and add testsEric Fiselier2015-08-314-26/+200
| | | | llvm-svn: 246408
* Suppress clang warnings in some testsEric Fiselier2015-08-309-28/+55
| | | | llvm-svn: 246399
* Remove task to get C++03 tests passing from TODO.txtEric Fiselier2015-08-302-2/+1
| | | | llvm-svn: 246392
* Fix most GCC warnings during build. Only -Wattribute left.Eric Fiselier2015-08-282-4/+5
| | | | llvm-svn: 246280
* Finally get the test suite passing in C++03!!Eric Fiselier2015-08-284-3/+12
| | | | | | | | | After months of work there are only 4 tests still failing in C++03. This patch fixes those tests. All of the libc++ builders should be green. llvm-svn: 246275
* Remove empty file that arcanist createdEric Fiselier2015-08-281-0/+0
| | | | llvm-svn: 246273
* [libcxx] Constrain unique_ptr::operator=(unique_ptr<Tp, Dp>) in C++03 modeEric Fiselier2015-08-281-2/+9
| | | | | | | | | | | | | | | | | Summary: This patch properly constrains the converting assignment operator in C++03. It also fixes a bug where std::forward was given the wrong type. The following two tests begin passing in C++03: * `unique_ptr.single.asgn/move_convert.pass.cpp` * `unique_ptr.single.asgn/move_convert13.fail.cpp` Reviewers: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12173 llvm-svn: 246272
* [libcxx] Mark most test/std/future tests as UNSUPPORTED in C++03Eric Fiselier2015-08-2839-603/+356
| | | | | | | | | | | | | | | | | | | | Summary: This patch marks *most* tests for `std::promise`, `std::future` and `std::shared_future` as unsupported in C++03. These tests fail in C++03 mode because they attempt to copy a `std::future` even though it is a `MoveOnly` type. AFAIK the missing move-semantics in `std::future` is the only reason these tests fail but without move semantics these classes are useless. For example even though `std::promise::set_value` and `std::promise::set_exception(...)` work in C++03 `std::promise` is still useless because we cannot call `std::promise::get_future(...)`. It might be possible to hack `std::move(...)` like we do for `std::unique_ptr` to make the move semantics work but I don't think it is worth the effort. Instead I think we should leave the `<future>` header as-is and mark the failing tests as `UNSUPPORTED`. I don't believe there are any users of `std::future` or `std::promise` in C++03 because they are so unusable. Therefore I am not concerned about losing test coverage and possibly breaking users. However because there are still parts of `<future>` that work in C++03 it would be wrong to `#ifdef` out the entire header. @mclow.lists Should we take further steps to prevent the use of `std::promise`, `std::future` and `std::shared_future` in C++03? Note: This patch also cleans up the tests and converts them to use `support/test_allocator.h` instead of a duplicate class in `test/std/futures/test_allocator.h`. Reviewers: mclow.lists Subscribers: vsk, mclow.lists, cfe-commits Differential Revision: http://reviews.llvm.org/D12135 llvm-svn: 246271
* Fix bug in test_allocator<void> that used the wrong value to represent ↵Eric Fiselier2015-08-281-2/+2
| | | | | | object state llvm-svn: 246270
* [libcxx] Optimize away unneeded length calculation in ↵Eric Fiselier2015-08-281-2/+10
| | | | | | | | | | | | | | | | basic_string::compare(const char*) Summary: This patch optimizes basic_string::compare to use strcmp when the default char_traits has been given. See PR19900 for more information. https://llvm.org/bugs/show_bug.cgi?id=19900 Reviewers: mclow.lists Subscribers: bkramer, cfe-commits Differential Revision: http://reviews.llvm.org/D12355 llvm-svn: 246266
* Do not include pthread.h and sched.h when threads are disabledJonathan Roelofs2015-08-272-0/+4
| | | | | | | | Patch by Philippe Daouadi! http://reviews.llvm.org/D9639 llvm-svn: 246168
* Remove a switch statement, and replace with a bunch of ifs to silence a ↵Marshall Clow2015-08-271-11/+2
| | | | | | warning about 'all the enumeration values covered'. No functional change. llvm-svn: 246150
* [libcxx] Remove installation rules on Darwin when it would overwrite the ↵Eric Fiselier2015-08-263-15/+38
| | | | | | | | | | | | | | | | | system installation. Summary: On Mac OS X overwriting `/usr/lib/libc++.dylib` can cause your computer to fail to boot. This patch tries to make it harder to do that accidentally. If `CMAKE_SYSTEM_NAME` is `Darwin` and `CMAKE_INSTALL_PREFIX` is `/usr` don't generate installation rules unless the user explicitly provides `LIBCXX_OVERRIDE_DARWIN_INSTALL=ON`. Note that `CMAKE_INSTALL_PREFIX` is always absolute so we don't need to worry about things like `/usr/../usr`. Reviewers: mclow.lists, beanz, jroelofs Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12209 llvm-svn: 246070
* [libcxx] Add special warning flag detection logic to compiler.pyEric Fiselier2015-08-262-6/+30
| | | | | | | | | | | | Summary: Detecting `-Wno-<warning>` flags can be tricky with GCC (See https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html). This patch adds a special `addWarningFlagIfSupported(<flag>)` method to the test compiler object that can be used to add warning flags. The goal of this patch is to help get the test suite running with more warnings. Reviewers: danalbert, jroelofs Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11333 llvm-svn: 246069
* [libcxx] Rewrite C++03 __invoke.Eric Fiselier2015-08-265-415/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch rewrites the C++03 `__invoke` and related meta-programming. There are a number of major changes. `__invoke` in C++03 now has a fallback overload for when the invoke expression is ill-formed (similar to C++11). This means that the `__invoke_return` traits will return `__nat` when `__invoke(...)` is ill formed. This would previously cause a compile error. Bullets 1-4 of `__invoke` have been rewritten. In the old version `__invoke` had 32 overloads for bullets 1 and 2, one for each possible cv-qualified function signature with arities 0-3. 64 overloads would be needed to support member functions with varargs. Currently these overloads were fundamentally broken. An example overload looked like: ``` template <class Rp, class Tp, class T1, class A0> Rp __invoke(Rp (Tp::*pm)(A0) const, T1&, A0&) ``` Because `A0` appeared in two different deducible contexts it would have to deduce to be an exact match or the overload would be rejected. This is made even worse because `A0` appears without a reference qualifier in the member function signature and with a reference qualifier as an `__invoke` parameter. This means that only member functions that took all of their arguments by value could be matched. One possible fix would be to make the second occurrence of `A0` appear in a non-deducible context. This way any type convertible to `A0` could be passed as the first parameter. The benefit of this approach is that the signature of the member function enforces the arity and types taken by the `__invoke` signature it generates. However nothing in the `INVOKE` specification requires this behavior. My solution is to use a `__invoke_enable_if<PM_Type, Tp>` metafunction to selectively enable the `__invoke` overloads for bullets 1, 2, 3 and 4. It uses `__member_function_traits` to inspect and extract the return type and class type of the pointer to member. Using `__member_function_traits` to inspect `PM_Type` also allows us to reduce the number of `__invoke` overloads from 32 to 8 and add varargs support at the same time. Because `__invoke_enable_if` knows the exact return type of `__invoke` for bullets 1-4 we no longer need to use `decltype(__invoke(...))` to compute the return type in the `__invoke_return*` traits. This will reduce the problems caused by `#define decltype(X) __typeof__(X)` in C++03. Tests for this change have already been committed. All tests in `test/std/utilities/function.objects` now pass in C++03, previously there were 20 failures. Reviewers: K-ballo, howard.hinnant, mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11553 llvm-svn: 246068
* Refactor flaky shared_mutex testsEric Fiselier2015-08-264-22/+39
| | | | llvm-svn: 246055
* Remove XFAIL in test. The bug causing it has been fixed.Eric Fiselier2015-08-261-5/+0
| | | | llvm-svn: 246022
* Mark test as XFAIL with MSAN until D12311 gets committedEric Fiselier2015-08-251-0/+5
| | | | llvm-svn: 245922
* Refactor and fix more flaky shared_mutex testsEric Fiselier2015-08-256-37/+123
| | | | llvm-svn: 245918
* Move test/std/utilities/date.time to proper stable name utilities/time/date.timeEric Fiselier2015-08-245-0/+0
| | | | llvm-svn: 245877
* Misc drive-by cleanups. NFCJonathan Roelofs2015-08-244-3/+5
| | | | | | http://reviews.llvm.org/D12294 llvm-svn: 245876
* Add release goals to TODO.txtEric Fiselier2015-08-241-0/+10
| | | | llvm-svn: 245864
* Fix a crasher found by libFuzzerMarshall Clow2015-08-242-0/+25
| | | | llvm-svn: 245849
* Recommit rL245802: Cleanup fancy pointer rebinding in list using ↵Eric Fiselier2015-08-233-39/+46
| | | | | | | | | | | | __rebind_pointer. Currently we need an #ifdef branch every time we use pointer traits to rebind a pointer because it is done differently in C++11 and C++03. This patch introduces the __rebind_pointer utility to clean this up. Also add a test that list and it's iterators can be instantiated with incomplete element types. llvm-svn: 245806
* Revert r245802. It violates the incomplete type requirements. Eric Fiselier2015-08-232-17/+39
| | | | llvm-svn: 245805
* Cleanup fancy pointer rebinding in list using __rebind_pointer.Eric Fiselier2015-08-232-39/+17
| | | | | | | | Currently we need an #ifdef branch every time we use pointer traits to rebind a pointer because it is done differently in C++11 and C++03. This patch introduces the __rebind_pointer utility to clean this up. llvm-svn: 245802
* Refactor shared_timed_mutex tests.Eric Fiselier2015-08-2221-146/+119
| | | | | | | First I removed all of the uses of _LIBCPP_STD_VER and added LIT UNSUPPORTED tags to prevent the tests from being run in older standard dialects. Second I increased the time tolerances used in some tests when testing with Thread Sanitizer because thread sanitizer make these tests take longer. llvm-svn: 245793
* Fix default value for LLVM_INCLUDE_DOCS in out of tree build.Eric Fiselier2015-08-221-0/+3
| | | | llvm-svn: 245790
* [libcxx] Add new Sphinx documentationEric Fiselier2015-08-2210-1/+970
| | | | | | | | | | | | | | | | | Summary: This patch adds Sphinx based documentation to libc++. The goal is to make it easier to write documentation for libc++ since writing new documentation in HTML is cumbersome. This patch rewrites the main page for libc++ along with the instructions for using, building and testing libc++. The built documentation can be found and reviewed here: http://efcs.ca/libcxx-docs In order to build the sphinx documentation you need to specify the cmake options `-DLLVM_ENABLE_SPHINX=ON -DLIBCXX_INCLUDE_DOCS=ON`. This will add the makefile rule `docs-libcxx-html`. Reviewers: chandlerc, mclow.lists, danalbert, jroelofs Subscribers: silvas, cfe-commits Differential Revision: http://reviews.llvm.org/D12129 llvm-svn: 245788
* Remove completed items from TODO.TXTEric Fiselier2015-08-201-5/+3
| | | | llvm-svn: 245601
* Fix a typo: overidden -> overridden - Patch from Kai ZhaoEric Fiselier2015-08-201-1/+1
| | | | llvm-svn: 245539
* Fix a typo: abreviated -> abbreviated - Patch from Kai ZhaoEric Fiselier2015-08-202-2/+2
| | | | llvm-svn: 245538
* Cleanup unique_ptr failure tests and convert them to Clang verifyEric Fiselier2015-08-208-217/+98
| | | | llvm-svn: 245529
* Fix one last dynarray testEric Fiselier2015-08-201-20/+25
| | | | llvm-svn: 245528
* Fix more uses of uninitialized values in dynarrayEric Fiselier2015-08-201-20/+21
| | | | llvm-svn: 245525
* Cleanup failing dynarray testsEric Fiselier2015-08-192-24/+52
| | | | llvm-svn: 245522
* Add files that got missed in r245512.Eric Fiselier2015-08-194-179/+89
| | | | llvm-svn: 245513
* More unique_ptr test cleanup. Fixes in <memory> to come later.Eric Fiselier2015-08-195-132/+114
| | | | llvm-svn: 245512
* [libcxx] Add "install-libcxx" target.Eric Fiselier2015-08-193-2/+12
| | | | | | | | | | | | Summary: Currently you can't install libc++ from within the LLVM tree without installing all of LLVM. This patch adds an install rule for libc++. Reviewers: mclow.lists, danalbert, jroelofs, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11697 llvm-svn: 245470
* Remove test_atomic.h headerEric Fiselier2015-08-194-119/+10
| | | | | | | Because <atomic> can now be used in C++03 there is no need for the test_atomic.h header. This commit removes the header and converts all usages to use <atomic> instead. llvm-svn: 245468
* Replace __asan_set_error_exit_code() with __sanitizer_set_death_callback()Alexey Samsonov2015-08-191-2/+7
| | | | | | | | | | | | Summary: We are going to remove the former soon. Reviewers: EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12117 llvm-svn: 245467
* [libcxx] Allow use of <atomic> in C++03. Try 3.Eric Fiselier2015-08-1937-698/+304
| | | | | | | | | | | | | | | | | | | | | | | Summary: After putting this question up on cfe-dev I have decided that it would be best to allow the use of `<atomic>` in C++03. Although static initialization is a concern the syntax required to get it is C++11 only. Meaning that C++11 constant static initialization cannot silently break in C++03, it will always cause a syntax error. Furthermore `ATOMIC_VAR_INIT` and `ATOMIC_FLAG_INIT` remain defined in C++03 even though they cannot be used because C++03 usages will cause better error messages. The main change in this patch is to replace `__has_feature(cxx_atomic)`, which only returns true when C++ >= 11, to `__has_extension(c_atomic)` which returns true whenever clang supports the required atomic builtins. This patch adds the following macros: * `_LIBCPP_HAS_C_ATOMIC_IMP` - Defined on clang versions which provide the C `_Atomic` keyword. * `_LIBCPP_HAS_GCC_ATOMIC_IMP` - Defined on GCC > 4.7. We must use the fallback atomic implementation. * `_LIBCPP_HAS_NO_ATOMIC_HEADER` - Defined when it is not safe to include `<atomic>`. `_LIBCPP_HAS_C_ATOMIC_IMP` and `_LIBCPP_HAS_GCC_ATOMIC_IMP` are mutually exclusive, only one should be defined. If neither is defined then `<atomic>` is not implemented and including `<atomic>` will issue an error. Reviewers: chandlerc, jroelofs, mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11555 llvm-svn: 245463
* Fix warnings about pessimizing return moves for C++11 and higherDimitry Andric2015-08-197-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Throughout the libc++ headers, there are a few instances where _VSTD::move() is used to return a local variable. Howard commented in r189039 that these were there "for non-obvious reasons such as to help things limp along in C++03 language mode". However, when compiling these headers with warnings on, and in C++11 or higher mode (like we do in FreeBSD), they cause the following complaints about pessimizing moves: In file included from tests.cpp:26: In file included from tests.hpp:29: /usr/include/c++/v1/map:1368:12: error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move] return _VSTD::move(__h); // explicitly moved for C++03 ^ /usr/include/c++/v1/__config:368:15: note: expanded from macro '_VSTD' #define _VSTD std::_LIBCPP_NAMESPACE ^ Attempt to fix this by adding a _LIBCPP_EXPLICIT_MOVE() macro to __config, which gets defined to _VSTD::move for pre-C++11, and to nothing for C++11 and later. I am not completely satisfied with the macro name (I also considered _LIBCPP_COMPAT_MOVE and some other variants), so suggestions are welcome. :) Reviewers: mclow.lists, howard.hinnant, EricWF Subscribers: arthur.j.odwyer, cfe-commits Differential Revision: http://reviews.llvm.org/D11394 llvm-svn: 245421
* Use TestAtomic instead of std::atomic so the test can run in C++03Eric Fiselier2015-08-191-2/+3
| | | | llvm-svn: 245415
* Mark std::packaged_task tests as unsupported in C++03.Eric Fiselier2015-08-1918-61/+45
| | | | | | | std::packaged_task requires variadic templates and is #ifdef out in C++03. This patch silences the tests in C++03. This patch also rewrites the .fail.cpp tests so that they use clang verify. llvm-svn: 245413
* Remove commented out TODOs. They defined unneeded methods.Eric Fiselier2015-08-192-7/+0
| | | | llvm-svn: 245411
* Fix use of static_assert macro with nested commasEric Fiselier2015-08-191-1/+1
| | | | llvm-svn: 245410
* [libcxx] Add Atomic test helper and fix TSAN failures.Eric Fiselier2015-08-188-136/+257
| | | | | | | | | | | | | | | | | | | Summary: This patch attempts to fix the last 3 TSAN failures on the libc++ bot (http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-tsan/builds/143). This patch also adds a `Atomic` test type that can be used where `<atomic>` cannot. `wait.exception.pass.cpp` and `wait_for.exception.pass.cpp` were failing because the test replaced `std::terminate` with `std::exit`. `std::exit` would asynchronously run the TLS and static destructors and this would cause a race condition. See PR22606 and D8802 for more details. This is fixed by using `_Exit` to prevent cleanup. `notify_all_at_thread_exit.pass.cpp` exercises the same race condition but for different reasons. I fixed this test by manually joining the thread before beginning program termination. Reviewers: EricWF, mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11046 llvm-svn: 245389
* Move atomic_support.h and config_elast.h into src/includeEric Fiselier2015-08-186-4/+4
| | | | llvm-svn: 245354
OpenPOWER on IntegriCloud