summaryrefslogtreecommitdiffstats
path: root/libcxx/include/future
Commit message (Collapse)AuthorAgeFilesLines
* [libc++] Rework compressed pair constructors.Eric Fiselier2019-12-161-2/+2
| | | | | | | | | | | | This patch de-duplicates most compressed pair constructors to use the same code in C++11 and C++03. Part of doing that is deleting the "__second_tag()" and replacing it with a "__value_init_tag()" which has the same effect, but allows for the removal of the special "one-arg" first element constructor. This patch is intended to have no semantic change.
* [libc++] Hide some functions and types in <future> and <thread> as hiddenLouis Dionne2019-12-101-6/+6
| | | | | Otherwise, weak symbols leak into user programs when using `async` with non-internal types.
* Assume __is_final, __is_base_of, and friends.Eric Fiselier2019-06-211-4/+0
| | | | | | | | | | All the compilers we support provide these builtins. We don't need to do a configuration dance anymore. This patch also cleans up some dead or almost dead C++11 feature detection macros. llvm-svn: 364047
* [NFC][libcxx] Remove trailing whitespaceLouis Dionne2019-05-291-5/+5
| | | | | | It's incredibly annoying when trying to create diffs llvm-svn: 361981
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | | 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
* [libc++] Remove race condition in std::asyncLouis Dionne2018-08-241-12/+7
| | | | | | | | | | | | | | | | | Summary: The state associated to the future was set in one thread (with synchronization) but read in another thread without synchronization, which led to a data race. https://bugs.llvm.org/show_bug.cgi?id=38181 rdar://problem/42548261 Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D51170 llvm-svn: 340608
* Fix use of incorrect _LIBCXX macro (should be _LIBCPP).Eric Fiselier2018-07-241-1/+1
| | | | llvm-svn: 337817
* [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by ↵Louis Dionne2018-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | _LIBCPP_INLINE_VISIBILITY Summary: We never actually mean to always inline a function -- all the uses of the macro I could find are actually attempts to control the visibility of symbols. This is better described by _LIBCPP_INLINE_VISIBILITY, which is actually always defined the same. This change is orthogonal to the decision of what we're actually going to do with _LIBCPP_INLINE_VISIBILITY -- it just simplifies things by having one canonical way of doing things. Note that this commit had originally been applied in r336369 and then reverted in r336382 because of unforeseen problems. Both of these problems have now been fixed. Reviewers: EricWF, mclow.lists Subscribers: christof, dexonsmith, erikvanderpoel Differential Revision: https://reviews.llvm.org/D48892 llvm-svn: 336866
* Revert "[libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by ↵Louis Dionne2018-07-051-1/+1
| | | | | | | | | | | | | | | _LIBCPP_INLINE_VISIBILITY" This reverts commit r336369. The commit had two problems: 1. __pbump was marked as _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY instead of _LIBCPP_INLINE_VISIBILITY, which lead to two symbols being added in the dylib and the check-cxx-abilist failing. 2. The LLDB tests started failing because they undefine `_LIBCPP_INLINE_VISIBILITY`. I need to figure out why they do that and fix the tests before we can go forward with this change. llvm-svn: 336382
* [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITYLouis Dionne2018-07-051-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: We never actually mean to always inline a function -- all the uses of the macro I could find are actually attempts to control the visibility of symbols. This is better described by _LIBCPP_INLINE_VISIBILITY, which is actually always defined the same. This change is orthogonal to the decision of what we're actually going to do with _LIBCPP_INLINE_VISIBILITY -- it just simplifies things by having one canonical way of doing things. Reviewers: EricWF Subscribers: christof, llvm-commits, dexonsmith, erikvanderpoel, mclow.lists Differential Revision: https://reviews.llvm.org/D48892 llvm-svn: 336369
* Implement LWG 3039 and 3041 - 'Treating Unnecessary decay'.Marshall Clow2018-03-201-4/+4
| | | | llvm-svn: 328054
* Revert commit removing allocator support from packaged_task. Will ↵Marshall Clow2017-11-271-0/+34
| | | | | | investigate further llvm-svn: 319091
* Implement LWG#2921 and LWG#2976 - removing allocator support from packaged_task.Marshall Clow2017-11-271-34/+0
| | | | llvm-svn: 319080
* Add [[nodiscard]] to std::async as part of P0600.Marshall Clow2017-11-231-1/+2
| | | | llvm-svn: 318889
* Add markup for libc++ dylib availabilityMehdi Amini2017-05-041-23/+27
| | | | | | | | | | | | | | | Libc++ is used as a system library on macOS and iOS (amongst others). In order for users to be able to compile a binary that is intended to be deployed to an older version of the platform, clang provides the availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>_ that can be placed on declarations to describe the lifecycle of a symbol in the library. See docs/DesignDocs/AvailabilityMarkup.rst for more information. Differential Revision: https://reviews.llvm.org/D31739 llvm-svn: 302172
* [libc++] Make _LIBCPP_TYPE_VIS export membersShoaib Meenai2017-03-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Most classes annotated with _LIBCPP_TYPE_VIS need to have at least some of their members exported, otherwise we have a lot of link errors when linking against a libc++ built with hidden visibility. This also makes _LIBCPP_TYPE_VIS be consistent across platforms, since on Windows it already exports members. With this change made, any template methods of a class marked _LIBCPP_TYPE_VIS will also get default visibility when instantiatied, which is not desirable for clients of libc++ headers who wish to control their visibility; this is the same issue as PR30642. Annotate all problematic methods with an explicit visibility specifier to avoid this. The problematic methods were found by running bad-visibility-finder [1] against the libc++ headers after making the _LIBCPP_TYPE_VIS change. The small methods were marked for inlining; the larger ones hidden. [1] https://github.com/smeenai/bad-visibility-finder Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25208 llvm-svn: 296732
* Fixed a typo in the synopsis (noecept -> noexcept). Thanks to Kim for the catchMarshall Clow2017-01-251-1/+1
| | | | llvm-svn: 293079
* Implement LWG2556: Wide contract for future::share()Marshall Clow2017-01-241-9/+9
| | | | llvm-svn: 292992
* [NFC] Rename _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VISEric Fiselier2017-01-041-15/+15
| | | | | | | | | | | | | The name _LIBCPP_TYPE_VIS_ONLY is no longer accurate because both _LIBCPP_TYPE_VIS and _LIBCPP_TYPE_VIS_ONLY expand to __attribute__((__type_visibility__)) with Clang. The only remaining difference is that _LIBCPP_TYPE_VIS_ONLY can be applied to templates whereas _LIBCPP_TYPE_VIS cannot (due to dllimport/dllexport not being allowed on templates). This patch renames _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS. llvm-svn: 291035
* Avoid unused warning in __throw_future_error w/o exceptions enabledEric Fiselier2016-12-241-0/+1
| | | | llvm-svn: 290479
* Implement P0516: 'Clarify That shared_future’s Copy Operations have Wide ↵Marshall Clow2016-11-141-3/+3
| | | | | | Contracts' which was adopted last week in Issaquah llvm-svn: 286877
* Implement P0510 'Make future_error Constructible' adopted in IssaquahMarshall Clow2016-11-141-2/+4
| | | | llvm-svn: 286864
* Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception ↵Marshall Clow2016-08-251-2/+2
| | | | | | 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
* Cleanup non-standard tests as reported by STL@microsoft.com. NFC.Eric Fiselier2016-06-011-3/+3
| | | | | | | | | | | | | | | This patch addresses the following issues in the test suite: 1. Move "std::bad_array_length" test from std/ to libcxx/ test directory since the feature is not a part of the standard. 2. Rename "futures.tas" test directory to "futures.task" since that is the correct stable name. 3. Move tests for "packaged_task<T>::result_type" from std/ to libcxx/ test directory since the typedef is a libc++ extension. llvm-svn: 271430
* Mark LWG issue 2276 as complete. Add _LIBCPP_ASSERTS for itEric Fiselier2016-05-311-0/+2
| | | | llvm-svn: 271247
* Add a couple of _LIBCPP_ASSERT calls. No functional change.Marshall Clow2016-05-161-0/+2
| | | | llvm-svn: 269663
* Cleanup: move visibility/linkage attributes to the first declaration.Evgeniy Stepanov2015-11-071-9/+18
| | | | | | | | | | | | 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. llvm-svn: 252385
* [libcxx] Attempt to fix __throw_future_error in C++03 Eric Fiselier2015-10-021-31/+30
| | | | | | | | | | | | | | | | | | Summary: Hi Marshall, Could you please test this patch and see if you run into the same linker errors we talked about? I can't reproduce on linux or OS X. Hopefully you can't find any problems and we can fix the C++03 bot. Reviewers: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13337 llvm-svn: 249192
* Make a helper routine __throw_future_error, and encapsulate the #ifdef ↵Marshall Clow2015-09-031-72/+43
| | | | | | _LIBCPP_NO_EXCEPTIONS there, instead of duplicating it throughout the code. No functionality change llvm-svn: 246772
* K-ballo pointed out that I missed one of the specializations of ↵Marshall Clow2015-06-301-1/+1
| | | | | | packaged_task when I committed r241068. Thanks for the catch. llvm-svn: 241095
* Implement LWG#2407: 'packaged_task(allocator_arg_t, const Allocator&, F&&) ↵Marshall Clow2015-06-301-2/+2
| | | | | | should neither be constrained nor explicit' llvm-svn: 241068
* Fix PR23293 - Do not unlock shared state before notifying consumers.Eric Fiselier2015-06-121-4/+0
| | | | | | | | Within the shared state methods do not unlock the lock guards manually. This could cause a race condition where the shared state is destroyed before the method is complete. llvm-svn: 239577
* Remove use of _[A-Z] identifiers and poison them to detect usageEric Fiselier2015-02-051-9/+9
| | | | llvm-svn: 228353
* Add support for "fancy" pointers to promise and packaged_task.Eric Fiselier2014-10-231-30/+38
| | | | | | | | | | | | | | | | | | | | | Summary: This patch is very closely related to D4859. Please see http://reviews.llvm.org/D4859 for more information. This patch adds support for "fancy" pointers and allocators to promise and packaged_task. The changes made to support this are exactly the same as in D4859. Test Plan: "fancy" pointer tests were added to each constructor affected by the change. Reviewers: danalbert, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4862 llvm-svn: 220471
* Address some post-commit review comments on r217261Jonathan Roelofs2014-09-051-1/+1
| | | | llvm-svn: 217276
* Allow libc++ to be built on systems without POSIX threadsJonathan Roelofs2014-09-051-0/+6
| | | | | | | | | | If you're crazy enough to want this sort of thing, then add -D_LIBCPP_HAS_NO_THREADS to your CXXFLAGS and --param=additiona_features=libcpp-has-no-threads to your lit commnad line. http://reviews.llvm.org/D3969 llvm-svn: 217271
* Fix PR19819Marshall Clow2014-04-071-2/+2
| | | | llvm-svn: 205709
* Better inline marking for __does_policy_contain. Thanks to Chongyu Zhu for ↵Marshall Clow2013-11-031-1/+1
| | | | | | the catch llvm-svn: 193963
* Mark __does_policy_contain as 'inline'. Thanks to Chongyu Zhu for the catchMarshall Clow2013-11-031-1/+1
| | | | llvm-svn: 193962
* Fix LWG Issue 2078. Make std::async(policy,...) try multiple policies until ↵Marshall Clow2013-11-031-6/+18
| | | | | | one succeeds. llvm-svn: 193960
* Patch from GM to make more implicit bools explicit since we can't stop MSVC ↵Marshall Clow2013-10-131-2/+2
| | | | | | warning about this in headers and to warn is the MSVC default. No functionality change. llvm-svn: 192548
* LWG Issue 2097: packaged_task constructors should be constrainedMarshall Clow2013-10-121-4/+36
| | | | llvm-svn: 192544
* Apply LWG 2021. This is only a documentation change. Also bringing c++1y ↵Howard Hinnant2013-09-211-2/+2
| | | | | | status page up to date. llvm-svn: 191141
* Marshall Clow: LWG Issue 2056: future_errc enums start with value 0 ↵Howard Hinnant2013-09-141-6/+6
| | | | | | (invalid value for broken_promise). llvm-svn: 190756
* Nico Rieck: this patch series fixes visibility issues on Windows as ↵Howard Hinnant2013-08-121-16/+16
| | | | | | explained in <http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-August/031214.html>. llvm-svn: 188192
* My previous reorganization of addressof broke -std=c++03. Thanks much to ↵Howard Hinnant2013-08-081-3/+3
| | | | | | Arnold Schwaighofer for catching this. This patch also catches a few more missing addressof in <future>, thanks go to Zhihao Yuan for catching these. llvm-svn: 187997
* Constrain launch ~ operator to defined bits.Howard Hinnant2013-07-021-1/+1
| | | | llvm-svn: 185452
* Add operators to make launch a bitmask type. Searched all of the standard, ↵Howard Hinnant2013-06-291-0/+66
| | | | | | and libc++ to see if this error occurred elsewhere and didn't see any other place. This fixes http://llvm.org/bugs/show_bug.cgi?id=16207 llvm-svn: 185265
* No functionality change at this time. I've split _LIBCPP_VISIBLE up into ↵Howard Hinnant2013-03-061-19/+19
| | | | | | two flags: _LIBCPP_TYPE_VIS and _LIBCPP_FUNC_VIS. This is in preparation for taking advantage of clang's new __type_visibility__ attribute. llvm-svn: 176593
* Donated anonymously: This enables GCC 4.8.0 to build libc++.Howard Hinnant2013-01-211-1/+1
| | | | llvm-svn: 173060
OpenPOWER on IntegriCloud