[libcxx] r280585 - memory_resource still needs init_priority when built with GCC 4.9
Author: ericwf Date: Sat Sep 3 02:05:40 2016 New Revision: 280585 URL: http://llvm.org/viewvc/llvm-project?rev=280585&view=rev Log: memory_resource still needs init_priority when built with GCC 4.9 Modified: libcxx/trunk/src/experimental/memory_resource.cpp Modified: libcxx/trunk/src/experimental/memory_resource.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/experimental/memory_resource.cpp?rev=280585&r1=280584&r2=280585&view=diff == --- libcxx/trunk/src/experimental/memory_resource.cpp (original) +++ libcxx/trunk/src/experimental/memory_resource.cpp Sat Sep 3 02:05:40 2016 @@ -72,10 +72,8 @@ union ResourceInitHelper { // Only in C++11 is "init_priority" needed to ensure initialization order. #if _LIBCPP_STD_VER > 11 _LIBCPP_SAFE_STATIC -#else - __attribute__((init_priority (101))) #endif -ResourceInitHelper res_init; +ResourceInitHelper res_init __attribute__((init_priority (101))); } // end namespace ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D23926: [libcxx] Don't use C99 math ops in -std=c++03 mode
@Eric: Ping? On 1 Sep 2016 11:33, "Asiri Rathnayake via cfe-commits" < cfe-commits@lists.llvm.org> wrote: > rmaprath updated this revision to Diff 69962. > rmaprath added a comment. > > Simplified the patch a little bit more. > > Now, library vendors should be able to define > `_LIBCPP_STRICT_C99_COMPATIBILITY` > and `libc++` will not use/test C99 math functions in `C++03/98` modes. > Currently it's only the math functions, we can extend this approach to > other affected areas if the approach is OK. Not 100% sure about the > namings, can change them as needed. > > @EricWF: Gentle ping. > > > https://reviews.llvm.org/D23926 > > Files: > include/__config > include/math.h > test/std/depr/depr.c.headers/math_h.pass.cpp > test/std/numerics/c.math/cmath.pass.cpp > test/std/numerics/complex.number/cmplx.over/proj.pass.cpp > > > ___ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits > > ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r280587 - Replace the Radeon GCN GPU family names by more descriptive ones
Author: olesalscheider Date: Sat Sep 3 02:13:54 2016 New Revision: 280587 URL: http://llvm.org/viewvc/llvm-project?rev=280587&view=rev Log: Replace the Radeon GCN GPU family names by more descriptive ones Differential Revision: https://reviews.llvm.org/D23957 Modified: cfe/trunk/lib/Basic/Targets.cpp Modified: cfe/trunk/lib/Basic/Targets.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=280587&r1=280586&r2=280587&view=diff == --- cfe/trunk/lib/Basic/Targets.cpp (original) +++ cfe/trunk/lib/Basic/Targets.cpp Sat Sep 3 02:13:54 2016 @@ -1953,9 +1953,9 @@ class AMDGPUTargetInfo final : public Ta GK_EVERGREEN_DOUBLE_OPS, GK_NORTHERN_ISLANDS, GK_CAYMAN, -GK_SOUTHERN_ISLANDS, -GK_SEA_ISLANDS, -GK_VOLCANIC_ISLANDS +GK_GFX6, +GK_GFX7, +GK_GFX8 } GPU; bool hasFP64:1; @@ -1970,7 +1970,7 @@ class AMDGPUTargetInfo final : public Ta public: AMDGPUTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) : TargetInfo(Triple) , - GPU(isAMDGCN(Triple) ? GK_SOUTHERN_ISLANDS : GK_R600), + GPU(isAMDGCN(Triple) ? GK_GFX6 : GK_R600), hasFP64(false), hasFMAF(false), hasLDEXPF(false), @@ -2110,23 +2110,23 @@ public: static GPUKind parseAMDGCNName(StringRef Name) { return llvm::StringSwitch(Name) - .Case("tahiti",GK_SOUTHERN_ISLANDS) - .Case("pitcairn", GK_SOUTHERN_ISLANDS) - .Case("verde", GK_SOUTHERN_ISLANDS) - .Case("oland", GK_SOUTHERN_ISLANDS) - .Case("hainan",GK_SOUTHERN_ISLANDS) - .Case("bonaire", GK_SEA_ISLANDS) - .Case("kabini",GK_SEA_ISLANDS) - .Case("kaveri",GK_SEA_ISLANDS) - .Case("hawaii",GK_SEA_ISLANDS) - .Case("mullins", GK_SEA_ISLANDS) - .Case("tonga", GK_VOLCANIC_ISLANDS) - .Case("iceland", GK_VOLCANIC_ISLANDS) - .Case("carrizo", GK_VOLCANIC_ISLANDS) - .Case("fiji", GK_VOLCANIC_ISLANDS) - .Case("stoney",GK_VOLCANIC_ISLANDS) - .Case("polaris10", GK_VOLCANIC_ISLANDS) - .Case("polaris11", GK_VOLCANIC_ISLANDS) + .Case("tahiti",GK_GFX6) + .Case("pitcairn", GK_GFX6) + .Case("verde", GK_GFX6) + .Case("oland", GK_GFX6) + .Case("hainan",GK_GFX6) + .Case("bonaire", GK_GFX7) + .Case("kabini",GK_GFX7) + .Case("kaveri",GK_GFX7) + .Case("hawaii",GK_GFX7) + .Case("mullins", GK_GFX7) + .Case("tonga", GK_GFX8) + .Case("iceland", GK_GFX8) + .Case("carrizo", GK_GFX8) + .Case("fiji", GK_GFX8) + .Case("stoney",GK_GFX8) + .Case("polaris10", GK_GFX8) + .Case("polaris11", GK_GFX8) .Default(GK_NONE); } @@ -2153,7 +2153,7 @@ public: Opts.cl_khr_local_int32_base_atomics = 1; Opts.cl_khr_local_int32_extended_atomics = 1; } -if (GPU >= GK_SOUTHERN_ISLANDS) { +if (GPU >= GK_GFX6) { Opts.cl_khr_fp16 = 1; Opts.cl_khr_int64_base_atomics = 1; Opts.cl_khr_int64_extended_atomics = 1; @@ -2255,11 +2255,11 @@ bool AMDGPUTargetInfo::initFeatureMap( CPU = "tahiti"; switch (parseAMDGCNName(CPU)) { -case GK_SOUTHERN_ISLANDS: -case GK_SEA_ISLANDS: +case GK_GFX6: +case GK_GFX7: break; -case GK_VOLCANIC_ISLANDS: +case GK_GFX8: Features["s-memrealtime"] = true; Features["16-bit-insts"] = true; break; ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D23957: Replace the Radeon GCN GPU family names by more descriptive ones
This revision was automatically updated to reflect the committed changes. Closed by commit rL280587: Replace the Radeon GCN GPU family names by more descriptive ones (authored by olesalscheider). Changed prior to commit: https://reviews.llvm.org/D23957?vs=69486&id=70264#toc Repository: rL LLVM https://reviews.llvm.org/D23957 Files: cfe/trunk/lib/Basic/Targets.cpp Index: cfe/trunk/lib/Basic/Targets.cpp === --- cfe/trunk/lib/Basic/Targets.cpp +++ cfe/trunk/lib/Basic/Targets.cpp @@ -1953,9 +1953,9 @@ GK_EVERGREEN_DOUBLE_OPS, GK_NORTHERN_ISLANDS, GK_CAYMAN, -GK_SOUTHERN_ISLANDS, -GK_SEA_ISLANDS, -GK_VOLCANIC_ISLANDS +GK_GFX6, +GK_GFX7, +GK_GFX8 } GPU; bool hasFP64:1; @@ -1970,7 +1970,7 @@ public: AMDGPUTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) : TargetInfo(Triple) , - GPU(isAMDGCN(Triple) ? GK_SOUTHERN_ISLANDS : GK_R600), + GPU(isAMDGCN(Triple) ? GK_GFX6 : GK_R600), hasFP64(false), hasFMAF(false), hasLDEXPF(false), @@ -2110,23 +2110,23 @@ static GPUKind parseAMDGCNName(StringRef Name) { return llvm::StringSwitch(Name) - .Case("tahiti",GK_SOUTHERN_ISLANDS) - .Case("pitcairn", GK_SOUTHERN_ISLANDS) - .Case("verde", GK_SOUTHERN_ISLANDS) - .Case("oland", GK_SOUTHERN_ISLANDS) - .Case("hainan",GK_SOUTHERN_ISLANDS) - .Case("bonaire", GK_SEA_ISLANDS) - .Case("kabini",GK_SEA_ISLANDS) - .Case("kaveri",GK_SEA_ISLANDS) - .Case("hawaii",GK_SEA_ISLANDS) - .Case("mullins", GK_SEA_ISLANDS) - .Case("tonga", GK_VOLCANIC_ISLANDS) - .Case("iceland", GK_VOLCANIC_ISLANDS) - .Case("carrizo", GK_VOLCANIC_ISLANDS) - .Case("fiji", GK_VOLCANIC_ISLANDS) - .Case("stoney",GK_VOLCANIC_ISLANDS) - .Case("polaris10", GK_VOLCANIC_ISLANDS) - .Case("polaris11", GK_VOLCANIC_ISLANDS) + .Case("tahiti",GK_GFX6) + .Case("pitcairn", GK_GFX6) + .Case("verde", GK_GFX6) + .Case("oland", GK_GFX6) + .Case("hainan",GK_GFX6) + .Case("bonaire", GK_GFX7) + .Case("kabini",GK_GFX7) + .Case("kaveri",GK_GFX7) + .Case("hawaii",GK_GFX7) + .Case("mullins", GK_GFX7) + .Case("tonga", GK_GFX8) + .Case("iceland", GK_GFX8) + .Case("carrizo", GK_GFX8) + .Case("fiji", GK_GFX8) + .Case("stoney",GK_GFX8) + .Case("polaris10", GK_GFX8) + .Case("polaris11", GK_GFX8) .Default(GK_NONE); } @@ -2153,7 +2153,7 @@ Opts.cl_khr_local_int32_base_atomics = 1; Opts.cl_khr_local_int32_extended_atomics = 1; } -if (GPU >= GK_SOUTHERN_ISLANDS) { +if (GPU >= GK_GFX6) { Opts.cl_khr_fp16 = 1; Opts.cl_khr_int64_base_atomics = 1; Opts.cl_khr_int64_extended_atomics = 1; @@ -2255,11 +2255,11 @@ CPU = "tahiti"; switch (parseAMDGCNName(CPU)) { -case GK_SOUTHERN_ISLANDS: -case GK_SEA_ISLANDS: +case GK_GFX6: +case GK_GFX7: break; -case GK_VOLCANIC_ISLANDS: +case GK_GFX8: Features["s-memrealtime"] = true; Features["16-bit-insts"] = true; break; Index: cfe/trunk/lib/Basic/Targets.cpp === --- cfe/trunk/lib/Basic/Targets.cpp +++ cfe/trunk/lib/Basic/Targets.cpp @@ -1953,9 +1953,9 @@ GK_EVERGREEN_DOUBLE_OPS, GK_NORTHERN_ISLANDS, GK_CAYMAN, -GK_SOUTHERN_ISLANDS, -GK_SEA_ISLANDS, -GK_VOLCANIC_ISLANDS +GK_GFX6, +GK_GFX7, +GK_GFX8 } GPU; bool hasFP64:1; @@ -1970,7 +1970,7 @@ public: AMDGPUTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) : TargetInfo(Triple) , - GPU(isAMDGCN(Triple) ? GK_SOUTHERN_ISLANDS : GK_R600), + GPU(isAMDGCN(Triple) ? GK_GFX6 : GK_R600), hasFP64(false), hasFMAF(false), hasLDEXPF(false), @@ -2110,23 +2110,23 @@ static GPUKind parseAMDGCNName(StringRef Name) { return llvm::StringSwitch(Name) - .Case("tahiti",GK_SOUTHERN_ISLANDS) - .Case("pitcairn", GK_SOUTHERN_ISLANDS) - .Case("verde", GK_SOUTHERN_ISLANDS) - .Case("oland", GK_SOUTHERN_ISLANDS) - .Case("hainan",GK_SOUTHERN_ISLANDS) - .Case("bonaire", GK_SEA_ISLANDS) - .Case("kabini",GK_SEA_ISLANDS) - .Case("kaveri",GK_SEA_ISLANDS) - .Case("hawaii",GK_SEA_ISLANDS) - .Case("mullins", GK_SEA_ISLANDS) - .Case("tonga", GK_VOLCANIC_ISLANDS) - .Case("iceland", GK_VOLCANIC_ISLANDS) - .Case("carrizo", GK_VOLCANIC_ISLANDS) - .Case("fiji", GK_VOLCANIC_ISLANDS) - .Case("stoney",GK_VOLCANIC_ISLANDS) - .Case("polaris10", GK_VOLCANIC_ISLANDS) - .Case("polaris11", GK_VOLCANIC_ISLANDS) + .Case("tahiti",GK_GFX6) + .Case("pitcairn", GK_GFX6) + .Case("ver
[libcxx] r280588 - Fix PR30202 - notify_all_at_thread_exit seg faults if run from a raw pthread context.
Author: ericwf Date: Sat Sep 3 03:07:40 2016 New Revision: 280588 URL: http://llvm.org/viewvc/llvm-project?rev=280588&view=rev Log: Fix PR30202 - notify_all_at_thread_exit seg faults if run from a raw pthread context. Summary: This patch allows threads not created using `std::thread` to use `std::notify_all_at_thread_exit` by ensuring the TL state has been initialized within `std::notify_all_at_thread_exit`. Additionally this patch "fixes" a potential oddity in `__thread_local_pointer::reset(pointer)`, which would previously delete the old thread local data. However there should *never* be old thread local data because pthread *should* null it out on thread exit. Unfortunately it's possible that pthread failed to do this according to the spec: > > Upon key creation, the value NULL shall be associated with the new key in all > active threads. Upon thread creation, the value NULL shall be associated with > all defined keys in the new thread. > > An optional destructor function may be associated with each key value. At > thread exit, if a key value has a non-NULL destructor pointer, and the thread > has a non-NULL value associated with that key, the value of the key is set to > NULL, and then the function pointed to is called with the previously > associated value as its sole argument. The order of destructor calls is > unspecified if more than one destructor exists for a thread when it exits. > > If, after all the destructors have been called for all non-NULL values with > associated destructors, there are still some non-NULL values with associated > destructors, then the process is repeated. If, after at least > {PTHREAD_DESTRUCTOR_ITERATIONS} iterations of destructor calls for > outstanding non-NULL values, there are still some non-NULL values with > associated destructors, implementations may stop calling destructors, or they > may continue calling destructors until no non-NULL values with associated > destructors exist, even though this might result in an infinite loop. However if pthread fails to delete the value it is probably incorrect for us to do it. Destroying the value performs all of the "at thread exit" actions registered with it but we are way past "at thread exit". Reviewers: mclow.lists, bcraig, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24159 Added: libcxx/trunk/test/std/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp Modified: libcxx/trunk/include/thread libcxx/trunk/src/condition_variable.cpp Modified: libcxx/trunk/include/thread URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/thread?rev=280588&r1=280587&r2=280588&view=diff == --- libcxx/trunk/include/thread (original) +++ libcxx/trunk/include/thread Sat Sep 3 03:07:40 2016 @@ -99,6 +99,7 @@ void sleep_for(const chrono::duration #endif #include <__threading_support> +#include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -159,8 +160,7 @@ public: pointer operator*() const {return *get();} _LIBCPP_INLINE_VISIBILITY pointer operator->() const {return get();} -pointer release(); -void reset(pointer __p = nullptr); +void set_pointer(pointer __p); }; template @@ -191,21 +191,12 @@ __thread_specific_ptr<_Tp>::~__thread_sp } template -typename __thread_specific_ptr<_Tp>::pointer -__thread_specific_ptr<_Tp>::release() -{ -pointer __p = get(); -__libcpp_tl_set(__key_, nullptr); -return __p; -} - -template void -__thread_specific_ptr<_Tp>::reset(pointer __p) +__thread_specific_ptr<_Tp>::set_pointer(pointer __p) { -pointer __p_old = get(); +_LIBCPP_ASSERT(get() == nullptr, + "Attempting to overwrite thread local data"); __libcpp_tl_set(__key_, __p); -delete __p_old; } class _LIBCPP_TYPE_VIS thread; @@ -351,7 +342,7 @@ void* __thread_proxy(void* __vp) { // _Fp = std::tuple< unique_ptr<__thread_struct>, Functor, Args...> std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp)); -__thread_local_data().reset(_VSTD::get<0>(*__p).release()); +__thread_local_data().set_pointer(_VSTD::get<0>(*__p).release()); typedef typename __make_tuple_indices::value, 2>::type _Index; __thread_execute(*__p, _Index()); return nullptr; @@ -392,7 +383,7 @@ template void* __thread_proxy_cxx03(void* __vp) { std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp)); -__thread_local_data().reset(__p->__tsp_.release()); +__thread_local_data().set_pointer(__p->__tsp_.release()); (__p->__fn_)(); return nullptr; } Modified: libcxx/trunk/src/condition_variable.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/condition_variable.cpp?rev=280588&r1=280587&r2=280588&view=diff == --- libcxx/trunk/src/conditio
Re: [PATCH] D22910: Add support for CXXOperatorCallExpr in Expr::HasSideEffects
Abpostelnicu added inline comments. Comment at: lib/AST/Expr.cpp:2869 @@ +2868,3 @@ +OverloadedOperatorKind Op = cast(this)->getOperator(); +if (CXXOperatorCallExpr::isAssignmentOp(Op)) { + const Decl *FD = cast(this)->getCalleeDecl(); aaron.ballman wrote: > Should this also handle overloaded ++ and -- if they're the prefix forms? > What about overloaded operator new and delete (and the array forms)? I think for now i should prefer only to have the implementation for assignment operator when it's overloaded. https://reviews.llvm.org/D22910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r280591 - Fix the attribute documentation build.
Author: aaronballman Date: Sat Sep 3 10:36:52 2016 New Revision: 280591 URL: http://llvm.org/viewvc/llvm-project?rev=280591&view=rev Log: Fix the attribute documentation build. Modified: cfe/trunk/include/clang/Basic/AttrDocs.td Modified: cfe/trunk/include/clang/Basic/AttrDocs.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=280591&r1=280590&r2=280591&view=diff == --- cfe/trunk/include/clang/Basic/AttrDocs.td (original) +++ cfe/trunk/include/clang/Basic/AttrDocs.td Sat Sep 3 10:36:52 2016 @@ -859,6 +859,7 @@ between dialects and have subtle pitfall of silently falling back on dynamic initialization. .. code-block:: c++ + // -std=c++14 #define SAFE_STATIC __attribute__((require_constant_initialization)) static struct T { ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r280596 - [AVX-512] Remove masked integer add/sub builtins and replace with native IR.
Author: ctopper Date: Sat Sep 3 13:29:35 2016 New Revision: 280596 URL: http://llvm.org/viewvc/llvm-project?rev=280596&view=rev Log: [AVX-512] Remove masked integer add/sub builtins and replace with native IR. Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def cfe/trunk/lib/Headers/avx512bwintrin.h cfe/trunk/lib/Headers/avx512fintrin.h cfe/trunk/lib/Headers/avx512vlbwintrin.h cfe/trunk/lib/Headers/avx512vlintrin.h cfe/trunk/test/CodeGen/avx512bw-builtins.c cfe/trunk/test/CodeGen/avx512f-builtins.c cfe/trunk/test/CodeGen/avx512vl-builtins.c cfe/trunk/test/CodeGen/avx512vlbw-builtins.c Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=280596&r1=280595&r2=280596&view=diff == --- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original) +++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Sat Sep 3 13:29:35 2016 @@ -1093,14 +1093,6 @@ TARGET_BUILTIN(__builtin_ia32_ucmpd512_m TARGET_BUILTIN(__builtin_ia32_ucmpq512_mask, "UcV8LLiV8LLiIiUc", "", "avx512f") TARGET_BUILTIN(__builtin_ia32_ucmpw512_mask, "UiV32sV32sIiUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_paddq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_psubd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_psubq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_paddd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_paddq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_psubd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_psubq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmuldq256_mask, "V4LLiV8iV8iV4LLiUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmuldq128_mask, "V2LLiV4iV4iV2LLiUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmuludq256_mask, "V4LLiV8iV8iV4LLiUc", "", "avx512vl") @@ -1108,27 +1100,10 @@ TARGET_BUILTIN(__builtin_ia32_pmuludq128 TARGET_BUILTIN(__builtin_ia32_pmulld256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmulld128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_paddb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") TARGET_BUILTIN(__builtin_ia32_pmullw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddb256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubb256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddb128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubb128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") TARGET_BUILTIN(__builtin_ia32_pmullw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") TARGET_BUILTIN(__builtin_ia32_pmullw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psubq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_paddd512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psubd512_mask, "V16iV16iV16iV16iUs", "", "avx512f") - TARGET_BUILTIN(__builtin_ia32_pmulld512_mask, "V16iV16iV16iV16iUs", "", "avx512f") TARGET_BUILTIN(__builtin_ia32_pmullq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512dq") TARGET_BUILTIN(__builtin_ia32_pmullq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl,avx512dq") Modified: cfe/trunk/lib/Headers/avx512bwintrin.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512bwintrin.h?rev=280596&r1=280595&r2=280596&view=diff == --- cfe/trunk/lib/Headers/avx512bwintrin.h (original) +++ cfe/trunk/lib/Headers/avx512bwintrin.h Sat Sep 3 13:29:35 2016 @@ -350,19 +350,17 @@ _mm512_add_epi8 (__m512i __A, __m512i __ } static __inline__ __m512i __DEFAULT_FN_ATTRS -_mm512_mask_add_epi8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) { - return (__m512i) __bu
r280597 - [AVX-512] Remove masked integer mullo builtins and replace with native IR.
Author: ctopper Date: Sat Sep 3 14:19:49 2016 New Revision: 280597 URL: http://llvm.org/viewvc/llvm-project?rev=280597&view=rev Log: [AVX-512] Remove masked integer mullo builtins and replace with native IR. Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def cfe/trunk/lib/Headers/avx512bwintrin.h cfe/trunk/lib/Headers/avx512dqintrin.h cfe/trunk/lib/Headers/avx512fintrin.h cfe/trunk/lib/Headers/avx512vlbwintrin.h cfe/trunk/lib/Headers/avx512vldqintrin.h cfe/trunk/lib/Headers/avx512vlintrin.h cfe/trunk/test/CodeGen/avx512bw-builtins.c cfe/trunk/test/CodeGen/avx512dq-builtins.c cfe/trunk/test/CodeGen/avx512f-builtins.c cfe/trunk/test/CodeGen/avx512vl-builtins.c cfe/trunk/test/CodeGen/avx512vlbw-builtins.c cfe/trunk/test/CodeGen/avx512vldq-builtins.c Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=280597&r1=280596&r2=280597&view=diff == --- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original) +++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Sat Sep 3 14:19:49 2016 @@ -1097,17 +1097,6 @@ TARGET_BUILTIN(__builtin_ia32_pmuldq256_ TARGET_BUILTIN(__builtin_ia32_pmuldq128_mask, "V2LLiV4iV4iV2LLiUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmuludq256_mask, "V4LLiV8iV8iV4LLiUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmuludq128_mask, "V2LLiV4iV4iV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmulld256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmulld128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_pmullw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmullw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmullw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") - -TARGET_BUILTIN(__builtin_ia32_pmulld512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmullq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_pmullq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_pmullq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl,avx512dq") TARGET_BUILTIN(__builtin_ia32_pabsb512_mask, "V64cV64cV64cULLi", "", "avx512bw") TARGET_BUILTIN(__builtin_ia32_pabsw512_mask, "V32sV32sV32sUi", "", "avx512bw") Modified: cfe/trunk/lib/Headers/avx512bwintrin.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512bwintrin.h?rev=280597&r1=280596&r2=280597&view=diff == --- cfe/trunk/lib/Headers/avx512bwintrin.h (original) +++ cfe/trunk/lib/Headers/avx512bwintrin.h Sat Sep 3 14:19:49 2016 @@ -426,19 +426,17 @@ _mm512_mullo_epi16 (__m512i __A, __m512i } static __inline__ __m512i __DEFAULT_FN_ATTRS -_mm512_mask_mullo_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { - return (__m512i) __builtin_ia32_pmullw512_mask ((__v32hi) __A, - (__v32hi) __B, - (__v32hi) __W, - (__mmask32) __U); +_mm512_mask_mullo_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { + return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, + (__v32hi)_mm512_mullo_epi16(__A, __B), + (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS -_mm512_maskz_mullo_epi16 (__mmask32 __U, __m512i __A, __m512i __B) { - return (__m512i) __builtin_ia32_pmullw512_mask ((__v32hi) __A, - (__v32hi) __B, - (__v32hi) _mm512_setzero_hi(), - (__mmask32) __U); +_mm512_maskz_mullo_epi16(__mmask32 __U, __m512i __A, __m512i __B) { + return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, + (__v32hi)_mm512_mullo_epi16(__A, __B), + (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS Modified: cfe/trunk/lib/Headers/avx512dqintrin.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512dqintrin.h?rev=280597&r1=280596&r2=280597&view=diff == --- cfe/trunk/lib/Headers/avx512dqintrin.h (original) +++ cfe/trunk/lib/Headers/avx512dqintrin.h Sat Sep 3 14:19:49 2016 @@ -37,20 +37,17 @@ _mm512_mullo_epi64 (__m512i __A, __m512i } static __inline__ __m512i __DEFAULT_FN_ATTRS -_mm512_mask_mullo_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) { - return (__m512i) __builtin_ia32_pmullq512_mask ((__v8di) __A, - (__v8di) __B, - (__v8di) __W, - (__mmask8) __U); +_mm512_mask_mullo_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) { + return (__m512i)_
Re: [PATCH] D23926: [libcxx] Don't use C99 math ops in -std=c++03 mode
mclow.lists added a comment. > We have quite a strict C library which is picky about what it exposes under > different standards. For example, it won't expose C99 math ops if it is being > used under `__cplusplus < 201103L` ... That sounds .. odd to me, having the behavior of the C library depend on the value of `__cplusplus` https://reviews.llvm.org/D23926 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] r280605 - Mark test as XFAIL for C++03, rather than providing a dummy pass.
Author: marshall Date: Sat Sep 3 19:37:06 2016 New Revision: 280605 URL: http://llvm.org/viewvc/llvm-project?rev=280605&view=rev Log: Mark test as XFAIL for C++03, rather than providing a dummy pass. Modified: libcxx/trunk/test/std/iterators/iterator.range/begin-end.pass.cpp Modified: libcxx/trunk/test/std/iterators/iterator.range/begin-end.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/iterators/iterator.range/begin-end.pass.cpp?rev=280605&r1=280604&r2=280605&view=diff == --- libcxx/trunk/test/std/iterators/iterator.range/begin-end.pass.cpp (original) +++ libcxx/trunk/test/std/iterators/iterator.range/begin-end.pass.cpp Sat Sep 3 19:37:06 2016 @@ -7,6 +7,8 @@ // //===--===// +// XFAIL: c++03 + // // template auto begin(C& c) -> decltype(c.begin()); // template auto begin(const C& c) -> decltype(c.begin()); @@ -17,7 +19,6 @@ #include "test_macros.h" -#if TEST_STD_VER >= 11 #include #include #include @@ -142,7 +143,3 @@ int main(){ static_assert(e - b == 3, ""); #endif } - -#else -int main(){} -#endif ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D24218: [libc++] Fix support for multibyte thousands_sep and decimal_point in moneypunct_byname
EricWF created this revision. EricWF added a reviewer: mclow.lists. EricWF added a subscriber: cfe-commits. The underlying C locales provide the `thousands_sep` and `decimal_point` as strings, possible with more than one character. We currently don't handle this case even for `wchar_t`. This patch properly converts the mbs -> wide character for `moneypunct_byname`. It doesn't handle the case for `moneypunct_byname` because it's not clear what to do. Note that the changes to `curr_symbol.pass.cpp` are just drive by fixes. https://reviews.llvm.org/D24218 Files: src/locale.cpp test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp test/support/test_macros.h Index: test/support/test_macros.h === --- test/support/test_macros.h +++ test/support/test_macros.h @@ -62,6 +62,13 @@ #endif #endif +// Attempt to deduce GCC version +#if defined(_LIBCPP_VERSION) && __has_include() +#include +#define TEST_HAS_GLIBC +#define TEST_GLIBC_PREREQ(major, minor) __GLIBC_PREREQ(major, minor) +#endif + /* Features that were introduced in C++14 */ #if TEST_STD_VER >= 14 #define TEST_HAS_EXTENDED_CONSTEXPR Index: test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp === --- test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp +++ test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp @@ -18,16 +18,11 @@ // charT thousands_sep() const; -// Failure related to GLIBC's use of U00A0 as mon_thousands_sep -// and U002E as mon_decimal_point. -// TODO: U00A0 should be investigated. -// Possibly related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006 -// XFAIL: linux-gnu - #include #include #include +#include "test_macros.h" #include "platform_support.h" // locale name macros class Fnf @@ -114,22 +109,30 @@ Fwt f(LOCALE_fr_FR_UTF_8, 1); assert(f.thousands_sep() == L' '); } - +// The belowe tests fail due to GLIBC's use of U00A0 as mon_thousands_sep +// and U002E as mon_decimal_point. +// TODO: Fix thousands_sep for 'char'. +// related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006 +#ifndef TEST_HAS_GLIBC { Fnf f(LOCALE_ru_RU_UTF_8, 1); assert(f.thousands_sep() == ' '); } { Fnt f(LOCALE_ru_RU_UTF_8, 1); assert(f.thousands_sep() == ' '); } +const wchar_t sep = L' '; +#else +const wchar_t sep = L'\u00A0'; +#endif { Fwf f(LOCALE_ru_RU_UTF_8, 1); -assert(f.thousands_sep() == L' '); +assert(f.thousands_sep() == sep); } { Fwt f(LOCALE_ru_RU_UTF_8, 1); -assert(f.thousands_sep() == L' '); +assert(f.thousands_sep() == sep); } { Index: test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp === --- test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp +++ test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp @@ -12,9 +12,6 @@ // REQUIRES: locale.ru_RU.UTF-8 // REQUIRES: locale.zh_CN.UTF-8 -// Russia uses ',' for the decimal separator. GLIBC returns '.' -// XFAIL: linux - // // class moneypunct_byname @@ -25,6 +22,7 @@ #include #include +#include "test_macros.h" #include "platform_support.h" // locale name macros class Fnf @@ -112,21 +110,30 @@ assert(f.decimal_point() == L','); } +// The belowe tests fail due to GLIBC's use of U00A0 as mon_decimal_point +// and U002E as mon_decimal_point. +// TODO: Fix decimal_point for 'char'. +// related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006 +#ifndef TEST_HAS_GLIBC { Fnf f(LOCALE_ru_RU_UTF_8, 1); -assert(f.decimal_point() == ','); +assert(f.decimal_point() == '.'); } { Fnt f(LOCALE_ru_RU_UTF_8, 1); -assert(f.decimal_point() == ','); +assert(f.decimal_point() == '.'); } +const wchar_t sep = L'.'; +#else +const wchar_t sep = L'\u002E'; +#endif { Fwf f(LOCALE_ru_RU_UTF_8, 1); -assert(f.decimal_point() == L','); +assert(f.decimal_point() == sep); } { Fwt f(LOCALE_ru_RU_UTF_8, 1); -assert(f.decimal_point() == L','); +assert(f.decimal_point() == sep); } { Index: test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_sym
r280607 - PR 27200: Fix names of the atomic lock-free macros.
Author: joerg Date: Sat Sep 3 19:44:10 2016 New Revision: 280607 URL: http://llvm.org/viewvc/llvm-project?rev=280607&view=rev Log: PR 27200: Fix names of the atomic lock-free macros. Modified: cfe/trunk/lib/Headers/stdatomic.h Modified: cfe/trunk/lib/Headers/stdatomic.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/stdatomic.h?rev=280607&r1=280606&r2=280607&view=diff == --- cfe/trunk/lib/Headers/stdatomic.h (original) +++ cfe/trunk/lib/Headers/stdatomic.h Sat Sep 3 19:44:10 2016 @@ -45,18 +45,18 @@ extern "C" { #define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE #define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE #define ATOMIC_WCHAR_T_LOCK_FREE__GCC_ATOMIC_WCHAR_T_LOCK_FREE -#define ATOMIC_SHORT_T_LOCK_FREE__GCC_ATOMIC_SHORT_T_LOCK_FREE -#define ATOMIC_INT_T_LOCK_FREE __GCC_ATOMIC_INT_T_LOCK_FREE -#define ATOMIC_LONG_T_LOCK_FREE __GCC_ATOMIC_LONG_T_LOCK_FREE -#define ATOMIC_LLONG_T_LOCK_FREE__GCC_ATOMIC_LLONG_T_LOCK_FREE -#define ATOMIC_POINTER_T_LOCK_FREE __GCC_ATOMIC_POINTER_T_LOCK_FREE +#define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE +#define ATOMIC_INT_LOCK_FREE__GCC_ATOMIC_INT_LOCK_FREE +#define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE +#define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE +#define ATOMIC_POINTER_LOCK_FREE__GCC_ATOMIC_POINTER_LOCK_FREE /* 7.17.2 Initialization */ #define ATOMIC_VAR_INIT(value) (value) #define atomic_init __c11_atomic_init -/* 7.17.3 Order and consistency */ +/* 7.17.3 Order and consistency */. typedef enum memory_order { memory_order_relaxed = __ATOMIC_RELAXED, ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: r280607 - PR 27200: Fix names of the atomic lock-free macros.
Hi Tom, can I merge this into 3.8 and 3.9? Joerg On Sun, Sep 04, 2016 at 12:44:10AM -, Joerg Sonnenberger via cfe-commits wrote: > Author: joerg > Date: Sat Sep 3 19:44:10 2016 > New Revision: 280607 > > URL: http://llvm.org/viewvc/llvm-project?rev=280607&view=rev > Log: > PR 27200: Fix names of the atomic lock-free macros. > > Modified: > cfe/trunk/lib/Headers/stdatomic.h > > Modified: cfe/trunk/lib/Headers/stdatomic.h > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/stdatomic.h?rev=280607&r1=280606&r2=280607&view=diff > == > --- cfe/trunk/lib/Headers/stdatomic.h (original) > +++ cfe/trunk/lib/Headers/stdatomic.h Sat Sep 3 19:44:10 2016 > @@ -45,18 +45,18 @@ extern "C" { > #define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE > #define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE > #define ATOMIC_WCHAR_T_LOCK_FREE__GCC_ATOMIC_WCHAR_T_LOCK_FREE > -#define ATOMIC_SHORT_T_LOCK_FREE__GCC_ATOMIC_SHORT_T_LOCK_FREE > -#define ATOMIC_INT_T_LOCK_FREE __GCC_ATOMIC_INT_T_LOCK_FREE > -#define ATOMIC_LONG_T_LOCK_FREE __GCC_ATOMIC_LONG_T_LOCK_FREE > -#define ATOMIC_LLONG_T_LOCK_FREE__GCC_ATOMIC_LLONG_T_LOCK_FREE > -#define ATOMIC_POINTER_T_LOCK_FREE __GCC_ATOMIC_POINTER_T_LOCK_FREE > +#define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE > +#define ATOMIC_INT_LOCK_FREE__GCC_ATOMIC_INT_LOCK_FREE > +#define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE > +#define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE > +#define ATOMIC_POINTER_LOCK_FREE__GCC_ATOMIC_POINTER_LOCK_FREE > > /* 7.17.2 Initialization */ > > #define ATOMIC_VAR_INIT(value) (value) > #define atomic_init __c11_atomic_init > > -/* 7.17.3 Order and consistency */ > +/* 7.17.3 Order and consistency */. > > typedef enum memory_order { >memory_order_relaxed = __ATOMIC_RELAXED, > > > ___ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: r280607 - PR 27200: Fix names of the atomic lock-free macros.
On 3 Sep 2016 5:52 p.m., "Joerg Sonnenberger via cfe-commits" < cfe-commits@lists.llvm.org> wrote: Author: joerg Date: Sat Sep 3 19:44:10 2016 New Revision: 280607 URL: http://llvm.org/viewvc/llvm-project?rev=280607&view=rev Log: PR 27200: Fix names of the atomic lock-free macros. Modified: cfe/trunk/lib/Headers/stdatomic.h Modified: cfe/trunk/lib/Headers/stdatomic.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/ stdatomic.h?rev=280607&r1=280606&r2=280607&view=diff == --- cfe/trunk/lib/Headers/stdatomic.h (original) +++ cfe/trunk/lib/Headers/stdatomic.h Sat Sep 3 19:44:10 2016 @@ -45,18 +45,18 @@ extern "C" { #define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE #define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE #define ATOMIC_WCHAR_T_LOCK_FREE__GCC_ATOMIC_WCHAR_T_LOCK_FREE -#define ATOMIC_SHORT_T_LOCK_FREE__GCC_ATOMIC_SHORT_T_LOCK_FREE -#define ATOMIC_INT_T_LOCK_FREE __GCC_ATOMIC_INT_T_LOCK_FREE -#define ATOMIC_LONG_T_LOCK_FREE __GCC_ATOMIC_LONG_T_LOCK_FREE -#define ATOMIC_LLONG_T_LOCK_FREE__GCC_ATOMIC_LLONG_T_LOCK_FREE -#define ATOMIC_POINTER_T_LOCK_FREE __GCC_ATOMIC_POINTER_T_LOCK_FREE +#define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE +#define ATOMIC_INT_LOCK_FREE__GCC_ATOMIC_INT_LOCK_FREE +#define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE +#define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE +#define ATOMIC_POINTER_LOCK_FREE__GCC_ATOMIC_POINTER_LOCK_FREE /* 7.17.2 Initialization */ #define ATOMIC_VAR_INIT(value) (value) #define atomic_init __c11_atomic_init -/* 7.17.3 Order and consistency */ +/* 7.17.3 Order and consistency */. Stray period here. Do we not have any tests that include this header? typedef enum memory_order { memory_order_relaxed = __ATOMIC_RELAXED, ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] r280608 - Fix bad locale test data when using the newest glibc
Author: ericwf Date: Sat Sep 3 19:48:54 2016 New Revision: 280608 URL: http://llvm.org/viewvc/llvm-project?rev=280608&view=rev Log: Fix bad locale test data when using the newest glibc Modified: libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp libcxx/trunk/test/support/test_macros.h Modified: libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp?rev=280608&r1=280607&r2=280608&view=diff == --- libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp (original) +++ libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp Sat Sep 3 19:48:54 2016 @@ -24,6 +24,7 @@ #include #include +#include "test_macros.h" #include "platform_support.h" // locale name macros class Fnf @@ -113,7 +114,14 @@ int main() { Fnf f(LOCALE_ru_RU_UTF_8, 1); +// GLIBC <= 2.23 uses currency_symbol="" +// GLIBC >= 2.24 uses currency_symbol="" +// See also: http://www.fileformat.info/info/unicode/char/20bd/index.htm +#if defined(TEST_GLIBC_PREREQ) && TEST_GLIBC_PREREQ(2, 24) +assert(f.curr_symbol() == " \xE2\x82\xBD"); +#else assert(f.curr_symbol() == " \xD1\x80\xD1\x83\xD0\xB1"); +#endif } { Fnt f(LOCALE_ru_RU_UTF_8, 1); Modified: libcxx/trunk/test/support/test_macros.h URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/test_macros.h?rev=280608&r1=280607&r2=280608&view=diff == --- libcxx/trunk/test/support/test_macros.h (original) +++ libcxx/trunk/test/support/test_macros.h Sat Sep 3 19:48:54 2016 @@ -62,6 +62,13 @@ #endif #endif +// Attempt to deduce GCC version +#if defined(_LIBCPP_VERSION) && __has_include() +#include +#define TEST_HAS_GLIBC +#define TEST_GLIBC_PREREQ(major, minor) __GLIBC_PREREQ(major, minor) +#endif + /* Features that were introduced in C++14 */ #if TEST_STD_VER >= 14 #define TEST_HAS_EXTENDED_CONSTEXPR ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r280609 - Trailing dot that shouldn't have been committed.
Author: joerg Date: Sat Sep 3 19:51:02 2016 New Revision: 280609 URL: http://llvm.org/viewvc/llvm-project?rev=280609&view=rev Log: Trailing dot that shouldn't have been committed. Modified: cfe/trunk/lib/Headers/stdatomic.h Modified: cfe/trunk/lib/Headers/stdatomic.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/stdatomic.h?rev=280609&r1=280608&r2=280609&view=diff == --- cfe/trunk/lib/Headers/stdatomic.h (original) +++ cfe/trunk/lib/Headers/stdatomic.h Sat Sep 3 19:51:02 2016 @@ -56,7 +56,7 @@ extern "C" { #define ATOMIC_VAR_INIT(value) (value) #define atomic_init __c11_atomic_init -/* 7.17.3 Order and consistency */. +/* 7.17.3 Order and consistency */ typedef enum memory_order { memory_order_relaxed = __ATOMIC_RELAXED, ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D24218: [libc++] Fix support for multibyte thousands_sep and decimal_point in moneypunct_byname
EricWF updated the summary for this revision. EricWF updated this revision to Diff 70277. EricWF added a comment. Remove secondary locale fix. https://reviews.llvm.org/D24218 Files: src/locale.cpp test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp Index: test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp === --- test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp +++ test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp @@ -18,16 +18,11 @@ // charT thousands_sep() const; -// Failure related to GLIBC's use of U00A0 as mon_thousands_sep -// and U002E as mon_decimal_point. -// TODO: U00A0 should be investigated. -// Possibly related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006 -// XFAIL: linux-gnu - #include #include #include +#include "test_macros.h" #include "platform_support.h" // locale name macros class Fnf @@ -114,22 +109,30 @@ Fwt f(LOCALE_fr_FR_UTF_8, 1); assert(f.thousands_sep() == L' '); } - +// The belowe tests fail due to GLIBC's use of U00A0 as mon_thousands_sep +// and U002E as mon_decimal_point. +// TODO: Fix thousands_sep for 'char'. +// related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006 +#ifndef TEST_HAS_GLIBC { Fnf f(LOCALE_ru_RU_UTF_8, 1); assert(f.thousands_sep() == ' '); } { Fnt f(LOCALE_ru_RU_UTF_8, 1); assert(f.thousands_sep() == ' '); } +const wchar_t sep = L' '; +#else +const wchar_t sep = L'\u00A0'; +#endif { Fwf f(LOCALE_ru_RU_UTF_8, 1); -assert(f.thousands_sep() == L' '); +assert(f.thousands_sep() == sep); } { Fwt f(LOCALE_ru_RU_UTF_8, 1); -assert(f.thousands_sep() == L' '); +assert(f.thousands_sep() == sep); } { Index: test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp === --- test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp +++ test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp @@ -12,9 +12,6 @@ // REQUIRES: locale.ru_RU.UTF-8 // REQUIRES: locale.zh_CN.UTF-8 -// Russia uses ',' for the decimal separator. GLIBC returns '.' -// XFAIL: linux - // // class moneypunct_byname @@ -25,6 +22,7 @@ #include #include +#include "test_macros.h" #include "platform_support.h" // locale name macros class Fnf @@ -112,21 +110,30 @@ assert(f.decimal_point() == L','); } +// The belowe tests fail due to GLIBC's use of U00A0 as mon_decimal_point +// and U002E as mon_decimal_point. +// TODO: Fix decimal_point for 'char'. +// related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006 +#ifndef TEST_HAS_GLIBC { Fnf f(LOCALE_ru_RU_UTF_8, 1); -assert(f.decimal_point() == ','); +assert(f.decimal_point() == '.'); } { Fnt f(LOCALE_ru_RU_UTF_8, 1); -assert(f.decimal_point() == ','); +assert(f.decimal_point() == '.'); } +const wchar_t sep = L'.'; +#else +const wchar_t sep = L'\u002E'; +#endif { Fwf f(LOCALE_ru_RU_UTF_8, 1); -assert(f.decimal_point() == L','); +assert(f.decimal_point() == sep); } { Fwt f(LOCALE_ru_RU_UTF_8, 1); -assert(f.decimal_point() == L','); +assert(f.decimal_point() == sep); } { Index: src/locale.cpp === --- src/locale.cpp +++ src/locale.cpp @@ -5768,6 +5768,26 @@ pat.field[3] = value; } +static char checked_string_to_char_convert(const char* ptr) { + /* + // FIXME: The input character is multiple bytes. Do something... + if (ptr[0] && ptr[1]) +__throw_runtime_error("locale not supported"); + */ + return *ptr; +} + +static wchar_t checked_string_to_wchar_convert(const char* ptr, + __locale_struct* loc) { + mbstate_t mb = {0}; + wchar_t out; + size_t ret = __libcpp_mbrtowc_l(&out, ptr, strlen(ptr), &mb, loc); + if (ret == static_cast(-1) || ret == static_cast(-2)) { + __throw_runtime_error("locale not supported"); + } + return out; +} + template<> void moneypunct_byname::init(const char* nm) @@ -5780,11 +5800,11 @@ lconv* lc = __libcpp_localeconv_l(loc.get()); if (*lc->mon_decimal_point) -__decimal_point_ = *lc->mon_decimal_point; +__decimal_point_ = checked_string_to_char_convert(lc->mon_decimal_point); else
Re: r280607 - PR 27200: Fix names of the atomic lock-free macros.
On Sat, Sep 03, 2016 at 05:56:43PM -0700, Richard Smith wrote: > /* 7.17.2 Initialization */ > > #define ATOMIC_VAR_INIT(value) (value) > #define atomic_init __c11_atomic_init > > -/* 7.17.3 Order and consistency */ > +/* 7.17.3 Order and consistency */. > > > Stray period here. Do we not have any tests that include this header? We do. Pre-commit editor snafu. Sorry about that. Joerg ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D24218: [libc++] Fix support for multibyte thousands_sep and decimal_point in moneypunct_byname
george.burgess.iv added a subscriber: george.burgess.iv. george.burgess.iv added a comment. Just a few drive-by nits. Thanks for the patch! Comment at: src/locale.cpp:5849 @@ -5828,4 +5848,3 @@ __decimal_point_ = base::do_decimal_point(); -if (*lc->mon_thousands_sep) -__thousands_sep_ = *lc->mon_thousands_sep; -else +if (*lc->mon_thousands_sep) { +__thousands_sep_ = checked_string_to_char_convert(lc->mon_thousands_sep); Are the newly-added braces necessary? Comment at: test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp:113 @@ -114,1 +112,3 @@ +// The belowe tests fail due to GLIBC's use of U00A0 as mon_decimal_point +// and U002E as mon_decimal_point. s/belowe/below Comment at: test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp:112 @@ -116,2 +111,3 @@ } - +// The belowe tests fail due to GLIBC's use of U00A0 as mon_thousands_sep +// and U002E as mon_decimal_point. s/belowe/below/ https://reviews.llvm.org/D24218 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D24218: [libc++] Fix support for multibyte thousands_sep and decimal_point in moneypunct_byname
EricWF updated this revision to Diff 70278. EricWF marked 3 inline comments as done. EricWF added a comment. Address all inline comments. https://reviews.llvm.org/D24218 Files: src/locale.cpp test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp Index: test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp === --- test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp +++ test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp @@ -18,16 +18,11 @@ // charT thousands_sep() const; -// Failure related to GLIBC's use of U00A0 as mon_thousands_sep -// and U002E as mon_decimal_point. -// TODO: U00A0 should be investigated. -// Possibly related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006 -// XFAIL: linux-gnu - #include #include #include +#include "test_macros.h" #include "platform_support.h" // locale name macros class Fnf @@ -114,22 +109,30 @@ Fwt f(LOCALE_fr_FR_UTF_8, 1); assert(f.thousands_sep() == L' '); } - +// The below tests fail due to GLIBC's use of U00A0 as mon_thousands_sep +// and U002E as mon_decimal_point. +// TODO: Fix thousands_sep for 'char'. +// related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006 +#ifndef TEST_HAS_GLIBC { Fnf f(LOCALE_ru_RU_UTF_8, 1); assert(f.thousands_sep() == ' '); } { Fnt f(LOCALE_ru_RU_UTF_8, 1); assert(f.thousands_sep() == ' '); } +const wchar_t sep = L' '; +#else +const wchar_t sep = L'\u00A0'; +#endif { Fwf f(LOCALE_ru_RU_UTF_8, 1); -assert(f.thousands_sep() == L' '); +assert(f.thousands_sep() == sep); } { Fwt f(LOCALE_ru_RU_UTF_8, 1); -assert(f.thousands_sep() == L' '); +assert(f.thousands_sep() == sep); } { Index: test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp === --- test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp +++ test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp @@ -12,9 +12,6 @@ // REQUIRES: locale.ru_RU.UTF-8 // REQUIRES: locale.zh_CN.UTF-8 -// Russia uses ',' for the decimal separator. GLIBC returns '.' -// XFAIL: linux - // // class moneypunct_byname @@ -25,6 +22,7 @@ #include #include +#include "test_macros.h" #include "platform_support.h" // locale name macros class Fnf @@ -112,21 +110,30 @@ assert(f.decimal_point() == L','); } +// The below tests fail due to GLIBC's use of U00A0 as mon_decimal_point +// and U002E as mon_decimal_point. +// TODO: Fix decimal_point for 'char'. +// related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006 +#ifndef TEST_HAS_GLIBC { Fnf f(LOCALE_ru_RU_UTF_8, 1); -assert(f.decimal_point() == ','); +assert(f.decimal_point() == '.'); } { Fnt f(LOCALE_ru_RU_UTF_8, 1); -assert(f.decimal_point() == ','); +assert(f.decimal_point() == '.'); } +const wchar_t sep = L'.'; +#else +const wchar_t sep = L'\u002E'; +#endif { Fwf f(LOCALE_ru_RU_UTF_8, 1); -assert(f.decimal_point() == L','); +assert(f.decimal_point() == sep); } { Fwt f(LOCALE_ru_RU_UTF_8, 1); -assert(f.decimal_point() == L','); +assert(f.decimal_point() == sep); } { Index: src/locale.cpp === --- src/locale.cpp +++ src/locale.cpp @@ -5768,6 +5768,26 @@ pat.field[3] = value; } +static char checked_string_to_char_convert(const char* ptr) { + /* + // FIXME: The input character is multiple bytes. Do something... + if (ptr[0] && ptr[1]) +__throw_runtime_error("locale not supported"); + */ + return *ptr; +} + +static wchar_t checked_string_to_wchar_convert(const char* ptr, + __locale_struct* loc) { + mbstate_t mb = {0}; + wchar_t out; + size_t ret = __libcpp_mbrtowc_l(&out, ptr, strlen(ptr), &mb, loc); + if (ret == static_cast(-1) || ret == static_cast(-2)) { + __throw_runtime_error("locale not supported"); + } + return out; +} + template<> void moneypunct_byname::init(const char* nm) @@ -5780,11 +5800,11 @@ lconv* lc = __libcpp_localeconv_l(loc.get()); if (*lc->mon_decimal_point) -__decimal_point_ = *lc->mon_decimal_point; +__decimal_point_ = checked_string_to_char_convert(lc->mon_decimal_point); else __deci
Re: [PATCH] D24087: [lit] Allow more file extensions for test cases.
EricWF added a comment. I don't think assembly based `.pass` and `.fail` tests will work quite yet. The `CXXCompiler` object used by the test format explicitly passes `-xc++ %s` in some cases. I'm assuming you already have a libc++abi assembly test? Could you put it up for review? https://reviews.llvm.org/D24087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D24087: [lit] Allow more file extensions for test cases.
EricWF accepted this revision. EricWF added a comment. This revision is now accepted and ready to land. Woops I see the test case now. LGTM. Comment at: test/libcxx/test/format.py:69 @@ +68,3 @@ +name_root, name_ext = os.path.splitext(name) +is_sh_test = name_root.endswith('.sh') +is_pass_test = name_root.endswith('.pass') Since we only support `.sh.XXX` tests let's only loosen the restriction there for now. https://reviews.llvm.org/D24087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D24083: [CMake] Fix libc++abi __aeabi_idiv() link error.
EricWF added a comment. This is not correct. We need the `-nodefaultlibs` on most platforms to prevent libstdc++ from being linked. I think the correct fix is to change `--rtlib=` https://reviews.llvm.org/D24083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D24192: [clang-refactor] introducing clang-refactor
alexshap added a subscriber: alexshap. Comment at: clang-refactor/driver/Rename.h:192 @@ +191,3 @@ + auto ID = Sources.translateFile(Entry); + Rewrite.getEditBuffer(ID).write(outs()); +} if i am not mistaken if the file has not been modified this will print smth like "invalid source location" or similar. Pls, double check me. https://reviews.llvm.org/D24192 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] r280612 - Apply curr_symbol.pass.cpp test fix to missed test case
Author: ericwf Date: Sat Sep 3 23:09:25 2016 New Revision: 280612 URL: http://llvm.org/viewvc/llvm-project?rev=280612&view=rev Log: Apply curr_symbol.pass.cpp test fix to missed test case Modified: libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp Modified: libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp?rev=280612&r1=280611&r2=280612&view=diff == --- libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp (original) +++ libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp Sat Sep 3 23:09:25 2016 @@ -118,7 +118,7 @@ int main() // GLIBC >= 2.24 uses currency_symbol="" // See also: http://www.fileformat.info/info/unicode/char/20bd/index.htm #if defined(TEST_GLIBC_PREREQ) && TEST_GLIBC_PREREQ(2, 24) -assert(f.curr_symbol() == " \xE2\x82\xBD"); +assert(f.curr_symbol() == " \u20BD"); #else assert(f.curr_symbol() == " \xD1\x80\xD1\x83\xD0\xB1"); #endif @@ -129,8 +129,13 @@ int main() } { Fwf f(LOCALE_ru_RU_UTF_8, 1); +#if defined(TEST_GLIBC_PREREQ) && TEST_GLIBC_PREREQ(2, 24) +assert(f.curr_symbol() == L" \u20BD"); +#else assert(f.curr_symbol() == L" \x440\x443\x431"); +#endif } + { Fwt f(LOCALE_ru_RU_UTF_8, 1); assert(f.curr_symbol() == L" RUB"); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: r280607 - PR 27200: Fix names of the atomic lock-free macros.
On 3 Sep 2016 6:01 p.m., "Joerg Sonnenberger via cfe-commits" < cfe-commits@lists.llvm.org> wrote: On Sat, Sep 03, 2016 at 05:56:43PM -0700, Richard Smith wrote: > /* 7.17.2 Initialization */ > > #define ATOMIC_VAR_INIT(value) (value) > #define atomic_init __c11_atomic_init > > -/* 7.17.3 Order and consistency */ > +/* 7.17.3 Order and consistency */. > > > Stray period here. Do we not have any tests that include this header? We do. Pre-commit editor snafu. Sorry about that. Thanks for the fix. Can you add a simple test that we provide macros with the right name? Other than that, it makes sense to me for this to go to the release branches. (I'm not sure whether we're doing more 3.8 point releases now that 3.9 is out though.) Joerg ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D23871: [Modules] Add 'freestanding' to the 'requires-declaration' feature-list.
This revision was automatically updated to reflect the committed changes. Closed by commit rL280613: [Modules] Add 'freestanding' to the 'requires-declaration' feature-list. (authored by eladcohen). Changed prior to commit: https://reviews.llvm.org/D23871?vs=69239&id=70279#toc Repository: rL LLVM https://reviews.llvm.org/D23871 Files: cfe/trunk/docs/Modules.rst cfe/trunk/lib/Basic/Module.cpp cfe/trunk/lib/Headers/module.modulemap cfe/trunk/test/Modules/compiler_builtins_x86.c Index: cfe/trunk/docs/Modules.rst === --- cfe/trunk/docs/Modules.rst +++ cfe/trunk/docs/Modules.rst @@ -413,6 +413,9 @@ cplusplus11 C++11 support is available. +freestanding + A freestanding environment is available. + gnuinlineasm GNU inline ASM is available. Index: cfe/trunk/test/Modules/compiler_builtins_x86.c === --- cfe/trunk/test/Modules/compiler_builtins_x86.c +++ cfe/trunk/test/Modules/compiler_builtins_x86.c @@ -0,0 +1,6 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s -verify -ffreestanding +// expected-no-diagnostics + +#include + Index: cfe/trunk/lib/Basic/Module.cpp === --- cfe/trunk/lib/Basic/Module.cpp +++ cfe/trunk/lib/Basic/Module.cpp @@ -64,6 +64,7 @@ .Case("blocks", LangOpts.Blocks) .Case("cplusplus", LangOpts.CPlusPlus) .Case("cplusplus11", LangOpts.CPlusPlus11) +.Case("freestanding", LangOpts.Freestanding) .Case("gnuinlineasm", LangOpts.GNUAsm) .Case("objc", LangOpts.ObjC1) .Case("objc_arc", LangOpts.ObjCAutoRefCount) Index: cfe/trunk/lib/Headers/module.modulemap === --- cfe/trunk/lib/Headers/module.modulemap +++ cfe/trunk/lib/Headers/module.modulemap @@ -63,6 +63,7 @@ textual header "mwaitxintrin.h" explicit module mm_malloc { + requires !freestanding header "mm_malloc.h" export * // note: for dependency } Index: cfe/trunk/docs/Modules.rst === --- cfe/trunk/docs/Modules.rst +++ cfe/trunk/docs/Modules.rst @@ -413,6 +413,9 @@ cplusplus11 C++11 support is available. +freestanding + A freestanding environment is available. + gnuinlineasm GNU inline ASM is available. Index: cfe/trunk/test/Modules/compiler_builtins_x86.c === --- cfe/trunk/test/Modules/compiler_builtins_x86.c +++ cfe/trunk/test/Modules/compiler_builtins_x86.c @@ -0,0 +1,6 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s -verify -ffreestanding +// expected-no-diagnostics + +#include + Index: cfe/trunk/lib/Basic/Module.cpp === --- cfe/trunk/lib/Basic/Module.cpp +++ cfe/trunk/lib/Basic/Module.cpp @@ -64,6 +64,7 @@ .Case("blocks", LangOpts.Blocks) .Case("cplusplus", LangOpts.CPlusPlus) .Case("cplusplus11", LangOpts.CPlusPlus11) +.Case("freestanding", LangOpts.Freestanding) .Case("gnuinlineasm", LangOpts.GNUAsm) .Case("objc", LangOpts.ObjC1) .Case("objc_arc", LangOpts.ObjCAutoRefCount) Index: cfe/trunk/lib/Headers/module.modulemap === --- cfe/trunk/lib/Headers/module.modulemap +++ cfe/trunk/lib/Headers/module.modulemap @@ -63,6 +63,7 @@ textual header "mwaitxintrin.h" explicit module mm_malloc { + requires !freestanding header "mm_malloc.h" export * // note: for dependency } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r280613 - [Modules] Add 'freestanding' to the 'requires-declaration' feature-list.
Author: eladcohen Date: Sun Sep 4 01:00:42 2016 New Revision: 280613 URL: http://llvm.org/viewvc/llvm-project?rev=280613&view=rev Log: [Modules] Add 'freestanding' to the 'requires-declaration' feature-list. This adds support for modules that require (non-)freestanding environment, such as the compiler builtin mm_malloc submodule. Differential Revision: https://reviews.llvm.org/D23871 Added: cfe/trunk/test/Modules/compiler_builtins_x86.c Modified: cfe/trunk/docs/Modules.rst cfe/trunk/lib/Basic/Module.cpp cfe/trunk/lib/Headers/module.modulemap Modified: cfe/trunk/docs/Modules.rst URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/Modules.rst?rev=280613&r1=280612&r2=280613&view=diff == --- cfe/trunk/docs/Modules.rst (original) +++ cfe/trunk/docs/Modules.rst Sun Sep 4 01:00:42 2016 @@ -413,6 +413,9 @@ cplusplus cplusplus11 C++11 support is available. +freestanding + A freestanding environment is available. + gnuinlineasm GNU inline ASM is available. Modified: cfe/trunk/lib/Basic/Module.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Module.cpp?rev=280613&r1=280612&r2=280613&view=diff == --- cfe/trunk/lib/Basic/Module.cpp (original) +++ cfe/trunk/lib/Basic/Module.cpp Sun Sep 4 01:00:42 2016 @@ -64,6 +64,7 @@ static bool hasFeature(StringRef Feature .Case("blocks", LangOpts.Blocks) .Case("cplusplus", LangOpts.CPlusPlus) .Case("cplusplus11", LangOpts.CPlusPlus11) +.Case("freestanding", LangOpts.Freestanding) .Case("gnuinlineasm", LangOpts.GNUAsm) .Case("objc", LangOpts.ObjC1) .Case("objc_arc", LangOpts.ObjCAutoRefCount) Modified: cfe/trunk/lib/Headers/module.modulemap URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/module.modulemap?rev=280613&r1=280612&r2=280613&view=diff == --- cfe/trunk/lib/Headers/module.modulemap (original) +++ cfe/trunk/lib/Headers/module.modulemap Sun Sep 4 01:00:42 2016 @@ -63,6 +63,7 @@ module _Builtin_intrinsics [system] [ext textual header "mwaitxintrin.h" explicit module mm_malloc { + requires !freestanding header "mm_malloc.h" export * // note: for dependency } Added: cfe/trunk/test/Modules/compiler_builtins_x86.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/compiler_builtins_x86.c?rev=280613&view=auto == --- cfe/trunk/test/Modules/compiler_builtins_x86.c (added) +++ cfe/trunk/test/Modules/compiler_builtins_x86.c Sun Sep 4 01:00:42 2016 @@ -0,0 +1,6 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s -verify -ffreestanding +// expected-no-diagnostics + +#include + ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D23871: [Modules] Add 'freestanding' to the 'requires-declaration' feature-list.
eladcohen added a comment. Thanks Richard, committed r280613. Repository: rL LLVM https://reviews.llvm.org/D23871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D23926: [libcxx] Don't use C99 math ops in -std=c++03 mode
@mclow.lists: Our C library is aware of the fact that it may be used from a C++ context, yes. So you think it's OK for libc++ to expect C99 operations at all language standards? Cheers, / Asiri On 4 Sep 2016 01:16, "Marshall Clow via cfe-commits" < cfe-commits@lists.llvm.org> wrote: > mclow.lists added a comment. > > > We have quite a strict C library which is picky about what it exposes > under different standards. For example, it won't expose C99 math ops if it > is being used under `__cplusplus < 201103L` ... > > > That sounds .. odd to me, having the behavior of the C library depend on > the value of `__cplusplus` > > > https://reviews.llvm.org/D23926 > > > > ___ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits > ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D21968: [libcxx] Externally threaded libc++ variant - Take 2
@mclow.lists: Ping ? On 24 Aug 2016 22:46, "Asiri Rathnayake via cfe-commits" < cfe-commits@lists.llvm.org> wrote: > rmaprath added inline comments. > > > Comment at: include/__config:830 > @@ -829,1 +829,3 @@ > +!defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && \ > +!defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) > # if defined(__FreeBSD__) || \ > > compnerd wrote: > > I meant on the lines that you added :-). > Will update to reflect rest of the source file. > > > Comment at: include/__threading_support:261 > @@ -200,1 +260,3 @@ > +void* __libcpp_tl_get(__libcpp_tl_key __key); > +void __libcpp_tl_set(__libcpp_tl_key __key, void* __p); > > > compnerd wrote: > > I think we should explicitly spell out `tls`. The extra character won't > hurt. > Will fix. > > > Comment at: lib/CMakeLists.txt:216 > @@ +215,3 @@ > + ) > +endif() > + > > compnerd wrote: > > Have you considered a slightly alternative approach of basically > implementing pthreads as an "external" threading model as well? You could > override it, or take the default implementation that is provided. It > avoids having a second supporting DSO for threading as we could always > statically link against it. > So, the particulars of this design was discussed and (generally) agreed > upon sometime back. > > Currently pthreads **is** hidden behind the same threading API as the > externally threaded variant (on this patch). To override the default > (pthread) implementation, you just have to drop in an > `__external_threading` header and specify the > `-DLIBCXX_HAS_EXTERNAL_THREAD_API` > cmake option. > > There's no need to provide a second DSO if your `__external_threading` > header (and your thread-system sources) are available at `libc++` build > time. > > But we have a **requirement** that the library needs to be build-able in > such a way you can provide a second DSO holding the implementation of the > API. That is, we need to be able to build and ship a library to which > customers can drop-in their own thread implementation (i.e. the > thread-support DSO). > > Note that in one of my earlier patches, I proposed an even more de-coupled > external threading system where even the types like `__libcpp_mutex_t` were > opaque pointers. @mclow.lists opposed that (perhaps rightfully so, now I > think about it) and currently these types need to be known at `libc++` > compile time. The implementation of the API functions like > `__libcpp_mutex_lock()` can be deferred to link time (this is what is > provided in the second DSO). > > Hope that clarifies everything here? > > > > > > > > > Comment at: test/support/external_threads.cpp:26 > @@ +25,3 @@ > +if (__ec) > + goto fail; > + > > compnerd wrote: > > I think this would be nicer as: > > > > if (int error = pthread_mutexattr_init(&attr)) > > return error; > I think I'm following the conventions used in the `libc++` source files > here. Will double check tomorrow. > > > Comment at: test/support/external_threads.cpp:52 > @@ +51,3 @@ > +fail: > +return __ec; > +} > > compnerd wrote: > > I don't think that the label for failure is adding anything since you > really are handling the destruction of the mutex at all failure sites. > Not sure what I did here. Will double check and fix. > > > Comment at: test/support/external_threads.cpp:70 > @@ +69,3 @@ > + > +int __libcpp_mutex_destroy(__libcpp_mutex_t* __m) { > +return pthread_mutex_destroy(__m); > > compnerd wrote: > > Please choose a single style. > Will fix. > > > Comment at: test/support/external_threads.cpp:103 > @@ +102,3 @@ > + > +bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id > t2) { > +return pthread_equal(t1, t2) != 0; > > compnerd wrote: > > Please choose a single style (and below). > Will fix. > > > Comment at: test/support/external_threads.cpp:131 > @@ +130,3 @@ > +// before. > +if (*__t == 0) > +return -1; > > compnerd wrote: > > Can you compare to `nullptr` instead? > I can't remember exactly why, but I think there was a problem with using > `nullptr` here. I will check and get back. > > > Comment at: test/support/external_threads.cpp:142 > @@ +141,3 @@ > +// before. > +if (*__t == 0) > +return -1; > > compnerd wrote: > > Same. > Need to check. > > > https://reviews.llvm.org/D21968 > > > > ___ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits > ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D18639: Use __builtin_isnan/isinf/isfinite in complex
hfinkel added a comment. In https://reviews.llvm.org/D18639#527285, @hfinkel wrote: > In https://reviews.llvm.org/D18639#515000, @hfinkel wrote: > > > Updated to use scheme suggested by Marshall. > > > Ping. Ping. https://reviews.llvm.org/D18639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits