[PATCH] D26949: [libc++abi] Clean up visibility

2017-01-06 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added inline comments. Comment at: src/cxa_new_delete.cpp:34 */ -__attribute__((__weak__, __visibility__("default"))) +__attribute__((__weak__)) void * EricWF wrote: > Can we abstract this away to a `_LIBCXXABI_NEW_DELETE_VIS` macro? Are `operator

[PATCH] D28220: provide Win32 native threading

2017-01-06 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd closed this revision. compnerd added a comment. SVN r291333 Comment at: include/__threading_support:29-30 +#include +#define WIN32_LEAN_AND_MEAN +#include +#include majnemer wrote: > EricWF wrote: > > I think we agreed that we cannot use this

[PATCH] D28212: typeinfo: provide a partial implementation for Win32

2017-01-06 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 83489. compnerd added a comment. Rebase for r291329. Repository: rL LLVM https://reviews.llvm.org/D28212 Files: include/typeinfo src/typeinfo.cpp Index: src/typeinfo.cpp === ---

[PATCH] D28426: [libc++] Tolerate presence of __deallocate macro

2017-01-06 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd accepted this revision. compnerd added a comment. This revision is now accepted and ready to land. This is a really nice cleanup! https://reviews.llvm.org/D28426 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D28220: provide Win32 native threading

2017-01-06 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd removed rL LLVM as the repository for this revision. compnerd updated this revision to Diff 83469. compnerd marked 2 inline comments as done. compnerd added a comment. remove `WIN32_LEAN_AND_MEAN`, fix decoration, remove inline decorations https://reviews.llvm.org/D28220 Files:

[PATCH] D28220: provide Win32 native threading

2017-01-06 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd set the repository for this revision to rL LLVM. compnerd updated this revision to Diff 83453. Repository: rL LLVM https://reviews.llvm.org/D28220 Files: include/__config include/__threading_support include/thread Index: include/thread

[PATCH] D28220: provide Win32 native threading

2017-01-06 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd removed rL LLVM as the repository for this revision. compnerd updated this revision to Diff 83432. compnerd added a comment. rebase https://reviews.llvm.org/D28220 Files: include/__config include/__threading_support include/thread Index: include/thread

[PATCH] D28220: provide Win32 native threading

2017-01-06 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 83430. compnerd marked an inline comment as done. compnerd added a comment. rebase, address negative timeouts, fix thunking for `__libcpp_tls_create` Repository: rL LLVM https://reviews.llvm.org/D28220 Files: include/__config

[PATCH] D28212: typeinfo: provide a partial implementation for Win32

2017-01-05 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd set the repository for this revision to rL LLVM. compnerd updated this revision to Diff 83326. Repository: rL LLVM https://reviews.llvm.org/D28212 Files: include/typeinfo src/typeinfo.cpp Index: src/typeinfo.cpp ===

[PATCH] D28383: build: add a heuristic to determine the C++ ABI

2017-01-05 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd created this revision. compnerd added reviewers: EricWF, mclow.lists, smeenai, kastiglione. compnerd added subscribers: cfe-commits, rnk. compnerd set the repository for this revision to rL LLVM. Herald added a subscriber: mgorny. We need to have a more principled method to detect the

[PATCH] D28220: provide Win32 native threading

2017-01-05 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd marked an inline comment as done. compnerd added inline comments. Comment at: include/__threading_support:474 + system_clock::time_point(duration_cast(duration)); + auto timeout_ms = duration_cast(abstime - system_clock::now()); + halyavin wrote:

[PATCH] D28338: thread_support: split out {,non-}recursive mutex

2017-01-05 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd closed this revision. compnerd added a comment. SVN r291145 Repository: rL LLVM https://reviews.llvm.org/D28338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D28220: provide Win32 native threading

2017-01-04 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 83182. compnerd marked an inline comment as done. compnerd added a comment. Fix `__libcpp_condvar_timedwait` parameter usage (absolute vs relative time) Repository: rL LLVM https://reviews.llvm.org/D28220 Files: include/__config

[PATCH] D28220: provide Win32 native threading

2017-01-04 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd marked an inline comment as done. compnerd added inline comments. Comment at: include/__threading_support:458 + __libcpp_mutex_reference&& __m, + timespec* __ts) +{ halyavin wrote: > In posix,

[PATCH] D28220: provide Win32 native threading

2017-01-04 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 83178. compnerd added a comment. Address a number of review comments. Repository: rL LLVM https://reviews.llvm.org/D28220 Files: include/__config include/__threading_support Index: include/__threading_support

[PATCH] D28220: provide Win32 native threading

2017-01-04 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd marked 6 inline comments as done. compnerd added inline comments. Comment at: include/__threading_support:527 +static inline _LIBCPP_ALWAYS_INLINE unsigned int WINAPI +__libcpp_thread_trampoline(void *__data) +{ rnk wrote: > halyavin wrote: > >

[PATCH] D28220: provide Win32 native threading

2017-01-04 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated the summary for this revision. compnerd updated this revision to Diff 83174. Repository: rL LLVM https://reviews.llvm.org/D28220 Files: include/__config include/__threading_support Index: include/__threading_support

[PATCH] D28226: threading_support: introduce __libcpp_recursive_mutex_t

2017-01-04 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd abandoned this revision. compnerd added a comment. Superceded by https://reviews.llvm.org/D28338 Repository: rL LLVM https://reviews.llvm.org/D28226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D28226: threading_support: introduce __libcpp_recursive_mutex_t

2017-01-04 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment. Im not tied to this approach. I really want to get @mclow.lists or @EricWF to weigh in as to which approach they prefer (new interfaces or the wrapper, or even a new approach). Repository: rL LLVM https://reviews.llvm.org/D28226

[PATCH] D28212: typeinfo: provide a partial implementation for Win32

2017-01-04 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added inline comments. Comment at: include/typeinfo:75 +#elif defined(_WIN32) +#define _LIBCPP_HAS_WINDOWS_TYPEINFO +#else rnk wrote: > Is _WIN32 the right condition? It seems like this is intended to match the MS > ABI RTTI structure, not the Itanium

[PATCH] D28226: threading_support: introduce __libcpp_recursive_mutex_t

2017-01-03 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 82983. compnerd marked 3 inline comments as done. compnerd added a comment. Use l-values, static_cast. Repository: rL LLVM https://reviews.llvm.org/D28226 Files: include/__threading_support include/mutex Index: include/mutex

[PATCH] D28226: threading_support: introduce __libcpp_recursive_mutex_t

2017-01-03 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd marked 3 inline comments as done. compnerd added inline comments. Comment at: include/__threading_support:91 + { +return reinterpret_cast<__libcpp_mutex_t*>(__value); + } EricWF wrote: > Wouldn't a `static_cast` be valid here? Yeah.

[PATCH] D28220: provide Win32 native threading

2017-01-03 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 82954. compnerd added a comment. Remove incorrect use of `VC_EXTRALEAN`. Fix signature for `__libcpp_set_thread_specific`. Provide CC adjustment thunks for the thread creation. Add an assertion for sleep timeout truncation. Implement exec-once

[PATCH] D28223: clean up use of _WIN32

2017-01-03 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd closed this revision. compnerd added a comment. SVN r290910. I like your idea for an additional BITSCAN macro. I think that Id rather do that in a follow up. Repository: rL LLVM https://reviews.llvm.org/D28223 ___ cfe-commits mailing

[PATCH] D28223: clean up use of _WIN32

2017-01-03 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 82944. compnerd added a comment. fix `__LP64__` usage as pointed out by @smeenai Repository: rL LLVM https://reviews.llvm.org/D28223 Files: include/__config include/__locale include/support/win32/support.h include/type_traits src/chrono.cpp

[PATCH] D28223: clean up use of _WIN32

2017-01-03 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment. I think that it will suffice for now. We can change the flag to be more granular in the future. I think that this is going well beyond the original intent of cleaning up the usage of the `_WIN32` macros at this point. Repository: rL LLVM

[PATCH] D28223: clean up use of _WIN32

2017-01-03 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 82927. compnerd added a comment. Switch to `_LIBCPP_SHORT_WCHAR`. Repository: rL LLVM https://reviews.llvm.org/D28223 Files: include/__config include/__locale include/support/win32/support.h include/type_traits src/chrono.cpp

[PATCH] D28212: typeinfo: provide a partial implementation for Win32

2017-01-03 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd commandeered this revision. compnerd edited reviewers, added: EricWF; removed: compnerd. compnerd added a comment. Ill use this version for the commit, but Id like to get an okay on it before I do that :-). https://reviews.llvm.org/D28212

[PATCH] D28226: threading_support: introduce __libcpp_recursive_mutex_t

2017-01-03 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment. The dynamic behavior only is used for Windows, not pthreads. So, we dont see it here, but it becomes apparent in the windows support. I was trying to minimize the changes to libc++ itself to avoid having it to consider the recursive vs non-recursive cases. If the

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

2017-01-03 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment. 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 that? (Sure, there are more buildbots using it, but thats not a

[PATCH] D28223: clean up use of _WIN32

2017-01-03 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 82912. compnerd added a comment. Update for `_LIBCPP_WIN32API` and addition of `_LIBCPP_OBJECT_FORMAT_COFF`, `_LIBCPP_OBJECT_FORMAT_ELF`, `_LIBCPP_OBJECT_FORMAT_MACHO` Repository: rL LLVM https://reviews.llvm.org/D28223 Files: include/__config

[PATCH] D28223: clean up use of _WIN32

2017-01-03 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment. I figured that using the explicit encoding is nicer since it means that its more documenting. I dont have a problem with `_LIBCPP_SHORT_WCHAR` as that maps quite well to `-fshort-wchar`. Repository: rL LLVM https://reviews.llvm.org/D28223

[PATCH] D28223: clean up use of _WIN32

2017-01-03 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added inline comments. Comment at: include/__config:158 +#if defined(_WIN32) +# define _LIBCPP_WIN32 1 # define _LIBCPP_LITTLE_ENDIAN 1 EricWF wrote: > smeenai wrote: > > Perhaps `_LIBCPP_WIN32API` instead, to be clear that this is specific

[PATCH] D28220: provide Win32 native threading

2017-01-02 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added inline comments. Comment at: include/__threading_support:46 +inline _LIBCPP_INLINE_VISIBILITY +int __libcpp_recursive_mutex_init(__libcpp_mutex_t *__m); + EricWF wrote: > The forward declarations of the `__libcpp_` threading wrapper should be >

[PATCH] D28220: provide Win32 native threading

2017-01-02 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 82846. compnerd added a comment. add more context Repository: rL LLVM https://reviews.llvm.org/D28220 Files: include/__config include/__threading_support Index: include/__threading_support

[PATCH] D28226: threading_support: introduce __libcpp_recursive_mutex_t

2017-01-02 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 82845. compnerd added a comment. add more context Repository: rL LLVM https://reviews.llvm.org/D28226 Files: include/__threading_support include/mutex Index: include/mutex === ---

[PATCH] D28226: threading_support: introduce __libcpp_recursive_mutex_t

2017-01-02 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd created this revision. compnerd added reviewers: EricWF, mclow.lists. compnerd added subscribers: majnemer, smeenai, kastiglione, cfe-commits. compnerd set the repository for this revision to rL LLVM. Introduce the new `__libcpp_recursive_mutex_t` which differentiates between a recursive

[PATCH] D28220: provide Win32 native threading

2017-01-02 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 82843. compnerd added a comment. update for separation of mutex and recursive_mutex. Repository: rL LLVM https://reviews.llvm.org/D28220 Files: include/__config include/__threading_support Index: include/__threading_support

[PATCH] D28223: clean up use of _WIN32

2017-01-02 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd created this revision. compnerd added reviewers: EricWF, mclow.lists, smeenai. compnerd added a subscriber: cfe-commits. compnerd set the repository for this revision to rL LLVM. Replace the use of `_WIN32` in libc++. Replace most use with a C runtime check `_LIBCPP_MSVCRT` or the new

[PATCH] D28220: provide Win32 native threading

2017-01-02 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 82834. compnerd added a comment. switch between a CRITICAL_SECTION and SRWLOCK Repository: rL LLVM https://reviews.llvm.org/D28220 Files: include/__config include/__threading_support Index: include/__threading_support

[PATCH] D28220: provide Win32 native threading

2017-01-02 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added inline comments. Comment at: include/__threading_support:300-305 +int __libcpp_recursive_mutex_init(__libcpp_mutex_t *__m) +{ + InitializeSRWLock(__m); + return 0; +} + majnemer wrote: > I don't think you can use slim rw locks for recursive

[PATCH] D28220: provide Win32 native threading

2017-01-02 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 82826. compnerd added a comment. Use SRW locks, rebase for avoid redeclaration of interfaces, remove static initialization check removals. Repository: rL LLVM https://reviews.llvm.org/D28220 Files: include/__config include/__threading_support

[PATCH] D28220: provide Win32 native threading

2017-01-02 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd marked 3 inline comments as done. compnerd added a comment. The SRW initializers avoid the initializer changes, so its one less set of changes that is necessary. Comment at: include/__threading_support:33 #include <__external_threading> +#elif defined(_WIN32) &&

[PATCH] D28220: provide Win32 native threading

2017-01-02 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment. @majnemer Im using the Fls* APIs since they provide the thread termination callback, which Tls* doesn't. Good point about the SRW. Those are newer, but, we can always provide a fallback later. Repository: rL LLVM https://reviews.llvm.org/D28220

[PATCH] D28210: system_error: inline error_category ctor on Win32

2017-01-02 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd abandoned this revision. compnerd added a comment. WFM, that seems like a nicer option. Repository: rL LLVM https://reviews.llvm.org/D28210 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D28211: typeinfo: provide a destructor for type_info

2017-01-02 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd abandoned this revision. compnerd added a comment. Thanks! Repository: rL LLVM https://reviews.llvm.org/D28211 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D28212: typeinfo: provide a partial implementation for Win32

2017-01-01 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd created this revision. compnerd added reviewers: EricWF, mclow.lists, majnemer, rnk. compnerd added subscribers: smeenai, kastiglione, cfe-commits. compnerd set the repository for this revision to rL LLVM. The RTTI structure is different on Windows when building under MS ABI. Update the

[PATCH] D28211: typeinfo: provide a destructor for type_info

2017-01-01 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd created this revision. compnerd added reviewers: EricWF, mclow.lists. compnerd added subscribers: smeenai, cfe-commits. compnerd set the repository for this revision to rL LLVM. When building without libc++abi and libcxxrt, provide the definition for the std::type_info destructor.

[PATCH] D28210: system_error: inline error_category ctor on Win32

2017-01-01 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd created this revision. compnerd added reviewers: EricWF, mclow.lists, majnemer. compnerd added subscribers: smeenai, cfe-commits. compnerd set the repository for this revision to rL LLVM. Because the class is marked as `dllexport` and instantiated in `algorithm.cpp` and is strongly

[PATCH] D26796: [Driver] Use arch type to find compiler-rt libraries (on Linux)

2016-12-29 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment. This would need an upgrade path, since the output name can actually be different from the `AchTypeName` (e.g. i386 vs i686). https://reviews.llvm.org/D26796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D27360: [clang] Fix D26214: Move error handling out of MC and to the callers.

2016-12-05 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd accepted this revision. compnerd added a comment. This revision is now accepted and ready to land. Im not the biggest fan of this. However, having some validation is probably better than not. We can come up with a better way to address this in the future when needed I suppose.

[PATCH] D25686: [Driver] Improve support for Gentoo arm*-hardfloat-*-*eabi triples

2016-12-05 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment. Please don't canonicalize the triple that way. The behavior of `armv7-unknown-linux-gnueabi` is different from `armv7-unknown-linux-gnueabihf` which is different from `armv7-unknown-linux-gnueabihf -mfloat-abi=hard`. I agree that this is absolutely terrible and

[PATCH] D25417: [libcxxabi] Fix alignment of allocated exceptions in 32 bit builds

2016-12-05 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd accepted this revision. compnerd added a comment. This revision is now accepted and ready to land. I thought we had gotten this merged already. Oops. LGTM with the minor tweak for windows. Comment at: src/fallback_malloc.cpp:206 +return fallback_malloc(size);

[PATCH] D26949: [libc++abi] Clean up visibility

2016-12-05 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment. I really like the clean up this does. It removes the unnecessary usage of the GCC pragmas and cleans up the definitions by using the headers more properly. Comment at: src/abort_message.h:19 -__attribute__((visibility("hidden"), noreturn))

[PATCH] D27384: [libclang] Restore clang_getNumTemplateArguments/clang_getTemplateArgumentAsType functionality

2016-12-03 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added inline comments. Comment at: tools/libclang/CXType.cpp:151-153 + if (A.getKind() != TemplateArgument::Type) +return MakeCXType(QualType(), TU); + return MakeCXType(A.getAsType(), TU); Isn't this more compact as: return

[PATCH] D27360: [clang] Fix D26214: Move error handling out of MC and to the callers.

2016-12-02 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment. I think that the argument parsing should really be hoisted into the driver rather than pushed down into the assembler. The driver can parse and validate the options before passing them down, so when cc1as gets it, it will simply set the value. The newly introduced

<    2   3   4   5   6   7