From owner-svn-src-vendor@FreeBSD.ORG Sat Apr 27 17:19:07 2013 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DEDFD40C; Sat, 27 Apr 2013 17:19:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B8CC81219; Sat, 27 Apr 2013 17:19:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3RHJ73L080857; Sat, 27 Apr 2013 17:19:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3RHJ7ug080855; Sat, 27 Apr 2013 17:19:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304271719.r3RHJ7ug080855@svn.freebsd.org> From: Dimitry Andric Date: Sat, 27 Apr 2013 17:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r249987 - vendor/libcxxrt/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2013 17:19:07 -0000 Author: dim Date: Sat Apr 27 17:19:07 2013 New Revision: 249987 URL: http://svnweb.freebsd.org/changeset/base/249987 Log: Import c812a07cd2f95c1403baf0bbe0366e7618d1d6d3 of libcxxrt: * Fix a copy-and-paste error when setting the unexpected exception handler (actually set the terminate handler by mistake). * Fix some warnings. Patch by Joerg Sonnenberger! * Don't call the _fast version of the TLS accessor in terminate() or unexpected(). 1) TLS may not have been set up yet. 2) When we're in one of these functions, Really Bad Stuff has happened and potentially saving a few cycles really isn't important. * Merge in fixes from FreeBSD trunk to make atomics work with recent clang. Modified: vendor/libcxxrt/dist/atomic.h vendor/libcxxrt/dist/exception.cc Modified: vendor/libcxxrt/dist/atomic.h ============================================================================== --- vendor/libcxxrt/dist/atomic.h Sat Apr 27 16:44:59 2013 (r249986) +++ vendor/libcxxrt/dist/atomic.h Sat Apr 27 17:19:07 2013 (r249987) @@ -9,9 +9,9 @@ * Swap macro that enforces a happens-before relationship with a corresponding * ATOMIC_LOAD. */ -#if __has_feature(cxx_atomic) +#if __has_builtin(__c11_atomic_exchange) #define ATOMIC_SWAP(addr, val)\ - __atomic_exchange(addr, val, __ATOMIC_ACQ_REL) + __c11_atomic_exchange((_Atomic(__typeof__(val))*)addr, val, __ATOMIC_ACQ_REL) #elif __has_builtin(__sync_swap) #define ATOMIC_SWAP(addr, val)\ __sync_swap(addr, val) @@ -20,9 +20,9 @@ __sync_lock_test_and_set(addr, val) #endif -#if __has_feature(cxx_atomic) +#if __has_builtin(__c11_atomic_load) #define ATOMIC_LOAD(addr)\ - __atomic_load(addr, __ATOMIC_ACQUIRE) + __c11_atomic_load((_Atomic(__typeof__(*addr))*)addr, __ATOMIC_ACQUIRE) #else #define ATOMIC_LOAD(addr)\ (__sync_synchronize(), *addr) Modified: vendor/libcxxrt/dist/exception.cc ============================================================================== --- vendor/libcxxrt/dist/exception.cc Sat Apr 27 16:44:59 2013 (r249986) +++ vendor/libcxxrt/dist/exception.cc Sat Apr 27 17:19:07 2013 (r249987) @@ -1387,7 +1387,7 @@ namespace std { if (thread_local_handlers) { return pathscale::set_unexpected(f); } - return ATOMIC_SWAP(&terminateHandler, f); + return ATOMIC_SWAP(&unexpectedHandler, f); } /** * Sets the function that is called to terminate the program. @@ -1404,7 +1404,7 @@ namespace std */ void terminate() { - static __cxa_thread_info *info = thread_info_fast(); + static __cxa_thread_info *info = thread_info(); if (0 != info && 0 != info->terminateHandler) { info->terminateHandler(); @@ -1421,7 +1421,7 @@ namespace std */ void unexpected() { - static __cxa_thread_info *info = thread_info_fast(); + static __cxa_thread_info *info = thread_info(); if (0 != info && 0 != info->unexpectedHandler) { info->unexpectedHandler();