[PATCH] D29630: [libcxx] Threading support: externalize sleep_for()

2017-02-07 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath created this revision. Different platforms implement the wait/sleep behaviour in very different ways. It makes sense to hoist this functionality into the threading API. I also feel similarly about `hardware_concurrecy()` implementation. Any thoughts on that?

[PATCH] D29630: [libcxx] Threading support: externalize sleep_for()

2017-02-07 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added inline comments. Comment at: include/__threading_support:593 + using namespace chrono; + milliseconds ms = duration_cast(ns); + if (ms.count() == 0 || ns > duration_cast(ms)) joerg wrote: > Use (ns + 99) so that the cast rounds up. So, this

[PATCH] D29630: [libcxx] Threading support: externalize sleep_for()

2017-02-08 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath updated this revision to Diff 87669. rmaprath added a comment. Sorry for the delay, I've updated the patch with all the comments addressed. @EricWF: Got one question before I commit: The `sleep_for` function in the dylib (`thread.cpp`) is now quite small. Is there a particular reason

[PATCH] D29630: [libcxx] Threading support: externalize sleep_for()

2017-02-08 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. In https://reviews.llvm.org/D29630#670876, @EricWF wrote: > In https://reviews.llvm.org/D29630#670873, @rmaprath wrote: > > > Sorry for the delay, I've updated the patch with all the comments addressed. > > > > @EricWF: Got one question before I commit: The `sleep_for`

[PATCH] D29063: [libcxx] Never use within libc++

2017-01-24 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. @EricWF: My downstream builds have `-DLLVM_ENABLE_ASSERTIONS=ON` by default and they are showing some failures after this commit. Log attached: F3019711: log.txt It should be pretty easy to reproduce these (I'm on Ubuntu 16.04) if

[PATCH] D29063: [libcxx] Never use within libc++

2017-01-24 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. Sorry, I meant `-DLIBCXX_ENABLE_ASSERTIONS=ON`. https://reviews.llvm.org/D29063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D29757: [libcxx] Threading support: Externalize hardware_concurrency()

2017-02-24 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath updated this revision to Diff 89664. rmaprath added a comment. Different take on the patch: Externalize this function only for the externally-thread-api variant. This is much less intrusive. Note that I haven't added the declaration of `__libcpp_thread_hw_concurrency()` into

[PATCH] D29818: [libcxx] Threading support: Attempt to externalize system_clock::now() and steady_clock::now() implementations

2017-02-24 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath updated this revision to Diff 89665. rmaprath added a comment. Different approach: Externalize these functions only for the external-thread-api library variant. (Similar to https://reviews.llvm.org/D29757) https://reviews.llvm.org/D29818 Files: src/chrono.cpp Index:

[PATCH] D30339: [libcxxabi] Disable calls to fprintf when building for baremetal targets in release mode

2017-02-24 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. Perhaps change `config.h` and remove the definition there and adjust other places accordingly? The current form is very easy to trip over. Repository: rL LLVM https://reviews.llvm.org/D30339 ___ cfe-commits mailing

[PATCH] D30290: [libcxx][zorg] Fix no-exceptions builder configurations

2017-02-23 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath marked an inline comment as done. rmaprath added a comment. Thanks! Committed as r295963. @gkistanova: Could you please let me know when the next restart is due? I would like to keep an eye on the builders. Cheers, / Asiri Repository: rL LLVM https://reviews.llvm.org/D30290

[PATCH] D30290: [libcxx][zorg] Fix no-exceptions builder configurations

2017-02-23 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath marked an inline comment as done. rmaprath added inline comments. Comment at: buildbot/osuosl/master/config/builders.py:1196 +lit_extra_opts={'link_flags': '"-lc++abi -lc -lm -lpthread -ldl -L/opt/llvm/lib/clang/3.9.0/lib/linux -lclang_rt.builtins-armhf"'},

[PATCH] D30290: [libcxx][zorg] Fix no-exceptions builder configurations

2017-02-23 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath updated this revision to Diff 89485. rmaprath added a comment. Updated to address comments from @rengolin. In theory, it should not be necessary to link-in or enable the unwinder for these tests. However, it is best to leave this for a separate patch (after some local testing), just

[PATCH] D30290: [libcxx][zorg] Fix no-exceptions builder configurations

2017-02-23 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath created this revision. Herald added a reviewer: EricWF. The no-exceptions builders are missing the -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF flag (without this, only the libc++ libraries will be built without exceptions support, libc++abi will still be built with exceptions support - this is

[PATCH] D30290: [libcxx][zorg] Fix no-exceptions builder configurations

2017-02-23 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added inline comments. Comment at: buildbot/osuosl/master/config/builders.py:1196 +lit_extra_opts={'link_flags': '"-lc++abi -lc -lm -lpthread -ldl -L/opt/llvm/lib/clang/3.9.0/lib/linux -lclang_rt.builtins-armhf"'}, +

[PATCH] D13289: [libc++] Provide additional templates for valarray transcendentals that satisfy the standard synopsis

2017-02-15 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. I've raised PR31966 to poke this :) https://reviews.llvm.org/D13289 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D29757: [libcxx] Threading support: Externalize hardware_concurrency()

2017-02-13 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath updated this revision to Diff 88189. rmaprath retitled this revision from "Threading support: Externalize hardware_concurrency()" to "[libcxx] Threading support: Externalize hardware_concurrency()". rmaprath added a comment. Re-based on trunk. https://reviews.llvm.org/D29757 Files:

[PATCH] D29818: [libcxx] Threading support: Attempt to externalize system_clock::now() and steady_clock::now() implementations

2017-02-13 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath updated this revision to Diff 88190. rmaprath added a comment. Re-based. https://reviews.llvm.org/D29818 Files: include/__threading_support src/chrono.cpp Index: src/chrono.cpp === --- src/chrono.cpp +++

[PATCH] D29757: Threading support: Externalize hardware_concurrency()

2017-02-09 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath created this revision. Another one of those platform-dependent methods which should live behind the threading API. https://reviews.llvm.org/D29757 Files: include/__threading_support src/thread.cpp Index: src/thread.cpp

[PATCH] D29818: [libcxx] Threading support: Attempt to externalize system_clock::now() and steady_clock::now() implementations

2017-02-10 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath created this revision. These implementations depend heavily on the underlying platform. It would be good to put them behind a porting function within the threading API as quite a bit of threading functionality depend on the clocks. The `steady_clock::now()` implementation was

[PATCH] D29757: [libcxx] Threading support: Externalize hardware_concurrency()

2017-02-15 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. Ping? https://reviews.llvm.org/D29757 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D29818: [libcxx] Threading support: Attempt to externalize system_clock::now() and steady_clock::now() implementations

2017-02-15 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. Ping? https://reviews.llvm.org/D29818 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D29818: [libcxx] Threading support: Attempt to externalize system_clock::now() and steady_clock::now() implementations

2017-02-28 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath updated this revision to Diff 90025. rmaprath added a comment. Fixed minor omission. https://reviews.llvm.org/D29818 Files: src/chrono.cpp Index: src/chrono.cpp === --- src/chrono.cpp +++ src/chrono.cpp @@ -11,6 +11,7

[PATCH] D30516: [libc++] Add option to disable new/delete overloads when libc++abi provides them.

2017-03-02 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. Thanks for these patches! We had some downstream hacks to workaround this, never got around to sort it out. Now it looks much better. https://reviews.llvm.org/D30516 ___ cfe-commits mailing list

[PATCH] D30459: [libcxxabi] Clean up macro usage

2017-03-01 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. In https://reviews.llvm.org/D30459#689461, @rs wrote: > Thanks for reviewing. Before I commit could you tell me if I need to update > any build systems e.g. buildbots ? Those two options are not used by any of the current public builders, so I think it's safe to

[PATCH] D27204: [libcxxabi] Introduce an externally threaded libc++abi variant

2016-12-08 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath abandoned this revision. rmaprath added a comment. Abandoning as this has been replaced with https://reviews.llvm.org/D27575. https://reviews.llvm.org/D27204 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D27575: [libcxxabi] Introduce an externally threaded libc++abi variant (take-2)

2016-12-08 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath created this revision. rmaprath added reviewers: EricWF, mclow.lists. rmaprath added a subscriber: cfe-commits. Herald added a subscriber: mgorny. This is a replacement for https://reviews.llvm.org/D27204. Re-worked so that we use the threading API of `libcxx` instead of creating a

[PATCH] D27206: [libcxx] Test support for the externally threaded libcxxabi variant

2016-12-08 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath abandoned this revision. rmaprath added a comment. Abandoning (replaced with https://reviews.llvm.org/D27575/https://reviews.llvm.org/D27576). https://reviews.llvm.org/D27206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D27576: [libcxx] libc++ changes necessary for the externally threaded libcxxabi variant

2016-12-08 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath created this revision. rmaprath added reviewers: EricWF, mclow.lists. rmaprath added a subscriber: cfe-commits. Herald added a subscriber: mgorny. This patch adds support for https://reviews.llvm.org/D27575. A couple of new threading API calls has been introduced (libc++abi requires

[PATCH] D27576: [libcxx] libc++ changes necessary for the externally threaded libcxxabi variant

2016-12-12 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath updated this revision to Diff 81059. https://reviews.llvm.org/D27576 Files: CMakeLists.txt include/__threading_support test/CMakeLists.txt test/libcxx/test/config.py test/lit.site.cfg.in Index: test/lit.site.cfg.in

[PATCH] D27576: [libcxx] libc++ changes necessary for the externally threaded libcxxabi variant

2016-12-12 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added inline comments. Comment at: include/__threading_support:193 +// Execute once +int __libcpp_execute_once(__libcpp_exec_once_flag *flag, + void (*init_routine)(void)) { EricWF wrote: > These should have `inline`. In fact

[PATCH] D27575: [libcxxabi] Introduce an externally threaded libc++abi variant (take-2)

2016-12-12 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added inline comments. Comment at: CMakeLists.txt:121 option(LIBCXXABI_HAS_PTHREAD_API "Ignore auto-detection and force use of pthread API" OFF) +option(LIBCXXABI_HAS_EXTERNAL_THREAD_API + "Build libc++abi with an externalized threading API. EricWF

[PATCH] D27614: Mark tests as unsupported under libcpp-no-exceptions

2016-12-12 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. LGTM. Needs approval from @EricWF or @mclow.lists. https://reviews.llvm.org/D27614 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27576: [libcxx] libc++ changes necessary for the externally threaded libcxxabi variant

2016-12-15 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath marked an inline comment as done. rmaprath added a comment. Gentle ping. https://reviews.llvm.org/D27576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27575: [libcxxabi] Introduce an externally threaded libc++abi variant (take-2)

2016-12-15 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. Gentle ping. https://reviews.llvm.org/D27575 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27575: [libcxxabi] Introduce an externally threaded libc++abi variant (take-2)

2016-12-12 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath updated this revision to Diff 81062. https://reviews.llvm.org/D27575 Files: CMakeLists.txt src/config.h src/cxa_exception.cpp src/cxa_exception_storage.cpp src/cxa_guard.cpp src/cxa_thread_atexit.cpp src/fallback_malloc.cpp src/threading_support.h test/CMakeLists.txt

[PATCH] D27575: [libcxxabi] Introduce an externally threaded libc++abi variant (take-2)

2016-12-12 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. Patch updated with more context. https://reviews.llvm.org/D27575 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D28608: [libcxx] Don't assume __libcpp_thread_t is an integral type.

2017-01-12 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath created this revision. rmaprath added reviewers: compnerd, EricWF. rmaprath added a subscriber: cfe-commits. We have refactored the underlying platform thread type into `__libcpp_thread_t`, but there are few places in the source where it is assumed to be an integral type. This was

[PATCH] D28610: [libcxx] Improve design documentation for the external-thread-library configuration

2017-01-12 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath created this revision. rmaprath added reviewers: EricWF, mclow.lists. rmaprath added a subscriber: cfe-commits. Trying to improve the documentation for the external-thread-library configuration of `libc++`. https://reviews.llvm.org/D28610 Files:

[PATCH] D27204: [libcxxabi] Introduce an externally threaded libc++abi variant

2016-11-29 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath created this revision. rmaprath added reviewers: mclow.lists, EricWF, bcraig. rmaprath added a subscriber: cfe-commits. Herald added a subscriber: mgorny. This is more-or-less a mirror image of https://reviews.llvm.org/D21968, repeated for libcxxabi. I will soon upload a dependent

[PATCH] D27204: [libcxxabi] Introduce an externally threaded libc++abi variant

2016-12-05 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. In https://reviews.llvm.org/D27204#613177, @EricWF wrote: > In https://reviews.llvm.org/D27204#613172, @rmaprath wrote: > > > In https://reviews.llvm.org/D27204#613122, @EricWF wrote: > > > > > My main issue with this patch (and https://reviews.llvm.org/D27206) is > >

[PATCH] D27204: [libcxxabi] Introduce an externally threaded libc++abi variant

2016-12-05 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. In https://reviews.llvm.org/D27204#613122, @EricWF wrote: > My main issue with this patch (and https://reviews.llvm.org/D27206) is that > there are now two different CMake options for building two different external > threading libraries. I would much prefer having

[PATCH] D28229: [libcxx] Fix testing of the externally-threaded library build after r290850

2017-01-03 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath created this revision. rmaprath added reviewers: compnerd, EricWF. rmaprath added a subscriber: cfe-commits. Before r290850, building libcxx with `-DLIBCXX_HAS_EXTERNAL_THREAD_API=ON` had two uses: - Allow platform vendors to plug-in an `__external_threading` header which should take

[PATCH] D20874: [libcxx] Two more threading dependencies

2016-12-30 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath abandoned this revision. rmaprath added a comment. Most of this is no longer needed. I'll submit patches for the parts that are actually needed (e.g. nanosleep) later on. Thanks. https://reviews.llvm.org/D20874 ___ cfe-commits mailing

[PATCH] D28229: [libcxx] Fix testing of the externally-threaded library build after r290850

2017-01-03 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. I will commit this now to get the testing working again. Thought of putting up the patch for review in case if there is a better way to do this. @compnerd: I wondered, for windows threading support, why not do something similar to `__external_threading` (and how it is

[PATCH] D28229: [libcxx] Fix testing of the externally-threaded library build after r290850

2017-01-04 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. In https://reviews.llvm.org/D28229#634278, @compnerd wrote: > I dont think that making Win32 threading an external one makes much sense > unless we also do the same for pthreads. Its just as valid a threading model > as pthreads, so why give preferential treatment to

[PATCH] D28316: [libc++] Cleanup and document <__threading_support>

2017-01-05 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. This is much better (few nits inline). And many thanks for the docs update (btw, do those docs updates land on some web URL automagically when committed?). I think we should point out on the docs that `_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL` is only meant for `libc++`

[PATCH] D28316: [libc++] Cleanup and document <__threading_support>

2017-01-05 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. In https://reviews.llvm.org/D28316#636700, @EricWF wrote: > In https://reviews.llvm.org/D28316#636686, @rmaprath wrote: > > > (btw, do those docs updates land on some web URL automagically when > > committed?). > > > Assuming the builder isn't broken then yes, the docs

[PATCH] D27575: [libcxxabi] Introduce an externally threaded libc++abi variant (take-2)

2016-12-29 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added inline comments. Comment at: src/fallback_malloc.cpp:37 class mutexor { public: EricWF wrote: > rmaprath wrote: > > EricWF wrote: > > > Can't we replace this class with `std::mutex` directly? > > Again, I should've included more context to the

[PATCH] D27575: [libcxxabi] Introduce an externally threaded libc++abi variant (take-2)

2016-12-19 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. Ping. https://reviews.llvm.org/D27575 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27576: [libcxx] libc++ changes necessary for the externally threaded libcxxabi variant

2016-12-19 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. Ping. https://reviews.llvm.org/D27576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D31178: [libcxxabi] Fix exception address alignment test for EHABI

2017-03-21 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath created this revision. Herald added a subscriber: aemerson. This test was failing on our downstream (bare-metal) runs and only now I got around to investigate it. The problem is, this test assumes the Itanium ABI, whereas EHABI requires the exception address to be 8-byte aligned. I

[PATCH] D31178: [libcxxabi] Fix exception address alignment test for EHABI

2017-03-21 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath updated this revision to Diff 92450. rmaprath added a comment. Fixed a few paths. https://reviews.llvm.org/D31178 Files: test/libcxxabi/test/config.py test/lit.site.cfg.in test/test_exception_address_alignment.pass.cpp Index: test/test_exception_address_alignment.pass.cpp

[PATCH] D31178: [libcxxabi] Fix exception address alignment test for EHABI

2017-04-04 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath updated this revision to Diff 94074. rmaprath added a comment. Herald added a subscriber: mgorny. Addressed review comments from @EricWF . https://reviews.llvm.org/D31178 Files: CMakeLists.txt test/libcxxabi/test/config.py test/lit.site.cfg.in

[PATCH] D29818: [libcxx] Threading support: Attempt to externalize system_clock::now() and steady_clock::now() implementations

2017-04-12 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. Hi @EricWF Apologies for the delay in replying to this. In https://reviews.llvm.org/D29818#711795, @EricWF wrote: > I really dislike that `__libcpp_clock_monotonic` and > `__libcpp_clock_realtime` are never declared, and are expected to be > magically defined by the

[PATCH] D29757: [libcxx] Threading support: Externalize hardware_concurrency()

2017-03-14 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. @EricWF: Ping? https://reviews.llvm.org/D29757 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D29818: [libcxx] Threading support: Attempt to externalize system_clock::now() and steady_clock::now() implementations

2017-03-14 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. @EricWF: Ping? https://reviews.llvm.org/D29818 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D23796: [libcxx] Make it possible to test static builds of libc++ on OSX

2017-04-24 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath abandoned this revision. rmaprath added a comment. Looks like I'm the only one interested in this - abandoning. https://reviews.llvm.org/D23796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org