r339016 - [clang] Fix broken include_next in float.h

2018-08-06 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Mon Aug  6 07:29:47 2018
New Revision: 339016

URL: http://llvm.org/viewvc/llvm-project?rev=339016&view=rev
Log:
[clang] Fix broken include_next in float.h

Summary:
The code defines __FLOAT_H and then includes the next , which is
guarded on __FLOAT_H so it gets skipped entirely. This commit uses the header
guard __CLANG_FLOAT_H, like other headers (such as limits.h) do.

Reviewers: jfb

Subscribers: dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D50276

Modified:
cfe/trunk/lib/Headers/float.h

Modified: cfe/trunk/lib/Headers/float.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/float.h?rev=339016&r1=339015&r2=339016&view=diff
==
--- cfe/trunk/lib/Headers/float.h (original)
+++ cfe/trunk/lib/Headers/float.h Mon Aug  6 07:29:47 2018
@@ -21,8 +21,8 @@
  *===---===
  */
 
-#ifndef __FLOAT_H
-#define __FLOAT_H
+#ifndef __CLANG_FLOAT_H
+#define __CLANG_FLOAT_H
 
 /* If we're on MinGW, fall back to the system's float.h, which might have
  * additional definitions provided for Windows.
@@ -157,4 +157,4 @@
 #  define FLT16_TRUE_MIN__FLT16_TRUE_MIN__
 #endif /* __STDC_WANT_IEC_60559_TYPES_EXT__ */
 
-#endif /* __FLOAT_H */
+#endif /* __CLANG_FLOAT_H */


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r339431 - [libc++] Enable aligned allocation based on feature test macro, irrespective of standard

2018-08-10 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Fri Aug 10 06:24:56 2018
New Revision: 339431

URL: http://llvm.org/viewvc/llvm-project?rev=339431&view=rev
Log:
[libc++] Enable aligned allocation based on feature test macro, irrespective of 
standard

Summary:
The current code enables aligned allocation functions when compiling in C++17
and later. This is a problem because aligned allocation functions might not
be supported on the target platform, which leads to an error at link time.

Since r338934, Clang knows not to define __cpp_aligned_new when it's not
available on the target platform -- this commit takes advantage of that to
only use aligned allocation functions when they are available.

Reviewers: vsapsai, EricWF

Subscribers: christof, dexonsmith, cfe-commits, EricWF, mclow.lists

Differential Revision: https://reviews.llvm.org/D50344

Added:
libcxx/trunk/test/libcxx/memory/aligned_allocation_macro.pass.cpp
Modified:
libcxx/trunk/include/__config
libcxx/trunk/include/new

Modified: libcxx/trunk/include/__config
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=339431&r1=339430&r2=339431&view=diff
==
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Fri Aug 10 06:24:56 2018
@@ -988,6 +988,11 @@ template  struct __static_asse
 #  endif
 #endif // defined(__APPLE__)
 
+#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) && \
+!defined(_LIBCPP_BUILDING_LIBRARY) && \
+(!defined(__cpp_aligned_new) || __cpp_aligned_new < 201606)
+#  define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+#endif
 
 #if defined(__APPLE__) || defined(__FreeBSD__)
 #define _LIBCPP_HAS_DEFAULTRUNELOCALE

Modified: libcxx/trunk/include/new
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/new?rev=339431&r1=339430&r2=339431&view=diff
==
--- libcxx/trunk/include/new (original)
+++ libcxx/trunk/include/new Fri Aug 10 06:24:56 2018
@@ -108,13 +108,6 @@ void  operator delete[](void* ptr, void*
 # define _LIBCPP_HAS_NO_SIZED_DEALLOCATION
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) && \
-(!(defined(_LIBCPP_BUILDING_LIBRARY) || _LIBCPP_STD_VER > 14 || \
-(defined(__cpp_aligned_new) && __cpp_aligned_new >= 201606)))
-# define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
-#endif
-
-
 #if !__has_builtin(__builtin_operator_new) || \
__has_builtin(__builtin_operator_new) < 201802L || \
defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) || \

Added: libcxx/trunk/test/libcxx/memory/aligned_allocation_macro.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/memory/aligned_allocation_macro.pass.cpp?rev=339431&view=auto
==
--- libcxx/trunk/test/libcxx/memory/aligned_allocation_macro.pass.cpp (added)
+++ libcxx/trunk/test/libcxx/memory/aligned_allocation_macro.pass.cpp Fri Aug 
10 06:24:56 2018
@@ -0,0 +1,25 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: with_system_cxx_lib=macosx10.12
+// XFAIL: with_system_cxx_lib=macosx10.11
+// XFAIL: with_system_cxx_lib=macosx10.10
+// XFAIL: with_system_cxx_lib=macosx10.9
+// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: with_system_cxx_lib=macosx10.7
+
+#include 
+
+
+#ifdef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+#   error "libc++ should have aligned allocation in C++17 and up when 
targeting a platform that supports it"
+#endif
+
+int main() { }


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r339675 - [libc++] Add missing #include in C11 features tests

2018-08-14 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Tue Aug 14 06:29:17 2018
New Revision: 339675

URL: http://llvm.org/viewvc/llvm-project?rev=339675&view=rev
Log:
[libc++] Add missing #include in C11 features tests

Summary:
These #includes are quite important, since otherwise any

#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES)

checks are always false, and so we don't actually test for C11 support
in the standard library.

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D50674

Modified:
libcxx/trunk/test/libcxx/language.support/has_c11_features.pass.cpp
libcxx/trunk/test/std/depr/depr.c.headers/float_h.pass.cpp

libcxx/trunk/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp

Modified: libcxx/trunk/test/libcxx/language.support/has_c11_features.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/language.support/has_c11_features.pass.cpp?rev=339675&r1=339674&r2=339675&view=diff
==
--- libcxx/trunk/test/libcxx/language.support/has_c11_features.pass.cpp 
(original)
+++ libcxx/trunk/test/libcxx/language.support/has_c11_features.pass.cpp Tue Aug 
14 06:29:17 2018
@@ -14,6 +14,9 @@
 // _LIBCPP_HAS_C11_FEATURES - which is defined in <__config>
 // They should always be the same
 
+#include <__config>
+#include "test_macros.h"
+
 #ifdef TEST_HAS_C11_FEATURES
 # ifndef _LIBCPP_HAS_C11_FEATURES
 #  error "TEST_HAS_C11_FEATURES is defined, but _LIBCPP_HAS_C11_FEATURES is 
not"

Modified: libcxx/trunk/test/std/depr/depr.c.headers/float_h.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/float_h.pass.cpp?rev=339675&r1=339674&r2=339675&view=diff
==
--- libcxx/trunk/test/std/depr/depr.c.headers/float_h.pass.cpp (original)
+++ libcxx/trunk/test/std/depr/depr.c.headers/float_h.pass.cpp Tue Aug 14 
06:29:17 2018
@@ -11,6 +11,8 @@
 
 #include 
 
+#include "test_macros.h"
+
 #ifndef FLT_ROUNDS
 #error FLT_ROUNDS not defined
 #endif

Modified: 
libcxx/trunk/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp?rev=339675&r1=339674&r2=339675&view=diff
==
--- 
libcxx/trunk/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp 
(original)
+++ 
libcxx/trunk/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp 
Tue Aug 14 06:29:17 2018
@@ -11,6 +11,8 @@
 
 #include 
 
+#include "test_macros.h"
+
 #ifndef FLT_ROUNDS
 #error FLT_ROUNDS not defined
 #endif


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r339702 - [libc++] Fix incorrect definition of TEST_HAS_C11_FEATURES

2018-08-14 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Tue Aug 14 11:16:56 2018
New Revision: 339702

URL: http://llvm.org/viewvc/llvm-project?rev=339702&view=rev
Log:
[libc++] Fix incorrect definition of TEST_HAS_C11_FEATURES

Summary:
The macro was not defined in C++11 mode when it should have been, at least
according to how _LIBCPP_HAS_C11_FEATURES is defined.

Reviewers: mclow.lists, EricWF, jfb, dexonsmith

Subscribers: christof, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D50719

Modified:
libcxx/trunk/test/support/test_macros.h

Modified: libcxx/trunk/test/support/test_macros.h
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/test_macros.h?rev=339702&r1=339701&r2=339702&view=diff
==
--- libcxx/trunk/test/support/test_macros.h (original)
+++ libcxx/trunk/test/support/test_macros.h Tue Aug 14 11:16:56 2018
@@ -124,7 +124,7 @@
 
 // Sniff out to see if the underling C library has C11 features
 // Note that at this time (July 2018), MacOS X and iOS do NOT.
-#if __ISO_C_VISIBLE >= 2011
+#if __ISO_C_VISIBLE >= 2011 || TEST_STD_VER >= 11
 #  if defined(__FreeBSD__)
 #define TEST_HAS_C11_FEATURES
 #  elif defined(__Fuchsia__)


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r339741 - [libc++] Detect C11 features on non-Clang compilers

2018-08-14 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Tue Aug 14 17:16:41 2018
New Revision: 339741

URL: http://llvm.org/viewvc/llvm-project?rev=339741&view=rev
Log:
[libc++] Detect C11 features on non-Clang compilers

Summary:
The macros were inside `#if defined(_LIBCPP_COMPILER_CLANG)`, which means
we would never detect C11 features on non-Clang compilers. According to
Marshall Clow, this is not the intended behavior.

Reviewers: mclow.lists, EricWF

Subscribers: krytarowski, christof, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D50748

Modified:
libcxx/trunk/include/__config

Modified: libcxx/trunk/include/__config
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=339741&r1=339740&r2=339741&view=diff
==
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Tue Aug 14 17:16:41 2018
@@ -328,6 +328,28 @@
 #  define _LIBCPP_NO_CFI
 #endif
 
+#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
+#  if defined(__FreeBSD__)
+#define _LIBCPP_HAS_QUICK_EXIT
+#define _LIBCPP_HAS_C11_FEATURES
+#  elif defined(__Fuchsia__)
+#define _LIBCPP_HAS_QUICK_EXIT
+#define _LIBCPP_HAS_C11_FEATURES
+#  elif defined(__linux__)
+#if !defined(_LIBCPP_HAS_MUSL_LIBC)
+#  if _LIBCPP_GLIBC_PREREQ(2, 15) || defined(__BIONIC__)
+#define _LIBCPP_HAS_QUICK_EXIT
+#  endif
+#  if _LIBCPP_GLIBC_PREREQ(2, 17)
+#define _LIBCPP_HAS_C11_FEATURES
+#  endif
+#else // defined(_LIBCPP_HAS_MUSL_LIBC)
+#  define _LIBCPP_HAS_QUICK_EXIT
+#  define _LIBCPP_HAS_C11_FEATURES
+#endif
+#  endif // __linux__
+#endif
+
 #if defined(_LIBCPP_COMPILER_CLANG)
 
 // _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for
@@ -430,28 +452,6 @@ typedef __char32_t char32_t;
 #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
 #endif
 
-#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
-#  if defined(__FreeBSD__)
-#define _LIBCPP_HAS_QUICK_EXIT
-#define _LIBCPP_HAS_C11_FEATURES
-#  elif defined(__Fuchsia__)
-#define _LIBCPP_HAS_QUICK_EXIT
-#define _LIBCPP_HAS_C11_FEATURES
-#  elif defined(__linux__)
-#if !defined(_LIBCPP_HAS_MUSL_LIBC)
-#  if _LIBCPP_GLIBC_PREREQ(2, 15) || defined(__BIONIC__)
-#define _LIBCPP_HAS_QUICK_EXIT
-#  endif
-#  if _LIBCPP_GLIBC_PREREQ(2, 17)
-#define _LIBCPP_HAS_C11_FEATURES
-#  endif
-#else // defined(_LIBCPP_HAS_MUSL_LIBC)
-#  define _LIBCPP_HAS_QUICK_EXIT
-#  define _LIBCPP_HAS_C11_FEATURES
-#endif
-#  endif // __linux__
-#endif
-
 #if !(__has_feature(cxx_noexcept))
 #define _LIBCPP_HAS_NO_NOEXCEPT
 #endif


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r339742 - [libc++] Disable failing C11 feature tests for and

2018-08-14 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Tue Aug 14 17:18:01 2018
New Revision: 339742

URL: http://llvm.org/viewvc/llvm-project?rev=339742&view=rev
Log:
[libc++] Disable failing C11 feature tests for  and 

Summary:
Those tests are breaking the test bots. A Bugzilla has been filed to
make sure those tests are re-enabled: 
https://bugs.llvm.org/show_bug.cgi?id=38572

Reviewers: mclow.lists, EricWF

Subscribers: krytarowski, christof, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D50748

Modified:
libcxx/trunk/test/std/depr/depr.c.headers/float_h.pass.cpp

libcxx/trunk/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp

Modified: libcxx/trunk/test/std/depr/depr.c.headers/float_h.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/float_h.pass.cpp?rev=339742&r1=339741&r2=339742&view=diff
==
--- libcxx/trunk/test/std/depr/depr.c.headers/float_h.pass.cpp (original)
+++ libcxx/trunk/test/std/depr/depr.c.headers/float_h.pass.cpp Tue Aug 14 
17:18:01 2018
@@ -25,7 +25,7 @@
 #error FLT_RADIX not defined
 #endif
 
-#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES)
+#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0
 #ifndef FLT_HAS_SUBNORM
 #error FLT_HAS_SUBNORM not defined
 #endif
@@ -55,7 +55,7 @@
 #error DECIMAL_DIG not defined
 #endif
 
-#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES)
+#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0
 #ifndef FLT_DECIMAL_DIG
 #error FLT_DECIMAL_DIG not defined
 #endif
@@ -165,7 +165,7 @@
 #error LDBL_MIN not defined
 #endif
 
-#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES)
+#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0
 #ifndef FLT_TRUE_MIN
 #error FLT_TRUE_MIN not defined
 #endif

Modified: 
libcxx/trunk/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp?rev=339742&r1=339741&r2=339742&view=diff
==
--- 
libcxx/trunk/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp 
(original)
+++ 
libcxx/trunk/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp 
Tue Aug 14 17:18:01 2018
@@ -25,7 +25,7 @@
 #error FLT_RADIX not defined
 #endif
 
-#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES)
+#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0
 #ifndef FLT_HAS_SUBNORM
 #error FLT_HAS_SUBNORM not defined
 #endif
@@ -55,7 +55,7 @@
 #error DECIMAL_DIG not defined
 #endif
 
-#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES)
+#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0
 #ifndef FLT_DECIMAL_DIG
 #error FLT_DECIMAL_DIG not defined
 #endif
@@ -165,7 +165,7 @@
 #error LDBL_MIN not defined
 #endif
 
-#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES)
+#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0
 #ifndef FLT_TRUE_MIN
 #error FLT_TRUE_MIN not defined
 #endif


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r339743 - [libcxx] Fix XFAILs for aligned allocation tests on older OSX versions

2018-08-14 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Tue Aug 14 17:30:03 2018
New Revision: 339743

URL: http://llvm.org/viewvc/llvm-project?rev=339743&view=rev
Log:
[libcxx] Fix XFAILs for aligned allocation tests on older OSX versions

Summary:
Since r338934, Clang emits an error when aligned allocation functions are
used in conjunction with a system libc++ dylib that does not support those
functions. This causes some tests to fail when testing against older libc++
dylibs. This commit marks those tests as UNSUPPORTED, and also documents the
various reasons for the tests being unsupported.

Reviewers: vsapsai, EricWF

Subscribers: christof, dexonsmith, cfe-commits, mclow.lists, EricWF

Differential Revision: https://reviews.llvm.org/D50341

Added:

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.sh.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.sh.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.sh.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.sh.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.sh.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp
Removed:

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.fail.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.fail.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.fail.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.fail.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.fail.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.fail.cpp
Modified:
libcxx/trunk/test/libcxx/memory/aligned_allocation_macro.pass.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp

libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp

Modified: libcxx/trunk/test/libcxx/memory/aligned_allocation_macro.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/memory/aligned_allocation_macro.pass.cpp?rev=339743&r1=339742&r2=339743&view=diff
==
--- libcxx/trunk/test/libcxx/memory/aligned_allocation_macro.pass.cpp (original)
+++ libcxx/trunk/test/libcxx/memory/aligned_allocation_macro.pass.cpp Tue Aug 
14 17:30:03 2018
@@ -8,12 +8,14 @@
 
//===--===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.8
-// XFAIL: with_system_cxx_lib=macosx10.7
+
+// aligned allocation functions are not provided prior to macosx10.13
+// XFAIL: macosx10.12
+// XFAIL: macosx10.11
+// XFAIL: macosx10.10
+// XFAIL: macosx10.9
+// XFAIL: macosx10.8
+// XFAIL: macosx10.7
 
 #include 
 

Modified: 
libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp?rev=339743&r1=339742&r2=339743&view=diff
==
--- 
libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp
 Tue Aug 14 17:30:03 2018
@@ -12,17 +12,27 @@
 // UNSUPPORTED: sa

[libcxx] r339874 - [libcxx] By default, do not use internal_linkage to hide symbols from the ABI

2018-08-16 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Thu Aug 16 05:44:28 2018
New Revision: 339874

URL: http://llvm.org/viewvc/llvm-project?rev=339874&view=rev
Log:
[libcxx] By default, do not use internal_linkage to hide symbols from the ABI

Summary:
https://reviews.llvm.org/D49240 led to symbol size problems in Chromium, and
we expect this may be the case in other projects built in debug mode too.
Instead, unless users explicitly ask for internal_linkage, we use always_inline
like we used to.

In the future, when we have a solution that allows us to drop always_inline
without falling back on internal_linkage, we can replace always_inline by
that.

Note that this commit introduces a change in contract for existing libc++
users: by default, libc++ used to guarantee that TUs built with different
versions of libc++ could be linked together. With the introduction of the
_LIBCPP_HIDE_FROM_ABI_PER_TU macro, the default behavior is that TUs built
with different libc++ versions are not guaranteed to link. This is a change
in contract but not a change in behavior, since the current implementation
still allows linking TUs built with different libc++ versions together.

Reviewers: EricWF, mclow.lists, dexonsmith, hans, rnk

Subscribers: christof, cfe-commits

Differential Revision: https://reviews.llvm.org/D50652

Modified:
libcxx/trunk/CMakeLists.txt
libcxx/trunk/docs/BuildingLibcxx.rst
libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
libcxx/trunk/include/__config
libcxx/trunk/include/__config_site.in
libcxx/trunk/utils/libcxx/test/config.py

Modified: libcxx/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=339874&r1=339873&r2=339874&view=diff
==
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Thu Aug 16 05:44:28 2018
@@ -120,6 +120,7 @@ set(LIBCXX_ABI_VERSION ${DEFAULT_ABI_VER
 option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF)
 option(LIBCXX_ABI_FORCE_ITANIUM "Ignore auto-detection and force use of the 
Itanium ABI.")
 option(LIBCXX_ABI_FORCE_MICROSOFT "Ignore auto-detection and force use of the 
Microsoft ABI.")
+option(LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT "Enable per TU ABI insulation by 
default. To be used by vendors." OFF)
 set(LIBCXX_ABI_DEFINES "" CACHE STRING "A semicolon separated list of ABI 
macros to define in the site config header.")
 option(LIBCXX_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF)
 
@@ -662,6 +663,7 @@ endif()
 config_define_if(LIBCXX_ABI_UNSTABLE _LIBCPP_ABI_UNSTABLE)
 config_define_if(LIBCXX_ABI_FORCE_ITANIUM _LIBCPP_ABI_FORCE_ITANIUM)
 config_define_if(LIBCXX_ABI_FORCE_MICROSOFT _LIBCPP_ABI_FORCE_MICROSOFT)
+config_define_if(LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT 
_LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT)
 
 config_define_if_not(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE 
_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE)
 config_define_if_not(LIBCXX_ENABLE_STDIN _LIBCPP_HAS_NO_STDIN)

Modified: libcxx/trunk/docs/BuildingLibcxx.rst
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/BuildingLibcxx.rst?rev=339874&r1=339873&r2=339874&view=diff
==
--- libcxx/trunk/docs/BuildingLibcxx.rst (original)
+++ libcxx/trunk/docs/BuildingLibcxx.rst Thu Aug 16 05:44:28 2018
@@ -332,6 +332,15 @@ libc++ Feature Options
   Use the specified GCC toolchain and standard library when building the native
   stdlib benchmark tests.
 
+.. option:: LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT:BOOL
+
+  **Default**: ``OFF``
+
+  Pick the default for whether to constrain ABI-unstable symbols to
+  each individual translation unit. This setting controls whether
+  `_LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT` is defined by default --
+  see the documentation of that macro for details.
+
 
 libc++ ABI Feature Options
 --

Modified: libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst?rev=339874&r1=339873&r2=339874&view=diff
==
--- libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst (original)
+++ libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst Thu Aug 16 05:44:28 2018
@@ -42,9 +42,7 @@ Visibility Macros
 
 **_LIBCPP_HIDE_FROM_ABI**
   Mark a function as not being part of the ABI of any final linked image that
-  uses it, and also as being internal to each TU that uses that function. In
-  other words, the address of a function marked with this attribute is not
-  guaranteed to be the same across translation units.
+  uses it.
 
 **_LIBCPP_HIDE_FROM_ABI_AFTER_V1**
   Mark a function as being hidden from the ABI (per `_LIBCPP_HIDE_FROM_ABI`)
@@ -61,6 +59,41 @@ Visibility Macros
   ABI, we should create a new _LIBCPP_HIDE_FROM_ABI_AFTER_XXX macro, and we can
   use it to start removing symbols from the A

r340288 - [clang][NFC] Fix typo in the name of a note

2018-08-21 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Tue Aug 21 08:54:24 2018
New Revision: 340288

URL: http://llvm.org/viewvc/llvm-project?rev=340288&view=rev
Log:
[clang][NFC] Fix typo in the name of a note

Summary:
r306722 introduced a new note called 
note_silence_unligned_allocation_unavailable
where I believe what was meant is note_silence_aligned_allocation_unavailable.

Reviewers: ahatanak

Subscribers: dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D51043

Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaExprCXX.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=340288&r1=340287&r2=340288&view=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Aug 21 08:54:24 
2018
@@ -6468,7 +6468,7 @@ def warn_overaligned_type : Warning<
 def err_aligned_allocation_unavailable : Error<
   "aligned %select{allocation|deallocation}0 function of type '%1' is only "
   "available on %2 %3 or newer">;
-def note_silence_unligned_allocation_unavailable : Note<
+def note_silence_aligned_allocation_unavailable : Note<
   "if you supply your own aligned allocation functions, use "
   "-faligned-allocation to silence this diagnostic">;
 

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=340288&r1=340287&r2=340288&view=diff
==
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Tue Aug 21 08:54:24 2018
@@ -1744,7 +1744,7 @@ static void diagnoseUnavailableAlignedAl
 S.Diag(Loc, diag::err_aligned_allocation_unavailable)
 << IsDelete << FD.getType().getAsString() << OSName
 << alignedAllocMinVersion(T.getOS()).getAsString();
-S.Diag(Loc, diag::note_silence_unligned_allocation_unavailable);
+S.Diag(Loc, diag::note_silence_aligned_allocation_unavailable);
   }
 }
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r340608 - [libc++] Remove race condition in std::async

2018-08-24 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Fri Aug 24 07:00:59 2018
New Revision: 340608

URL: http://llvm.org/viewvc/llvm-project?rev=340608&view=rev
Log:
[libc++] Remove race condition in std::async

Summary:
The state associated to the future was set in one thread (with synchronization)
but read in another thread without synchronization, which led to a data race.

https://bugs.llvm.org/show_bug.cgi?id=38181
rdar://problem/42548261

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D51170

Added:
libcxx/trunk/test/std/thread/futures/futures.async/async_race.38682.pass.cpp
Modified:
libcxx/trunk/include/future
libcxx/trunk/src/future.cpp

Modified: libcxx/trunk/include/future
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/future?rev=340608&r1=340607&r2=340608&view=diff
==
--- libcxx/trunk/include/future (original)
+++ libcxx/trunk/include/future Fri Aug 24 07:00:59 2018
@@ -556,13 +556,14 @@ public:
 {return (__state_ & __constructed) || (__exception_ != nullptr);}
 
 _LIBCPP_INLINE_VISIBILITY
-void __set_future_attached()
-{
+void __attach_future() {
 lock_guard __lk(__mut_);
+bool __has_future_attached = (__state_ & __future_attached) != 0;
+if (__has_future_attached)
+__throw_future_error(future_errc::future_already_retrieved);
+this->__add_shared();
 __state_ |= __future_attached;
 }
-_LIBCPP_INLINE_VISIBILITY
-bool __has_future_attached() const {return (__state_ & __future_attached) 
!= 0;}
 
 _LIBCPP_INLINE_VISIBILITY
 void __set_deferred() {__state_ |= deferred;}
@@ -1154,10 +1155,7 @@ template 
 future<_Rp>::future(__assoc_state<_Rp>* __state)
 : __state_(__state)
 {
-if (__state_->__has_future_attached())
-__throw_future_error(future_errc::future_already_retrieved);
-__state_->__add_shared();
-__state_->__set_future_attached();
+__state_->__attach_future();
 }
 
 struct __release_shared_count
@@ -1257,10 +1255,7 @@ template 
 future<_Rp&>::future(__assoc_state<_Rp&>* __state)
 : __state_(__state)
 {
-if (__state_->__has_future_attached())
-__throw_future_error(future_errc::future_already_retrieved);
-__state_->__add_shared();
-__state_->__set_future_attached();
+__state_->__attach_future();
 }
 
 template 

Modified: libcxx/trunk/src/future.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/future.cpp?rev=340608&r1=340607&r2=340608&view=diff
==
--- libcxx/trunk/src/future.cpp (original)
+++ libcxx/trunk/src/future.cpp Fri Aug 24 07:00:59 2018
@@ -179,10 +179,7 @@ __assoc_sub_state::__execute()
 future::future(__assoc_sub_state* __state)
 : __state_(__state)
 {
-if (__state_->__has_future_attached())
-__throw_future_error(future_errc::future_already_retrieved);
-__state_->__add_shared();
-__state_->__set_future_attached();
+__state_->__attach_future();
 }
 
 future::~future()

Added: 
libcxx/trunk/test/std/thread/futures/futures.async/async_race.38682.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.async/async_race.38682.pass.cpp?rev=340608&view=auto
==
--- 
libcxx/trunk/test/std/thread/futures/futures.async/async_race.38682.pass.cpp 
(added)
+++ 
libcxx/trunk/test/std/thread/futures/futures.async/async_race.38682.pass.cpp 
Fri Aug 24 07:00:59 2018
@@ -0,0 +1,58 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+//
+// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
+
+// This test is designed to cause and allow TSAN to detect a race condition
+// in std::async, as reported in https://bugs.llvm.org/show_bug.cgi?id=38682.
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+static int worker(std::vector const& data) {
+  return std::accumulate(data.begin(), data.end(), 0);
+}
+
+static int& worker_ref(int& i) { return i; }
+
+static void worker_void() { }
+
+int main() {
+  // future
+  {
+std::vector const v{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+for (int i = 0; i != 20; ++i) {
+  std::future fut = std::async(std::launch::async, worker, v);
+  int answer = fut.get();
+  assert(answer == 55);
+}
+  }
+
+  // future
+  {
+for (int i = 0; i != 20; ++i) {
+  std::future fut = std::async(std::launch::async, worker_ref, 
std::ref(i));
+  int& answer = fut.get();
+  assert(answer == i);
+

[libcxx] r340609 - [libc++] Fix handling of negated character classes in regex

2018-08-24 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Fri Aug 24 07:10:28 2018
New Revision: 340609

URL: http://llvm.org/viewvc/llvm-project?rev=340609&view=rev
Log:
[libc++] Fix handling of negated character classes in regex

Summary:
This commit fixes a regression introduced in r316095, where we don't match
inverted character classes when there's no negated characrers in the []'s.

rdar://problem/43060054

Reviewers: mclow.lists, timshen, EricWF

Subscribers: christof, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D50534

Added:

libcxx/trunk/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp
Modified:
libcxx/trunk/include/regex

libcxx/trunk/test/std/re/re.alg/re.alg.search/invert_neg_word_search.pass.cpp

Modified: libcxx/trunk/include/regex
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/regex?rev=340609&r1=340608&r2=340609&view=diff
==
--- libcxx/trunk/include/regex (original)
+++ libcxx/trunk/include/regex Fri Aug 24 07:10:28 2018
@@ -2414,20 +2414,17 @@ __bracket_expression<_CharT, _Traits>::_
 goto __exit;
 }
 }
-// set of "__found" chars =
+// When there's at least one of __neg_chars_ and __neg_mask_, the set
+// of "__found" chars is
 //   union(complement(union(__neg_chars_, __neg_mask_)),
 // other cases...)
 //
-// __neg_chars_ and __neg_mask_'d better be handled together, as there
-// are no short circuit opportunities.
-//
-// In addition, when __neg_mask_/__neg_chars_ is empty, they should be
-// treated as all ones/all chars.
+// It doesn't make sense to check this when there are no __neg_chars_
+// and no __neg_mask_.
+if (!(__neg_mask_ == 0 && __neg_chars_.empty()))
 {
-  const bool __in_neg_mask = (__neg_mask_ == 0) ||
-  __traits_.isctype(__ch, __neg_mask_);
+const bool __in_neg_mask = __traits_.isctype(__ch, __neg_mask_);
   const bool __in_neg_chars =
-  __neg_chars_.empty() ||
   std::find(__neg_chars_.begin(), __neg_chars_.end(), __ch) !=
   __neg_chars_.end();
   if (!(__in_neg_mask || __in_neg_chars))

Added: 
libcxx/trunk/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp?rev=340609&view=auto
==
--- 
libcxx/trunk/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp
 (added)
+++ 
libcxx/trunk/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp
 Fri Aug 24 07:10:28 2018
@@ -0,0 +1,44 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+// 
+// UNSUPPORTED: c++98, c++03
+
+// Make sure that we correctly match inverted character classes.
+
+#include 
+#include 
+
+
+int main() {
+assert(std::regex_match("X", std::regex("[X]")));
+assert(std::regex_match("X", std::regex("[XY]")));
+assert(!std::regex_match("X", std::regex("[^X]")));
+assert(!std::regex_match("X", std::regex("[^XY]")));
+
+assert(std::regex_match("X", std::regex("[\\S]")));
+assert(!std::regex_match("X", std::regex("[^\\S]")));
+
+assert(!std::regex_match("X", std::regex("[\\s]")));
+assert(std::regex_match("X", std::regex("[^\\s]")));
+
+assert(std::regex_match("X", std::regex("[\\s\\S]")));
+assert(std::regex_match("X", std::regex("[^Y\\s]")));
+assert(!std::regex_match("X", std::regex("[^X\\s]")));
+
+assert(std::regex_match("X", std::regex("[\\w]")));
+assert(std::regex_match("_", std::regex("[\\w]")));
+assert(!std::regex_match("X", std::regex("[^\\w]")));
+assert(!std::regex_match("_", std::regex("[^\\w]")));
+
+assert(!std::regex_match("X", std::regex("[\\W]")));
+assert(!std::regex_match("_", std::regex("[\\W]")));
+assert(std::regex_match("X", std::regex("[^\\W]")));
+assert(std::regex_match("_", std::regex("[^\\W]")));
+}

Modified: 
libcxx/trunk/test/std/re/re.alg/re.alg.search/invert_neg_word_search.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.alg/re.alg.search/invert_neg_word_search.pass.cpp?rev=340609&r1=340608&r2=340609&view=diff
==
--- 
libcxx/trunk/test/std/re/re.alg/re.alg.search/invert_neg_word_search.pass.cpp 
(original)
+++ 
libcxx/trunk/test/std/re/re.alg/re.alg.search/invert_neg_word_search.pass.cpp 
F

[libcxx] r341550 - [libcxx] Add ReleaseNotes.rst file for release notes

2018-09-06 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Thu Sep  6 07:46:22 2018
New Revision: 341550

URL: http://llvm.org/viewvc/llvm-project?rev=341550&view=rev
Log:
[libcxx] Add ReleaseNotes.rst file for release notes

Added:
libcxx/trunk/docs/ReleaseNotes.rst

Added: libcxx/trunk/docs/ReleaseNotes.rst
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/ReleaseNotes.rst?rev=341550&view=auto
==
--- libcxx/trunk/docs/ReleaseNotes.rst (added)
+++ libcxx/trunk/docs/ReleaseNotes.rst Thu Sep  6 07:46:22 2018
@@ -0,0 +1,43 @@
+
+Libc++ 8.0.0 (In-Progress) Release Notes
+
+
+.. contents::
+   :local:
+   :depth: 2
+
+Written by the `Libc++ Team `_
+
+.. warning::
+
+   These are in-progress notes for the upcoming libc++ 8 release.
+   Release notes for previous releases can be found on
+   `the Download Page `_.
+
+Introduction
+
+
+This document contains the release notes for the libc++ C++ Standard Library,
+part of the LLVM Compiler Infrastructure, release 8.0.0. Here we describe the
+status of libc++ in some detail, including major improvements from the previous
+release and new feature work. For the general LLVM release notes, see `the LLVM
+documentation `_. All LLVM releases may
+be downloaded from the `LLVM releases web site `_.
+
+For more information about libc++, please see the `Libc++ Web Site
+`_ or the `LLVM Web Site `_.
+
+Note that if you are reading this file from a Subversion checkout or the
+main Libc++ web page, this document applies to the *next* release, not
+the current one. To see the release notes for a specific release, please
+see the `releases page `_.
+
+What's New in Libc++ 8.0.0?
+===
+
+New Features
+
+
+API Changes
+---
+


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r341551 - [libc++] Add a link to the Release notes from the main libc++ documentation

2018-09-06 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Thu Sep  6 08:05:43 2018
New Revision: 341551

URL: http://llvm.org/viewvc/llvm-project?rev=341551&view=rev
Log:
[libc++] Add a link to the Release notes from the main libc++ documentation

Modified:
libcxx/trunk/docs/index.rst

Modified: libcxx/trunk/docs/index.rst
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/index.rst?rev=341551&r1=341550&r2=341551&view=diff
==
--- libcxx/trunk/docs/index.rst (original)
+++ libcxx/trunk/docs/index.rst Thu Sep  6 08:05:43 2018
@@ -34,6 +34,7 @@ Getting Started with libc++
 .. toctree::
:maxdepth: 2
 
+   ReleaseNotes
UsingLibcxx
BuildingLibcxx
TestingLibcxx


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r342238 - [clang] Make sure attributes on member classes are applied properly

2018-09-14 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Fri Sep 14 07:07:16 2018
New Revision: 342238

URL: http://llvm.org/viewvc/llvm-project?rev=342238&view=rev
Log:
[clang] Make sure attributes on member classes are applied properly

Summary:
Attributes on member classes of class templates and member class templates
of class templates are not currently instantiated. This was discovered by
Richard Smith here:

  http://lists.llvm.org/pipermail/cfe-dev/2018-September/059291.html

This commit makes sure that attributes are instantiated properly. This
commit does not fix the broken behavior for member partial and explicit
specializations of class templates.

PR38913

Reviewers: rsmith

Subscribers: dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D51997

Added:
cfe/trunk/test/SemaCXX/PR38913.cpp
Modified:
cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=342238&r1=342237&r2=342238&view=diff
==
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Fri Sep 14 07:07:16 2018
@@ -1258,6 +1258,9 @@ Decl *TemplateDeclInstantiator::VisitCla
   if (QualifierLoc)
 RecordInst->setQualifierInfo(QualifierLoc);
 
+  SemaRef.InstantiateAttrsForDecl(TemplateArgs, Pattern, RecordInst, LateAttrs,
+  StartingScope);
+
   ClassTemplateDecl *Inst
 = ClassTemplateDecl::Create(SemaRef.Context, DC, D->getLocation(),
 D->getIdentifier(), InstParams, RecordInst);
@@ -1491,6 +1494,9 @@ Decl *TemplateDeclInstantiator::VisitCXX
   if (SubstQualifier(D, Record))
 return nullptr;
 
+  SemaRef.InstantiateAttrsForDecl(TemplateArgs, D, Record, LateAttrs,
+  StartingScope);
+
   Record->setImplicit(D->isImplicit());
   // FIXME: Check against AS_none is an ugly hack to work around the issue that
   // the tag decls introduced by friend class declarations don't have an access

Added: cfe/trunk/test/SemaCXX/PR38913.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/PR38913.cpp?rev=342238&view=auto
==
--- cfe/trunk/test/SemaCXX/PR38913.cpp (added)
+++ cfe/trunk/test/SemaCXX/PR38913.cpp Fri Sep 14 07:07:16 2018
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | 
FileCheck %s
+
+// PR38913
+// Check that we instantiate attributes on declarations for...
+
+// ...a member class of a class template specialization
+template struct A { struct __attribute__((abi_tag("ATAG"))) X { }; };
+A::X* a() { return 0; } // CHECK-DAG: @_Z1aB4ATAGv
+
+// ...a member class template
+template struct B { template struct 
__attribute__((abi_tag("BTAG"))) X { }; };
+B::X* b() { return 0; } // CHECK-DAG: @_Z1bB4BTAGv


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r337925 - [NFC] Fix grammatical mistakes in libc++ FileTimeType design docs

2018-07-25 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Wed Jul 25 06:40:49 2018
New Revision: 337925

URL: http://llvm.org/viewvc/llvm-project?rev=337925&view=rev
Log:
[NFC] Fix grammatical mistakes in libc++ FileTimeType design docs

Modified:
libcxx/trunk/docs/DesignDocs/FileTimeType.rst

Modified: libcxx/trunk/docs/DesignDocs/FileTimeType.rst
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/DesignDocs/FileTimeType.rst?rev=337925&r1=337924&r2=337925&view=diff
==
--- libcxx/trunk/docs/DesignDocs/FileTimeType.rst (original)
+++ libcxx/trunk/docs/DesignDocs/FileTimeType.rst Wed Jul 25 06:40:49 2018
@@ -61,7 +61,7 @@ of representing the range of the ``times
 Problems To Consider
 
 
-Before considering solutions, lets consider the problems they should solve,
+Before considering solutions, let's consider the problems they should solve,
 and how important solving those problems are:
 
 
@@ -187,7 +187,7 @@ Source Code Portability Across Implement
 As we've discussed, ``file_time_type`` needs a representation that uses more
 than 64 bits. The possible solutions include using ``__int128_t``, emulating a
 128 bit integer using a class, or potentially defining a ``timespec`` like
-arithmetic type. All three will solve allow us to, at minimum, match the range
+arithmetic type. All three will allow us to, at minimum, match the range
 and resolution, and the last one might even allow us to match them exactly.
 
 But when considering these potential solutions we need to consider more than
@@ -214,7 +214,7 @@ code in some way:
 
   file_time_type correct_timespec_to_file_time_type(struct timespec ts) {
 // This is the correct version of the above example, where we
-// avoid using the chrono typedefs as their not sufficient.
+// avoid using the chrono typedefs as they're not sufficient.
 // Can we expect users to avoid this bug?
 using fs_seconds = chrono::duration;
 using fs_nanoseconds = chrono::duration;
@@ -252,7 +252,7 @@ what the underlying system uses, and bec
 the range and resolution exactly. But would it work with chrono? And could
 it still act at all like a ``timespec`` struct?
 
-For ease of consideration, lets consider the what the implementation might
+For ease of consideration, let's consider what the implementation might
 look like.
 
 .. code-block:: cpp
@@ -278,11 +278,11 @@ directly. A ``chrono::duration`` represe
 number of ticks stored using ``rep``. The representation is unaware of the
 tick period it is being used to represent, but ``timespec`` is setup to assume
 a nanosecond tick period; which is the only case where the names ``tv_sec``
-and ``tv_nsec`` matche the values they store.
+and ``tv_nsec`` match the values they store.
 
-When we convert a nanosecond duration to a seconds, ``fs_timespec_rep`` will
+When we convert a nanosecond duration to seconds, ``fs_timespec_rep`` will
 use ``tv_sec`` to represent the number of giga seconds, and ``tv_nsec`` the
-remaining seconds. Lets consider how this might cause a bug were users allowed
+remaining seconds. Let's consider how this might cause a bug were users allowed
 to manipulate the fields directly.
 
 .. code-block:: cpp
@@ -364,8 +364,8 @@ described by this paper.
 Obviously our implementation for 32-bit builds should act as similarly to the
 64-bit build as possible. Code which compiles in one, should compile in the 
other.
 This consideration is important when choosing between ``__int128_t`` and
-emulating ``timespec``. The solution which provides the most uniformity is
-the preferable one, with the least eccentricity is the preferable one.
+emulating ``timespec``. The solution which provides the most uniformity with
+the least eccentricity is the preferable one.
 
 Summary
 ===
@@ -391,7 +391,7 @@ The Potential Solutions
 
 Pros:
 
-* As a type ``long long`` places the nicest with others:
+* As a type ``long long`` plays the nicest with others:
 
   * It works with streaming operators and other library entities which support
 builtin integer types, but don't support ``__int128_t``.


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r337955 - [libc++] Factor duplicate code into function templates

2018-07-25 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Wed Jul 25 12:40:01 2018
New Revision: 337955

URL: http://llvm.org/viewvc/llvm-project?rev=337955&view=rev
Log:
[libc++] Factor duplicate code into function templates

Summary:
The exact same code was replicated 11 times for implementing the basic_istream
input operators (those that don't use numeric_limits). The same code was also
duplicated twice for implementing the basic_istream input operators that take
numeric_limits into account.

This commit factors the common code into function templates to avoid
the duplication.

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D49808

Modified:
libcxx/trunk/include/istream

Modified: libcxx/trunk/include/istream
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/istream?rev=337955&r1=337954&r2=337955&view=diff
==
--- libcxx/trunk/include/istream (original)
+++ libcxx/trunk/include/istream Wed Jul 25 12:40:01 2018
@@ -358,381 +358,162 @@ basic_istream<_CharT, _Traits>::~basic_i
 {
 }
 
-template 
+template 
+_LIBCPP_INLINE_VISIBILITY
 basic_istream<_CharT, _Traits>&
-basic_istream<_CharT, _Traits>::operator>>(unsigned short& __n)
-{
+__input_arithmetic(basic_istream<_CharT, _Traits>& __is, _Tp& __n) {
 #ifndef _LIBCPP_NO_EXCEPTIONS
 try
 {
 #endif  // _LIBCPP_NO_EXCEPTIONS
-sentry __s(*this);
+typename basic_istream<_CharT, _Traits>::sentry __s(__is);
 if (__s)
 {
-typedef istreambuf_iterator _Ip;
-typedef num_get _Fp;
+typedef istreambuf_iterator<_CharT, _Traits> _Ip;
+typedef num_get<_CharT, _Ip> _Fp;
 ios_base::iostate __err = ios_base::goodbit;
-use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, 
__err, __n);
-this->setstate(__err);
+use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __err, 
__n);
+__is.setstate(__err);
 }
 #ifndef _LIBCPP_NO_EXCEPTIONS
 }
 catch (...)
 {
-this->__set_badbit_and_consider_rethrow();
+__is.__set_badbit_and_consider_rethrow();
 }
 #endif  // _LIBCPP_NO_EXCEPTIONS
-return *this;
+return __is;
+}
+
+template 
+basic_istream<_CharT, _Traits>&
+basic_istream<_CharT, _Traits>::operator>>(unsigned short& __n)
+{
+return _VSTD::__input_arithmetic(*this, __n);
 }
 
 template 
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(unsigned int& __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
-try
-{
-#endif  // _LIBCPP_NO_EXCEPTIONS
-sentry __s(*this);
-if (__s)
-{
-typedef istreambuf_iterator _Ip;
-typedef num_get _Fp;
-ios_base::iostate __err = ios_base::goodbit;
-use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, 
__err, __n);
-this->setstate(__err);
-}
-#ifndef _LIBCPP_NO_EXCEPTIONS
-}
-catch (...)
-{
-this->__set_badbit_and_consider_rethrow();
-}
-#endif  // _LIBCPP_NO_EXCEPTIONS
-return *this;
+return _VSTD::__input_arithmetic(*this, __n);
 }
 
 template 
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(long& __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
-try
-{
-#endif  // _LIBCPP_NO_EXCEPTIONS
-sentry __s(*this);
-if (__s)
-{
-typedef istreambuf_iterator _Ip;
-typedef num_get _Fp;
-ios_base::iostate __err = ios_base::goodbit;
-use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, 
__err, __n);
-this->setstate(__err);
-}
-#ifndef _LIBCPP_NO_EXCEPTIONS
-}
-catch (...)
-{
-this->__set_badbit_and_consider_rethrow();
-}
-#endif  // _LIBCPP_NO_EXCEPTIONS
-return *this;
+return _VSTD::__input_arithmetic(*this, __n);
 }
 
 template 
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(unsigned long& __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
-try
-{
-#endif  // _LIBCPP_NO_EXCEPTIONS
-sentry __s(*this);
-if (__s)
-{
-typedef istreambuf_iterator _Ip;
-typedef num_get _Fp;
-ios_base::iostate __err = ios_base::goodbit;
-use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, 
__err, __n);
-this->setstate(__err);
-}
-#ifndef _LIBCPP_NO_EXCEPTIONS
-}
-catch (...)
-{
-this->__set_badbit_and_consider_rethrow();
-}
-#endif  // _LIBCPP_NO_EXCEPTIONS
-return *this;
+return _VSTD::__input_arithmetic(*this, __n);
 }
 
 template 
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(long long& __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
-try
-{
-#endif  // _LIBCPP_NO_EXCEPTIONS
-sentry __s(*this);
-if (__s)
-{
-typedef istre

[libcxx] r338122 - [libc++] Introduce _LIBCPP_HIDE_FROM_ABI to replace _LIBCPP_INLINE_VISIBILITY

2018-07-27 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Fri Jul 27 05:46:03 2018
New Revision: 338122

URL: http://llvm.org/viewvc/llvm-project?rev=338122&view=rev
Log:
[libc++] Introduce _LIBCPP_HIDE_FROM_ABI to replace _LIBCPP_INLINE_VISIBILITY

Summary:
This commit introduces a new macro, _LIBCPP_HIDE_FROM_ABI, whose goal is to
mark functions that shouldn't be part of libc++'s ABI. It marks the functions
as being hidden for dylib visibility purposes, and as having internal linkage
using Clang's __attribute__((internal_linkage)) when available, and
__always_inline__ otherwise.

It replaces _LIBCPP_INLINE_VISIBILITY, which was always using __always_inline__
to achieve similar goals, but suffered from debuggability and code size 
problems.
The full proposal, along with more background information, can be found here:

http://lists.llvm.org/pipermail/cfe-dev/2018-July/058419.html

This commit does not rename uses of _LIBCPP_INLINE_VISIBILITY to
_LIBCPP_HIDE_FROM_ABI: this wide reaching but mechanical change can
be done later when we've confirmed we're happy with the new macro.

In the future, it would be nice if we could optionally allow dropping
any internal_linkage or __always_inline__ attribute, which could result
in code size improvements. However, this is currently impossible for
reasons explained here: 
http://lists.llvm.org/pipermail/cfe-dev/2018-July/058450.html

Reviewers: EricWF, dexonsmith, mclow.lists

Subscribers: christof, dexonsmith, llvm-commits, mclow.lists

Differential Revision: https://reviews.llvm.org/D49240

Modified:
libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
libcxx/trunk/include/__config

Modified: libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst?rev=338122&r1=338121&r2=338122&view=diff
==
--- libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst (original)
+++ libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst Fri Jul 27 05:46:03 2018
@@ -40,7 +40,7 @@ Visibility Macros
   this macro therefore expands to `__declspec(dllexport)` when building the
   library and has an empty definition otherwise.
 
-**_LIBCPP_INLINE_VISIBILITY**
+**_LIBCPP_HIDE_FROM_ABI**
   Mark a function as not being part of the ABI of any final linked image that
   uses it, and also as being internal to each TU that uses that function. In
   other words, the address of a function marked with this attribute is not
@@ -155,6 +155,22 @@ Visibility Macros
   versioning namespace. This allows throwing and catching some exception types
   between libc++ and libstdc++.
 
+**_LIBCPP_INTERNAL_LINKAGE**
+  Mark the affected entity as having internal linkage (i.e. the `static`
+  keyword in C). This is only a best effort: when the `internal_linkage`
+  attribute is not available, we fall back to forcing the function to be
+  inlined, which approximates internal linkage since an externally visible
+  symbol is never generated for that function. This is an internal macro
+  used as an implementation detail by other visibility macros. Never mark
+  a function or a class with this macro directly.
+
+**_LIBCPP_ALWAYS_INLINE**
+  Forces inlining of the function it is applied to. For visibility purposes,
+  this macro is used to make sure that an externally visible symbol is never
+  generated in an object file when the `internal_linkage` attribute is not
+  available. This is an internal macro used by other visibility macros, and
+  it should not be used directly.
+
 Links
 =
 

Modified: libcxx/trunk/include/__config
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=338122&r1=338121&r2=338122&view=diff
==
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Fri Jul 27 05:46:03 2018
@@ -491,6 +491,8 @@ namespace std {
 #define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS
 #endif
 
+#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
+
 #elif defined(_LIBCPP_COMPILER_GCC)
 
 #define _ALIGNAS(x) __attribute__((__aligned__(x)))
@@ -582,6 +584,8 @@ namespace std {
 #define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS
 #endif
 
+#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
+
 #elif defined(_LIBCPP_COMPILER_MSVC)
 
 #define _LIBCPP_TOSTRING2(x) #x
@@ -614,6 +618,8 @@ namespace std {
 
 #define _LIBCPP_HAS_NO_ASAN
 
+#define _LIBCPP_ALWAYS_INLINE __forceinline
+
 #elif defined(_LIBCPP_COMPILER_IBM)
 
 #define _ALIGNAS(x) __attribute__((__aligned__(x)))
@@ -644,6 +650,8 @@ namespace std {
 
 #define _LIBCPP_HAS_NO_ASAN
 
+#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
+
 #endif // _LIBCPP_COMPILER_[CLANG|GCC|MSVC|IBM]
 
 #if _LIBCPP_STD_VER >= 17
@@ -695,10 +703,8 @@ namespace std {
 #define _LIBCPP_ENUM_VIS
 
 #if defined(_LIBCPP_COMPILER_MSVC)
-#  define _LIBCPP_INLINE_VISIBILITY __forceinline
 #  define _LIBCPP_EX

[libcxxabi] r338475 - [libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since _LIBCPP_BUILDING_LIBRARY

2018-07-31 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Tue Jul 31 19:08:59 2018
New Revision: 338475

URL: http://llvm.org/viewvc/llvm-project?rev=338475&view=rev
Log:
[libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since 
_LIBCPP_BUILDING_LIBRARY

Summary: As suggested by Marshall in https://reviews.llvm.org/D49914

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D50008

Modified:
libcxxabi/trunk/src/stdlib_exception.cpp
libcxxabi/trunk/src/stdlib_new_delete.cpp

Modified: libcxxabi/trunk/src/stdlib_exception.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/stdlib_exception.cpp?rev=338475&r1=338474&r2=338475&view=diff
==
--- libcxxabi/trunk/src/stdlib_exception.cpp (original)
+++ libcxxabi/trunk/src/stdlib_exception.cpp Tue Jul 31 19:08:59 2018
@@ -8,7 +8,6 @@
 
//===--===//
 
 #define _LIBCPP_BUILDING_LIBRARY
-#define _LIBCPP_BUILDING_NEW
 #include 
 #include 
 

Modified: libcxxabi/trunk/src/stdlib_new_delete.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/stdlib_new_delete.cpp?rev=338475&r1=338474&r2=338475&view=diff
==
--- libcxxabi/trunk/src/stdlib_new_delete.cpp (original)
+++ libcxxabi/trunk/src/stdlib_new_delete.cpp Tue Jul 31 19:08:59 2018
@@ -9,7 +9,6 @@
 // This file implements the new and delete operators.
 
//===--===//
 
-#define _LIBCPP_BUILDING_NEW
 #define _LIBCPP_BUILDING_LIBRARY
 #include "__cxxabi_config.h"
 #include 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r338475 - [libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since _LIBCPP_BUILDING_LIBRARY

2018-07-31 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Tue Jul 31 19:08:59 2018
New Revision: 338475

URL: http://llvm.org/viewvc/llvm-project?rev=338475&view=rev
Log:
[libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since 
_LIBCPP_BUILDING_LIBRARY

Summary: As suggested by Marshall in https://reviews.llvm.org/D49914

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D50008

Modified:
libcxx/trunk/include/__functional_base
libcxx/trunk/include/__mutex_base
libcxx/trunk/include/functional
libcxx/trunk/include/memory
libcxx/trunk/include/new
libcxx/trunk/include/shared_mutex
libcxx/trunk/include/system_error
libcxx/trunk/include/utility
libcxx/trunk/src/bind.cpp
libcxx/trunk/src/memory.cpp
libcxx/trunk/src/mutex.cpp
libcxx/trunk/src/new.cpp
libcxx/trunk/src/shared_mutex.cpp
libcxx/trunk/src/system_error.cpp
libcxx/trunk/src/utility.cpp

Modified: libcxx/trunk/include/__functional_base
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__functional_base?rev=338475&r1=338474&r2=338475&view=diff
==
--- libcxx/trunk/include/__functional_base (original)
+++ libcxx/trunk/include/__functional_base Tue Jul 31 19:08:59 2018
@@ -561,7 +561,7 @@ struct __is_transparent<_Tp, _Up,
 
 struct _LIBCPP_TEMPLATE_VIS allocator_arg_t { };
 
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_MEMORY)
+#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
 extern const allocator_arg_t allocator_arg;
 #else
 /* _LIBCPP_INLINE_VAR */ constexpr allocator_arg_t allocator_arg = 
allocator_arg_t();

Modified: libcxx/trunk/include/__mutex_base
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__mutex_base?rev=338475&r1=338474&r2=338475&view=diff
==
--- libcxx/trunk/include/__mutex_base (original)
+++ libcxx/trunk/include/__mutex_base Tue Jul 31 19:08:59 2018
@@ -74,7 +74,7 @@ struct _LIBCPP_TYPE_VIS defer_lock_t {};
 struct _LIBCPP_TYPE_VIS try_to_lock_t {};
 struct _LIBCPP_TYPE_VIS adopt_lock_t {};
 
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_MUTEX)
+#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
 
 extern const defer_lock_t  defer_lock;
 extern const try_to_lock_t try_to_lock;

Modified: libcxx/trunk/include/functional
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/functional?rev=338475&r1=338474&r2=338475&view=diff
==
--- libcxx/trunk/include/functional (original)
+++ libcxx/trunk/include/functional Tue Jul 31 19:08:59 2018
@@ -2005,7 +2005,7 @@ namespace placeholders
 
 template  struct __ph {};
 
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_BIND)
+#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
 _LIBCPP_FUNC_VIS extern const __ph<1>   _1;
 _LIBCPP_FUNC_VIS extern const __ph<2>   _2;
 _LIBCPP_FUNC_VIS extern const __ph<3>   _3;
@@ -2027,7 +2027,7 @@ _LIBCPP_FUNC_VIS extern const __ph<10> _
 /* _LIBCPP_INLINE_VAR */ constexpr __ph<8>   _8{};
 /* _LIBCPP_INLINE_VAR */ constexpr __ph<9>   _9{};
 /* _LIBCPP_INLINE_VAR */ constexpr __ph<10> _10{};
-#endif // defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_BIND)
+#endif // defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
 
 }  // placeholders
 

Modified: libcxx/trunk/include/memory
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/memory?rev=338475&r1=338474&r2=338475&view=diff
==
--- libcxx/trunk/include/memory (original)
+++ libcxx/trunk/include/memory Tue Jul 31 19:08:59 2018
@@ -3511,7 +3511,7 @@ public:
 explicit __shared_count(long __refs = 0) _NOEXCEPT
 : __shared_owners_(__refs) {}
 
-#if defined(_LIBCPP_BUILDING_MEMORY) && \
+#if defined(_LIBCPP_BUILDING_LIBRARY) && \
 
defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
 void __add_shared() _NOEXCEPT;
 bool __release_shared() _NOEXCEPT;
@@ -3549,7 +3549,7 @@ protected:
 virtual ~__shared_weak_count();
 
 public:
-#if defined(_LIBCPP_BUILDING_MEMORY) && \
+#if defined(_LIBCPP_BUILDING_LIBRARY) && \
 
defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
 void __add_shared() _NOEXCEPT;
 void __add_weak() _NOEXCEPT;
@@ -5549,7 +5549,7 @@ struct _LIBCPP_TYPE_VIS pointer_safety
 #endif
 
 #if !defined(_LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE) && \
-defined(_LIBCPP_BUILDING_MEMORY)
+defined(_LIBCPP_BUILDING_LIBRARY)
 _LIBCPP_FUNC_VIS pointer_safety get_pointer_safety() _NOEXCEPT;
 #else
 // This function is only offered in C++03 under ABI v1.

Modified: libcxx/trunk/include/new
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/new?r

[libcxx] r338531 - [libc++] Fix GCC 7.2.0 macro redefinition warning

2018-08-01 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Wed Aug  1 06:13:14 2018
New Revision: 338531

URL: http://llvm.org/viewvc/llvm-project?rev=338531&view=rev
Log:
[libc++] Fix GCC 7.2.0 macro redefinition warning

The warning happens when LIBCXX_ENABLE_EXCEPTIONS cmake option is not set,
and it fires every time __config is included, 33 in total.

Patch by Jason Lovett
Reviewed as https://reviews.llvm.org/D49997

Modified:
libcxx/trunk/include/__config

Modified: libcxx/trunk/include/__config
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=338531&r1=338530&r2=338531&view=diff
==
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Wed Aug  1 06:13:14 2018
@@ -510,7 +510,7 @@ namespace std {
 #define _LIBCPP_HAS_IS_BASE_OF
 #endif
 
-#if !__EXCEPTIONS
+#if !__EXCEPTIONS && !defined(_LIBCPP_NO_EXCEPTIONS)
 #define _LIBCPP_NO_EXCEPTIONS
 #endif
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r338933 - [NFC][libc++] Consistently use spaces to indent

2018-08-03 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Fri Aug  3 15:36:53 2018
New Revision: 338933

URL: http://llvm.org/viewvc/llvm-project?rev=338933&view=rev
Log:
[NFC][libc++] Consistently use spaces to indent

rdar://problem/19988944

Modified:
libcxx/trunk/include/__tree
libcxx/trunk/include/any
libcxx/trunk/include/bitset
libcxx/trunk/include/chrono
libcxx/trunk/include/cstddef
libcxx/trunk/include/functional
libcxx/trunk/include/new
libcxx/trunk/include/numeric
libcxx/trunk/include/span
libcxx/trunk/include/sstream
libcxx/trunk/include/stdexcept
libcxx/trunk/include/typeinfo

Modified: libcxx/trunk/include/__tree
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__tree?rev=338933&r1=338932&r2=338933&view=diff
==
--- libcxx/trunk/include/__tree (original)
+++ libcxx/trunk/include/__tree Fri Aug  3 15:36:53 2018
@@ -857,7 +857,7 @@ public:
 __tree_iterator operator--(int)
 {__tree_iterator __t(*this); --(*this); return __t;}
 
-friend _LIBCPP_INLINE_VISIBILITY 
+friend _LIBCPP_INLINE_VISIBILITY
 bool operator==(const __tree_iterator& __x, const __tree_iterator& __y)
 {return __x.__ptr_ == __y.__ptr_;}
 friend _LIBCPP_INLINE_VISIBILITY
@@ -1488,7 +1488,7 @@ private:
 void __copy_assign_alloc(const __tree& __t, true_type)
 {
 if (__node_alloc() != __t.__node_alloc())
-   clear();
+clear();
 __node_alloc() = __t.__node_alloc();
 }
 _LIBCPP_INLINE_VISIBILITY
@@ -1830,7 +1830,7 @@ __tree<_Tp, _Compare, _Allocator>::opera
 __node_traits::propagate_on_container_move_assignment::value &&
 is_nothrow_move_assignable::value &&
 is_nothrow_move_assignable<__node_allocator>::value)
-
+
 {
 __move_assign(__t, integral_constant());

Modified: libcxx/trunk/include/any
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/any?rev=338933&r1=338932&r2=338933&view=diff
==
--- libcxx/trunk/include/any (original)
+++ libcxx/trunk/include/any Fri Aug  3 15:36:53 2018
@@ -110,7 +110,7 @@ void __throw_bad_any_cast()
 #ifndef _LIBCPP_NO_EXCEPTIONS
 throw bad_any_cast();
 #else
-   _VSTD::abort();
+_VSTD::abort();
 #endif
 }
 

Modified: libcxx/trunk/include/bitset
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/bitset?rev=338933&r1=338932&r2=338933&view=diff
==
--- libcxx/trunk/include/bitset (original)
+++ libcxx/trunk/include/bitset Fri Aug  3 15:36:53 2018
@@ -238,9 +238,9 @@ __bitset<_N_words, _Size>::__init(unsign
 size_t __sz = _Size;
 for (size_t __i = 0; __i < sizeof(__t)/sizeof(__t[0]); ++__i, __v >>= 
__bits_per_word, __sz -= __bits_per_word )
 if ( __sz < __bits_per_word)
-   __t[__i] = static_cast<__storage_type>(__v) & ( 1ULL << __sz ) 
- 1;
+__t[__i] = static_cast<__storage_type>(__v) & ( 1ULL << __sz ) - 1;
 else
-   __t[__i] = static_cast<__storage_type>(__v);
+__t[__i] = static_cast<__storage_type>(__v);
 
 _VSTD::copy(__t, __t + sizeof(__t)/sizeof(__t[0]), __first_);
 _VSTD::fill(__first_ + sizeof(__t)/sizeof(__t[0]), __first_ + 
sizeof(__first_)/sizeof(__first_[0]),
@@ -254,7 +254,7 @@ __bitset<_N_words, _Size>::__init(unsign
 {
 __first_[0] = __v;
 if (_Size < __bits_per_word)
-   __first_[0] &= ( 1ULL << _Size ) - 1;
+__first_[0] &= ( 1ULL << _Size ) - 1;
 
 _VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), 
__storage_type(0));
 }
@@ -269,9 +269,9 @@ __bitset<_N_words, _Size>::__bitset(unsi
 #if __SIZEOF_SIZE_T__ == 8
 : __first_{__v}
 #elif __SIZEOF_SIZE_T__ == 4
-: __first_{static_cast<__storage_type>(__v), 
-   _Size >= 2 * __bits_per_word ? 
static_cast<__storage_type>(__v >> __bits_per_word)
-   : static_cast<__storage_type>((__v >> __bits_per_word) 
& (__storage_type(1) << (_Size - __bits_per_word)) - 1)}
+: __first_{static_cast<__storage_type>(__v),
+_Size >= 2 * __bits_per_word ? static_cast<__storage_type>(__v 
>> __bits_per_word)
+: static_cast<__storage_type>((__v >> __bits_per_word) & 
(__storage_type(1) << (_Size - __bits_per_word)) - 1)}
 #else
 #error This constructor has not been ported to this platform
 #endif

Modified: libcxx/trunk/include/chrono
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/chrono?rev=338933&r1=338932&r2=338933&view=diff
==
--- libcxx/trunk/include/chrono (original)
+++ libcxx/trunk/include/chrono Fri Aug  3 15:36:53 2018
@@ -323,7 +323,7 @@ struct clock_time_conversion;
 
 template
   auto clock_cast(const time_point& t);
-  
+
 // 25.8.2, c

[libcxx] r339012 - [libc++] Add the _LIBCPP_HIDE_FROM_ABI_AFTER_V1 macro

2018-08-06 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Mon Aug  6 07:11:50 2018
New Revision: 339012

URL: http://llvm.org/viewvc/llvm-project?rev=339012&view=rev
Log:
[libc++] Add the _LIBCPP_HIDE_FROM_ABI_AFTER_V1 macro

Summary:
This macro allows hiding symbols from the ABI when the library is built
with an ABI version after ABI v1, which is currently the only stable ABI.
This commit defines `_LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY` to be
`_LIBCPP_HIDE_FROM_ABI_AFTER_V1`, meaning that symbols that were only
exported by the library for historical reasons are not exported anymore
in the unstable ABI.

Because of that, this commit is an ABI break for ABI v2. This ABI version
is not stable, however, so this should not be a problem.

Reviewers: EricWF, mclow.lists

Subscribers: christof, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D49914

Modified:
libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
libcxx/trunk/include/__config
libcxx/trunk/lib/abi/x86_64-apple-darwin.v2.abilist

Modified: libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst?rev=339012&r1=339011&r2=339012&view=diff
==
--- libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst (original)
+++ libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst Mon Aug  6 07:11:50 2018
@@ -46,6 +46,21 @@ Visibility Macros
   other words, the address of a function marked with this attribute is not
   guaranteed to be the same across translation units.
 
+**_LIBCPP_HIDE_FROM_ABI_AFTER_V1**
+  Mark a function as being hidden from the ABI (per `_LIBCPP_HIDE_FROM_ABI`)
+  when libc++ is built with an ABI version after ABI v1. This macro is used to
+  maintain ABI compatibility for symbols that have been historically exported
+  by libc++ in v1 of the ABI, but that we don't want to export in the future.
+
+  This macro works as follows. When we build libc++, we either hide the symbol
+  from the ABI (if the symbol is not part of the ABI in the version we're
+  building), or we leave it included. From user code (i.e. when we're not
+  building libc++), the macro always marks symbols as internal so that programs
+  built using new libc++ headers stop relying on symbols that are removed from
+  the ABI in a future version. Each time we release a new stable version of the
+  ABI, we should create a new _LIBCPP_HIDE_FROM_ABI_AFTER_XXX macro, and we can
+  use it to start removing symbols from the ABI after that stable version.
+
 **_LIBCPP_TYPE_VIS**
   Mark a type's typeinfo, vtable and members as having default visibility.
   This attribute cannot be used on class templates.
@@ -139,15 +154,6 @@ Visibility Macros
   against the libc++ headers after making `_LIBCPP_TYPE_VIS` and
   `_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS` expand to default visibility.
 
-**_LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY**
-  Mark a member function of a class template as visible and always inline. This
-  macro should only be applied to member functions of class templates that are
-  externally instantiated. It is important that these symbols are not marked
-  as hidden as that will prevent the dylib definition from being found.
-
-  This macro is used to maintain ABI compatibility for symbols that have been
-  historically exported by the libc++ library but are now marked inline.
-
 **_LIBCPP_EXCEPTION_ABI**
   Mark the member functions, typeinfo, and vtable of the type as being exported
   by the libc++ library. This macro must be applied to all *exception types*.

Modified: libcxx/trunk/include/__config
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=339012&r1=339011&r2=339012&view=diff
==
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Mon Aug  6 07:11:50 2018
@@ -706,12 +706,6 @@ namespace std {
 #define _LIBCPP_TEMPLATE_VIS
 #define _LIBCPP_ENUM_VIS
 
-#if defined(_LIBCPP_COMPILER_MSVC)
-#  define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __forceinline
-#else
-#  define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__ 
((__always_inline__))
-#endif
-
 #endif // defined(_LIBCPP_OBJECT_FORMAT_COFF)
 
 #ifndef _LIBCPP_HIDDEN
@@ -805,17 +799,20 @@ namespace std {
 #  define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_INTERNAL_LINKAGE
 #endif
 
-// Just so we can migrate to _LIBCPP_HIDE_FROM_ABI gradually.
-#define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
-
-#ifndef _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
-#  if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
-#define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY 
__attribute__((__visibility__("default"), __always_inline__))
+#ifdef _LIBCPP_BUILDING_LIBRARY
+#  if _LIBCPP_ABI_VERSION > 1
+#define _LIBCPP_HIDE_FROM_ABI_AFTER_V1 _LIBCPP_HIDE_FROM_ABI
 #  else
-#define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY 
__attribute__((__al

r344146 - [clang] Properly apply attributes on explicit instantiations of static data members

2018-10-10 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Wed Oct 10 08:32:29 2018
New Revision: 344146

URL: http://llvm.org/viewvc/llvm-project?rev=344146&view=rev
Log:
[clang] Properly apply attributes on explicit instantiations of static data 
members

Summary: https://llvm.org/PR39118

Reviewers: aaron.ballman, rnk

Subscribers: dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D52675

Added:
cfe/trunk/test/SemaCXX/attr-on-explicit-template-instantiation.cpp
Modified:
cfe/trunk/lib/Sema/SemaTemplate.cpp

Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=344146&r1=344145&r2=344146&view=diff
==
--- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp Wed Oct 10 08:32:29 2018
@@ -9173,10 +9173,8 @@ DeclResult Sema::ActOnExplicitInstantiat
 if (!HasNoEffect) {
   // Instantiate static data member or variable template.
   Prev->setTemplateSpecializationKind(TSK, D.getIdentifierLoc());
-  if (PrevTemplate) {
-// Merge attributes.
-ProcessDeclAttributeList(S, Prev, D.getDeclSpec().getAttributes());
-  }
+  // Merge attributes.
+  ProcessDeclAttributeList(S, Prev, D.getDeclSpec().getAttributes());
   if (TSK == TSK_ExplicitInstantiationDefinition)
 InstantiateVariableDefinition(D.getIdentifierLoc(), Prev);
 }

Added: cfe/trunk/test/SemaCXX/attr-on-explicit-template-instantiation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-on-explicit-template-instantiation.cpp?rev=344146&view=auto
==
--- cfe/trunk/test/SemaCXX/attr-on-explicit-template-instantiation.cpp (added)
+++ cfe/trunk/test/SemaCXX/attr-on-explicit-template-instantiation.cpp Wed Oct 
10 08:32:29 2018
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+
+// PR39118
+// Make sure that attributes are properly applied to explicit template
+// instantiations.
+
+#define HIDDEN __attribute__((__visibility__("hidden")))
+#define VISIBLE __attribute__((__visibility__("default")))
+
+namespace ns HIDDEN {
+struct A { };
+template  struct B { static A a; };
+template  A B::a;
+
+// CHECK: @_ZN2ns1BIiE1aE = weak_odr global
+// CHECK-NOT: hidden
+template VISIBLE A B::a;
+}
+
+struct C { };
+template  struct D { static C c; };
+template  C D::c;
+
+// CHECK-DAG: @_ZN1DIiE1cB3TAGE
+template __attribute__((abi_tag("TAG"))) C D::c;


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r344159 - [clang] Fix failing attribute test on Windows

2018-10-10 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Wed Oct 10 10:37:37 2018
New Revision: 344159

URL: http://llvm.org/viewvc/llvm-project?rev=344159&view=rev
Log:
[clang] Fix failing attribute test on Windows

The test added in r344146 was failing because the ABI on Windows is
different, and that test includes ABI-specific details. The test now
harcodes which ABI to use so we can rely on those details.

Modified:
cfe/trunk/test/SemaCXX/attr-on-explicit-template-instantiation.cpp

Modified: cfe/trunk/test/SemaCXX/attr-on-explicit-template-instantiation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-on-explicit-template-instantiation.cpp?rev=344159&r1=344158&r2=344159&view=diff
==
--- cfe/trunk/test/SemaCXX/attr-on-explicit-template-instantiation.cpp 
(original)
+++ cfe/trunk/test/SemaCXX/attr-on-explicit-template-instantiation.cpp Wed Oct 
10 10:37:37 2018
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o - | 
FileCheck %s
 
 // PR39118
 // Make sure that attributes are properly applied to explicit template


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r355927 - [CMake] Tell libc++ that we're using compiler-rt on Apple platforms

2019-03-12 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Tue Mar 12 08:32:00 2019
New Revision: 355927

URL: http://llvm.org/viewvc/llvm-project?rev=355927&view=rev
Log:
[CMake] Tell libc++ that we're using compiler-rt on Apple platforms

Reviewers: beanz, arphaman, EricWF

Subscribers: dberris, mgorny, jkorous, dexonsmith, jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D58921

Modified:
cfe/trunk/cmake/caches/Apple-stage2.cmake

Modified: cfe/trunk/cmake/caches/Apple-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Apple-stage2.cmake?rev=355927&r1=355926&r2=355927&view=diff
==
--- cfe/trunk/cmake/caches/Apple-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Apple-stage2.cmake Tue Mar 12 08:32:00 2019
@@ -38,6 +38,7 @@ set(CMAKE_BUILD_TYPE RelWithDebInfo CACH
 set(LIBCXX_INSTALL_LIBRARY OFF CACHE BOOL "")
 set(LIBCXX_INSTALL_HEADERS ON CACHE BOOL "")
 set(LIBCXX_INCLUDE_TESTS OFF CACHE BOOL "")
+set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
 set(LLVM_LTO_VERSION_OFFSET 3000 CACHE STRING "")
 
 # Generating Xcode toolchains is useful for developers wanting to build and use


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r358191 - [NFC] Correct outdated links to the Itanium C++ ABI documentation

2019-04-11 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Thu Apr 11 09:37:07 2019
New Revision: 358191

URL: http://llvm.org/viewvc/llvm-project?rev=358191&view=rev
Log:
[NFC] Correct outdated links to the Itanium C++ ABI documentation

Those are now hosted on GitHub.

rdar://problem/36557462

Modified:
libunwind/trunk/include/unwind.h
libunwind/trunk/src/UnwindLevel1.c

Modified: libunwind/trunk/include/unwind.h
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/include/unwind.h?rev=358191&r1=358190&r2=358191&view=diff
==
--- libunwind/trunk/include/unwind.h (original)
+++ libunwind/trunk/include/unwind.h Thu Apr 11 09:37:07 2019
@@ -6,7 +6,7 @@
 //
 //
 // C++ ABI Level 1 ABI documented at:
-//   http://mentorembedded.github.io/cxx-abi/abi-eh.html
+//   https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html
 //
 
//===--===//
 

Modified: libunwind/trunk/src/UnwindLevel1.c
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/UnwindLevel1.c?rev=358191&r1=358190&r2=358191&view=diff
==
--- libunwind/trunk/src/UnwindLevel1.c (original)
+++ libunwind/trunk/src/UnwindLevel1.c Thu Apr 11 09:37:07 2019
@@ -6,7 +6,7 @@
 //
 //
 // Implements C++ ABI Exception Handling Level 1 as documented at:
-//  http://mentorembedded.github.io/cxx-abi/abi-eh.html
+//  https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html
 // using libunwind
 //
 
//===--===//


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r358409 - [clang] Aligned allocation is actually supported in macosx 10.13

2019-04-15 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Mon Apr 15 07:14:45 2019
New Revision: 358409

URL: http://llvm.org/viewvc/llvm-project?rev=358409&view=rev
Log:
[clang] Aligned allocation is actually supported in macosx 10.13

Summary:
In r350649, I changed aligned allocation from being available starting
in macosx10.13 to macosx10.14. However, aligned allocation is indeed
available starting with macosx10.13, my investigation had been based
on the wrong libc++abi dylib.

This means that Clang before the fix will be more stringent when it
comes to aligned allocation -- it will not allow it when back-deploying
to macosx 10.13, when it would actually be safe to do so.

Note that a companion change will be coming to fix the libc++ tests.

Reviewers: ahatanak

Subscribers: jkorous, dexonsmith, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D60626

Modified:
cfe/trunk/include/clang/Basic/AlignedAllocation.h
cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp
cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp

Modified: cfe/trunk/include/clang/Basic/AlignedAllocation.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AlignedAllocation.h?rev=358409&r1=358408&r2=358409&view=diff
==
--- cfe/trunk/include/clang/Basic/AlignedAllocation.h (original)
+++ cfe/trunk/include/clang/Basic/AlignedAllocation.h Mon Apr 15 07:14:45 2019
@@ -26,8 +26,8 @@ inline llvm::VersionTuple alignedAllocMi
   default:
 break;
   case llvm::Triple::Darwin:
-  case llvm::Triple::MacOSX: // Earliest supporting version is 10.14.
-return llvm::VersionTuple(10U, 14U);
+  case llvm::Triple::MacOSX: // Earliest supporting version is 10.13.
+return llvm::VersionTuple(10U, 13U);
   case llvm::Triple::IOS:
   case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0.
 return llvm::VersionTuple(11U);

Modified: cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp?rev=358409&r1=358408&r2=358409&view=diff
==
--- cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp (original)
+++ cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp Mon Apr 15 
07:14:45 2019
@@ -1,4 +1,4 @@
-// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.12 -c -### %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=UNAVAILABLE
 //
 // RUN: %clang -target arm64-apple-ios10 -c -### %s 2>&1 \
@@ -24,7 +24,7 @@
 //
 // UNAVAILABLE: "-faligned-alloc-unavailable"
 
-// RUN: %clang -target x86_64-apple-macosx10.14 -c -### %s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=AVAILABLE
 //
 // RUN: %clang -target arm64-apple-ios11 -c -### %s 2>&1 \
@@ -54,10 +54,10 @@
 // Check that passing -faligned-allocation or -fno-aligned-allocation stops the
 // driver from passing -faligned-alloc-unavailable to cc1.
 //
-// RUN: %clang -target x86_64-apple-macosx10.13 -faligned-allocation -c -### 
%s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.12 -faligned-allocation -c -### 
%s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=AVAILABLE
 //
-// RUN: %clang -target x86_64-apple-macosx10.13 -fno-aligned-allocation -c 
-### %s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.12 -fno-aligned-allocation -c 
-### %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=AVAILABLE
 
 // AVAILABLE-NOT: "-faligned-alloc-unavailable"

Modified: cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp?rev=358409&r1=358408&r2=358409&view=diff
==
--- cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp (original)
+++ cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp Mon Apr 15 
07:14:45 2019
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions 
-faligned-alloc-unavailable -std=c++1z -verify %s
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions -std=c++1z 
-verify -DNO_ERRORS %s
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions 
-faligned-allocation -faligned-alloc-unavailable -std=c++14 -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions 
-faligned-alloc-unavailable -std=c++1z -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -std=c++1z 
-verify -DNO_ERRORS %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions 
-faligned-allocation -faligned-alloc-unavailable -std=c++14 -verify %s
 // RUN: %clang_cc1 -triple arm64-apple-ios10.0.0 -fexceptions 
-faligned-alloc-unavailable -std=c++1z -verify -DIOS %s
 // RUN: %clang_cc1 -triple arm64-apple-io

r358437 - Revert "[clang] Aligned allocation is actually supported in macosx 10.13"

2019-04-15 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Mon Apr 15 12:08:52 2019
New Revision: 358437

URL: http://llvm.org/viewvc/llvm-project?rev=358437&view=rev
Log:
Revert "[clang] Aligned allocation is actually supported in macosx 10.13"

This reverts r358409, which I think broke the bots in compiler-rt.
Since I'm having trouble reproducing the failure, I'm reverting this
until I can investigate locally.

Modified:
cfe/trunk/include/clang/Basic/AlignedAllocation.h
cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp
cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp

Modified: cfe/trunk/include/clang/Basic/AlignedAllocation.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AlignedAllocation.h?rev=358437&r1=358436&r2=358437&view=diff
==
--- cfe/trunk/include/clang/Basic/AlignedAllocation.h (original)
+++ cfe/trunk/include/clang/Basic/AlignedAllocation.h Mon Apr 15 12:08:52 2019
@@ -26,8 +26,8 @@ inline llvm::VersionTuple alignedAllocMi
   default:
 break;
   case llvm::Triple::Darwin:
-  case llvm::Triple::MacOSX: // Earliest supporting version is 10.13.
-return llvm::VersionTuple(10U, 13U);
+  case llvm::Triple::MacOSX: // Earliest supporting version is 10.14.
+return llvm::VersionTuple(10U, 14U);
   case llvm::Triple::IOS:
   case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0.
 return llvm::VersionTuple(11U);

Modified: cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp?rev=358437&r1=358436&r2=358437&view=diff
==
--- cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp (original)
+++ cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp Mon Apr 15 
12:08:52 2019
@@ -1,4 +1,4 @@
-// RUN: %clang -target x86_64-apple-macosx10.12 -c -### %s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=UNAVAILABLE
 //
 // RUN: %clang -target arm64-apple-ios10 -c -### %s 2>&1 \
@@ -24,7 +24,7 @@
 //
 // UNAVAILABLE: "-faligned-alloc-unavailable"
 
-// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.14 -c -### %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=AVAILABLE
 //
 // RUN: %clang -target arm64-apple-ios11 -c -### %s 2>&1 \
@@ -54,10 +54,10 @@
 // Check that passing -faligned-allocation or -fno-aligned-allocation stops the
 // driver from passing -faligned-alloc-unavailable to cc1.
 //
-// RUN: %clang -target x86_64-apple-macosx10.12 -faligned-allocation -c -### 
%s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.13 -faligned-allocation -c -### 
%s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=AVAILABLE
 //
-// RUN: %clang -target x86_64-apple-macosx10.12 -fno-aligned-allocation -c 
-### %s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.13 -fno-aligned-allocation -c 
-### %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=AVAILABLE
 
 // AVAILABLE-NOT: "-faligned-alloc-unavailable"

Modified: cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp?rev=358437&r1=358436&r2=358437&view=diff
==
--- cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp (original)
+++ cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp Mon Apr 15 
12:08:52 2019
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions 
-faligned-alloc-unavailable -std=c++1z -verify %s
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -std=c++1z 
-verify -DNO_ERRORS %s
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions 
-faligned-allocation -faligned-alloc-unavailable -std=c++14 -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions 
-faligned-alloc-unavailable -std=c++1z -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions -std=c++1z 
-verify -DNO_ERRORS %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions 
-faligned-allocation -faligned-alloc-unavailable -std=c++14 -verify %s
 // RUN: %clang_cc1 -triple arm64-apple-ios10.0.0 -fexceptions 
-faligned-alloc-unavailable -std=c++1z -verify -DIOS %s
 // RUN: %clang_cc1 -triple arm64-apple-ios10.0.0 -fexceptions -std=c++1z 
-verify -DNO_ERRORS %s
 // RUN: %clang_cc1 -triple arm64-apple-tvos10.0.0 -fexceptions 
-faligned-alloc-unavailable -std=c++1z -verify -DTVOS %s
@@ -117,8 +117,8 @@ void testOveralignedCheckOS() {
 // expected-error@-13 {{aligned allocation function of type 'void *(unsigned 
long, enum std::align_val_t)' is only available on watchOS 4 or newer}}}
 // expected-error@-14 {{aligned deallocation function of type 'void (void *, 
enum std::align_

r358582 - Explicitly say we don't define new/delete in libc++ during Apple stage1 bootstrap

2019-04-17 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Wed Apr 17 07:58:59 2019
New Revision: 358582

URL: http://llvm.org/viewvc/llvm-project?rev=358582&view=rev
Log:
Explicitly say we don't define new/delete in libc++ during Apple stage1 
bootstrap

This is not necessary in stage2 because we don't even build libc++.dylib
there.

Modified:
cfe/trunk/cmake/caches/Apple-stage1.cmake

Modified: cfe/trunk/cmake/caches/Apple-stage1.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Apple-stage1.cmake?rev=358582&r1=358581&r2=358582&view=diff
==
--- cfe/trunk/cmake/caches/Apple-stage1.cmake (original)
+++ cfe/trunk/cmake/caches/Apple-stage1.cmake Wed Apr 17 07:58:59 2019
@@ -33,6 +33,9 @@ set(COMPILER_RT_ENABLE_TVOS OFF CACHE BO
 set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")
 set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
 
+set(LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
+set(LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS ON CACHE BOOL "")
+
 set(CLANG_BOOTSTRAP_TARGETS
   generate-order-file
   check-all


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r358896 - [NFC] Fix typo in debug log

2019-04-22 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Mon Apr 22 08:40:50 2019
New Revision: 358896

URL: http://llvm.org/viewvc/llvm-project?rev=358896&view=rev
Log:
[NFC] Fix typo in debug log

Modified:
libunwind/trunk/src/UnwindCursor.hpp

Modified: libunwind/trunk/src/UnwindCursor.hpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/UnwindCursor.hpp?rev=358896&r1=358895&r2=358896&view=diff
==
--- libunwind/trunk/src/UnwindCursor.hpp (original)
+++ libunwind/trunk/src/UnwindCursor.hpp Mon Apr 22 08:40:50 2019
@@ -1740,7 +1740,7 @@ bool UnwindCursor::getInfoFromComp
 --personalityIndex; // change 1-based to zero-based index
 if (personalityIndex > sectionHeader.personalityArrayCount()) {
   _LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with personality index %d,  "
-"but personality table has only %d entires",
+"but personality table has only %d entries",
 encoding, personalityIndex,
 sectionHeader.personalityArrayCount());
   return false;


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r342811 - [libunwind][NFC] Suppress unused parameter warnings

2018-09-22 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Sat Sep 22 11:18:34 2018
New Revision: 342811

URL: http://llvm.org/viewvc/llvm-project?rev=342811&view=rev
Log:
[libunwind][NFC] Suppress unused parameter warnings

Reviewers: EricWF

Subscribers: christof, chrib, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D52393

Modified:
libunwind/trunk/src/Registers.hpp

Modified: libunwind/trunk/src/Registers.hpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Registers.hpp?rev=342811&r1=342810&r2=342811&view=diff
==
--- libunwind/trunk/src/Registers.hpp (original)
+++ libunwind/trunk/src/Registers.hpp Sat Sep 22 11:18:34 2018
@@ -517,6 +517,7 @@ inline bool Registers_x86_64::validVecto
 return false;
   return true;
 #else
+  (void)regNum; // suppress unused parameter warning
   return false;
 #endif
 }
@@ -526,6 +527,7 @@ inline v128 Registers_x86_64::getVectorR
   assert(validVectorRegister(regNum));
   return _xmm[regNum - UNW_X86_64_XMM0];
 #else
+  (void)regNum; // suppress unused parameter warning
   _LIBUNWIND_ABORT("no x86_64 vector registers");
 #endif
 }
@@ -535,6 +537,7 @@ inline void Registers_x86_64::setVectorR
   assert(validVectorRegister(regNum));
   _xmm[regNum - UNW_X86_64_XMM0] = value;
 #else
+  (void)regNum; (void)value; // suppress unused parameter warnings
   _LIBUNWIND_ABORT("no x86_64 vector registers");
 #endif
 }
@@ -2149,7 +2152,7 @@ inline Registers_arm::Registers_arm()
   memset(&_vfp_d16_d31, 0, sizeof(_vfp_d16_d31));
 #if defined(__ARM_WMMX)
   _saved_iwmmx = false;
-  _saved_iwmmx_control = false;  
+  _saved_iwmmx_control = false;
   memset(&_iwmmx, 0, sizeof(_iwmmx));
   memset(&_iwmmx_control, 0, sizeof(_iwmmx_control));
 #endif


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r343790 - [clang] Add the exclude_from_explicit_instantiation attribute

2018-10-04 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Thu Oct  4 08:49:42 2018
New Revision: 343790

URL: http://llvm.org/viewvc/llvm-project?rev=343790&view=rev
Log:
[clang] Add the exclude_from_explicit_instantiation attribute

Summary:
This attribute allows excluding a member of a class template from being part
of an explicit template instantiation of that class template. This also makes
sure that code using such a member will not take for granted that an external
instantiation exists in another translation unit. The attribute was discussed
on cfe-dev at [1] and is primarily motivated by the removal of always_inline
in libc++ to control what's part of the ABI (see links in [1]).

[1]: http://lists.llvm.org/pipermail/cfe-dev/2018-August/059024.html

rdar://problem/43428125

Reviewers: rsmith

Subscribers: dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D51789

Added:

cfe/trunk/test/CodeGenCXX/attr-exclude_from_explicit_instantiation.dont_assume_extern_instantiation.cpp

cfe/trunk/test/SemaCXX/attr-exclude_from_explicit_instantiation.diagnose_on_undefined_entity.cpp

cfe/trunk/test/SemaCXX/attr-exclude_from_explicit_instantiation.explicit_instantiation.cpp

cfe/trunk/test/SemaCXX/attr-exclude_from_explicit_instantiation.extern_declaration.cpp

cfe/trunk/test/SemaCXX/attr-exclude_from_explicit_instantiation.merge_redeclarations.cpp
Modified:
cfe/trunk/include/clang/Basic/Attr.td
cfe/trunk/include/clang/Basic/AttrDocs.td
cfe/trunk/lib/Sema/Sema.cpp
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
cfe/trunk/test/Misc/pragma-attribute-supported-attributes-list.test

Modified: cfe/trunk/include/clang/Basic/Attr.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=343790&r1=343789&r2=343790&view=diff
==
--- cfe/trunk/include/clang/Basic/Attr.td (original)
+++ cfe/trunk/include/clang/Basic/Attr.td Thu Oct  4 08:49:42 2018
@@ -3042,6 +3042,13 @@ def InternalLinkage : InheritableAttr {
   let Documentation = [InternalLinkageDocs];
 }
 
+def ExcludeFromExplicitInstantiation : InheritableAttr {
+  let Spellings = [Clang<"exclude_from_explicit_instantiation">];
+  let Subjects = SubjectList<[Var, Function, CXXRecord]>;
+  let Documentation = [ExcludeFromExplicitInstantiationDocs];
+  let MeaningfulToClassTemplateDefinition = 1;
+}
+
 def Reinitializes : InheritableAttr {
   let Spellings = [Clang<"reinitializes", 0>];
   let Subjects = SubjectList<[NonStaticNonConstCXXMethod], ErrorDiag>;

Modified: cfe/trunk/include/clang/Basic/AttrDocs.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=343790&r1=343789&r2=343790&view=diff
==
--- cfe/trunk/include/clang/Basic/AttrDocs.td (original)
+++ cfe/trunk/include/clang/Basic/AttrDocs.td Thu Oct  4 08:49:42 2018
@@ -2975,6 +2975,68 @@ This can be used to contain the ABI of a
   }];
 }
 
+def ExcludeFromExplicitInstantiationDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+The ``exclude_from_explicit_instantiation`` attribute opts-out a member of a
+class template from being part of explicit template instantiations of that
+class template. This means that an explicit instantiation will not instantiate
+members of the class template marked with the attribute, but also that code
+where an extern template declaration of the enclosing class template is visible
+will not take for granted that an external instantiation of the class template
+would provide those members (which would otherwise be a link error, since the
+explicit instantiation won't provide those members). For example, let's say we
+don't want the ``data()`` method to be part of libc++'s ABI. To make sure it
+is not exported from the dylib, we give it hidden visibility:
+
+  .. code-block:: c++
+
+// in 
+template 
+class basic_string {
+public:
+  __attribute__((__visibility__("hidden")))
+  const value_type* data() const noexcept { ... }
+};
+
+template class basic_string;
+
+Since an explicit template instantiation declaration for ``basic_string``
+is provided, the compiler is free to assume that ``basic_string::data()``
+will be provided by another translation unit, and it is free to produce an
+external call to this function. However, since ``data()`` has hidden visibility
+and the explicit template instantiation is provided in a shared library (as
+opposed to simply another translation unit), ``basic_string::data()``
+won't be found and a link error will ensue. This happens because the compiler
+assumes that ``basic_string::data()`` is part of the explicit template
+instantiation declaration, when it really isn't. To tell the compiler that
+``data()`` is not part of the explicit template instantiation declaration, the
+``exclude_from_explicit_instantiation`` att

Re: r343790 - [clang] Add the exclude_from_explicit_instantiation attribute

2018-10-05 Thread Louis Dionne via cfe-commits
I just saw this. Simon Pilgrim already fixed it in r343846. Thanks Simon!

Louis

> On Oct 4, 2018, at 22:02, Galina Kistanova  wrote:
> 
> Hello Louis,
> 
> This commit broke build step on one of our builders:
> http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/13042
>  
> <http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/13042>
> 
> . . .
> FAILED: tools/clang/lib/Sema/CMakeFiles/clangSema.dir/SemaExprCXX.cpp.obj 
> C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe  /nologo /TP -DEXPENSIVE_CHECKS 
> -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE 
> -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE 
> -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_DEBUG -D_GNU_SOURCE -D_HAS_EXCEPTIONS=0 
> -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE 
> -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
> -Itools\clang\lib\Sema 
> -IC:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\Sema
>  
> -IC:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\include
>  -Itools\clang\include -Iinclude 
> -IC:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\include 
> /DWIN32 /D_WINDOWS   /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4 
> -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 
> -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 
> -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 
> -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 
> -wd4592 -wd4319 -wd4324 -w14062 -we4238 /MDd /Zi /Ob0 /Od /RTC1/EHs-c- 
> /GR- /showIncludes 
> /Fotools\clang\lib\Sema\CMakeFiles\clangSema.dir\SemaExprCXX.cpp.obj 
> /Fdtools\clang\lib\Sema\CMakeFiles\clangSema.dir\clangSema.pdb /FS -c 
> C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\Sema\SemaExprCXX.cpp
> C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\Sema\SemaExprCXX.cpp
>  : fatal error C1128: number of sections exceeded object file format limit: 
> compile with /bigobj
> 
> 
> Please have a look?
> The builder was already red and did not send notifications on this.
> 
> Thanks
> 
> Galina
> 
> On Thu, Oct 4, 2018 at 8:51 AM Louis Dionne via cfe-commits 
> mailto:cfe-commits@lists.llvm.org>> wrote:
> Author: ldionne
> Date: Thu Oct  4 08:49:42 2018
> New Revision: 343790
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=343790&view=rev 
> <http://llvm.org/viewvc/llvm-project?rev=343790&view=rev>
> Log:
> [clang] Add the exclude_from_explicit_instantiation attribute
> 
> Summary:
> This attribute allows excluding a member of a class template from being part
> of an explicit template instantiation of that class template. This also makes
> sure that code using such a member will not take for granted that an external
> instantiation exists in another translation unit. The attribute was discussed
> on cfe-dev at [1] and is primarily motivated by the removal of always_inline
> in libc++ to control what's part of the ABI (see links in [1]).
> 
> [1]: http://lists.llvm.org/pipermail/cfe-dev/2018-August/059024.html 
> <http://lists.llvm.org/pipermail/cfe-dev/2018-August/059024.html>
> 
> rdar://problem/43428125
> 
> Reviewers: rsmith
> 
> Subscribers: dexonsmith, cfe-commits
> 
> Differential Revision: https://reviews.llvm.org/D51789 
> <https://reviews.llvm.org/D51789>
> 
> Added:
> 
> cfe/trunk/test/CodeGenCXX/attr-exclude_from_explicit_instantiation.dont_assume_extern_instantiation.cpp
> 
> cfe/trunk/test/SemaCXX/attr-exclude_from_explicit_instantiation.diagnose_on_undefined_entity.cpp
> 
> cfe/trunk/test/SemaCXX/attr-exclude_from_explicit_instantiation.explicit_instantiation.cpp
> 
> cfe/trunk/test/SemaCXX/attr-exclude_from_explicit_instantiation.extern_declaration.cpp
> 
> cfe/trunk/test/SemaCXX/attr-exclude_from_explicit_instantiation.merge_redeclarations.cpp
> Modified:
> cfe/trunk/include/clang/Basic/Attr.td
> cfe/trunk/include/clang/Basic/AttrDocs.td
> cfe/trunk/lib/Sema/Sema.cpp
> cfe/trunk/lib/Sema/SemaDeclAttr.cpp
> cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
> cfe/trunk/test/Misc/pragma-attribute-supported-attributes-list.test
> 
> Modified: cfe/trunk/include/clang/Basic/Attr.td
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=343790&r1=343789&r2=343790&view=diff
>  
> <http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=343790&r1=343789&r2=343790&view=diff>
> ==

r353970 - [clang] Make sure C99/C11 features in are provided in C++11

2019-02-13 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Wed Feb 13 11:08:01 2019
New Revision: 353970

URL: http://llvm.org/viewvc/llvm-project?rev=353970&view=rev
Log:
[clang] Make sure C99/C11 features in  are provided in C++11

Summary:
Previously, those #defines were only provided in C or when GNU extensions were
enabled. We need those #defines in C++11 and above, too.

Reviewers: jfb, eli.friedman

Subscribers: jkorous, dexonsmith, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D58149

Modified:
cfe/trunk/lib/Headers/float.h
cfe/trunk/test/Headers/float.c

Modified: cfe/trunk/lib/Headers/float.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/float.h?rev=353970&r1=353969&r2=353970&view=diff
==
--- cfe/trunk/lib/Headers/float.h (original)
+++ cfe/trunk/lib/Headers/float.h Wed Feb 13 11:08:01 2019
@@ -51,7 +51,7 @@
 #  undef FLT_MANT_DIG
 #  undef DBL_MANT_DIG
 #  undef LDBL_MANT_DIG
-#  if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__)
+#  if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__) || __cplusplus 
>= 201103L
 #undef DECIMAL_DIG
 #  endif
 #  undef FLT_DIG
@@ -78,7 +78,7 @@
 #  undef FLT_MIN
 #  undef DBL_MIN
 #  undef LDBL_MIN
-#  if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__)
+#  if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus 
>= 201103L
 #undef FLT_TRUE_MIN
 #undef DBL_TRUE_MIN
 #undef LDBL_TRUE_MIN
@@ -101,7 +101,7 @@
 #define DBL_MANT_DIG __DBL_MANT_DIG__
 #define LDBL_MANT_DIG __LDBL_MANT_DIG__
 
-#if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__)
+#if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__) || __cplusplus >= 
201103L
 #  define DECIMAL_DIG __DECIMAL_DIG__
 #endif
 
@@ -137,7 +137,7 @@
 #define DBL_MIN __DBL_MIN__
 #define LDBL_MIN __LDBL_MIN__
 
-#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__)
+#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 
201103L
 #  define FLT_TRUE_MIN __FLT_DENORM_MIN__
 #  define DBL_TRUE_MIN __DBL_DENORM_MIN__
 #  define LDBL_TRUE_MIN __LDBL_DENORM_MIN__

Modified: cfe/trunk/test/Headers/float.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/float.c?rev=353970&r1=353969&r2=353970&view=diff
==
--- cfe/trunk/test/Headers/float.c (original)
+++ cfe/trunk/test/Headers/float.c Wed Feb 13 11:08:01 2019
@@ -1,6 +1,9 @@
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c89 -ffreestanding %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c99 -ffreestanding %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -ffreestanding %s
+// RUN: %clang_cc1 -fsyntax-only -verify -xc++ -std=c++11 -ffreestanding %s
+// RUN: %clang_cc1 -fsyntax-only -verify -xc++ -std=c++14 -ffreestanding %s
+// RUN: %clang_cc1 -fsyntax-only -verify -xc++ -std=c++17 -ffreestanding %s
 // expected-no-diagnostics
 
 /* Basic floating point conformance checks against:
@@ -11,7 +14,7 @@
 /*
 C11,5.2.4.2.2p11,   pp. 30
 C99,5.2.4.2.2p9,pp. 25
-C89,2.2.4.2 
+C89,2.2.4.2
 */
 #include 
 
@@ -42,7 +45,7 @@
 #endif
 
 
-#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__)
+#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 
201103L
 #ifndef FLT_DECIMAL_DIG
 #error "Mandatory macro FLT_DECIMAL_DIG is missing."
 #elif   FLT_DECIMAL_DIG < 6
@@ -98,7 +101,7 @@
 #endif
 
 
-#if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__)
+#if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__) || __cplusplus >= 
201103L
 #ifndef DECIMAL_DIG
 #error "Mandatory macro DECIMAL_DIG is missing."
 #elif   DECIMAL_DIG < 10
@@ -212,13 +215,13 @@ _Static_assert(FLT_MANT_DIG == __FLT_MAN
 _Static_assert(DBL_MANT_DIG == __DBL_MANT_DIG__, "");
 _Static_assert(LDBL_MANT_DIG == __LDBL_MANT_DIG__, "");
 
-#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__)
+#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 
201103L
 _Static_assert(FLT_DECIMAL_DIG == __FLT_DECIMAL_DIG__, "");
 _Static_assert(DBL_DECIMAL_DIG == __DBL_DECIMAL_DIG__, "");
 _Static_assert(LDBL_DECIMAL_DIG == __LDBL_DECIMAL_DIG__, "");
 #endif
 
-#if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__)
+#if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__) || __cplusplus >= 
201103L
 _Static_assert(DECIMAL_DIG == __DECIMAL_DIG__, "");
 #endif
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r354691 - [clang] Only provide C11 features in starting with C++17

2019-02-22 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Fri Feb 22 12:48:54 2019
New Revision: 354691

URL: http://llvm.org/viewvc/llvm-project?rev=354691&view=rev
Log:
[clang] Only provide C11 features in  starting with C++17

Summary:
In r353970, I enabled those features in C++11 and above. To be strictly
conforming, those features should only be enabled in C++17 and above.

Reviewers: jfb, eli.friedman

Subscribers: jkorous, dexonsmith, libcxx-commits

Differential Revision: https://reviews.llvm.org/D58289

Modified:
cfe/trunk/lib/Headers/float.h
cfe/trunk/test/Headers/float.c

Modified: cfe/trunk/lib/Headers/float.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/float.h?rev=354691&r1=354690&r2=354691&view=diff
==
--- cfe/trunk/lib/Headers/float.h (original)
+++ cfe/trunk/lib/Headers/float.h Fri Feb 22 12:48:54 2019
@@ -78,7 +78,7 @@
 #  undef FLT_MIN
 #  undef DBL_MIN
 #  undef LDBL_MIN
-#  if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus 
>= 201103L
+#  if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus 
>= 201703L
 #undef FLT_TRUE_MIN
 #undef DBL_TRUE_MIN
 #undef LDBL_TRUE_MIN
@@ -137,7 +137,7 @@
 #define DBL_MIN __DBL_MIN__
 #define LDBL_MIN __LDBL_MIN__
 
-#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 
201103L
+#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 
201703L
 #  define FLT_TRUE_MIN __FLT_DENORM_MIN__
 #  define DBL_TRUE_MIN __DBL_DENORM_MIN__
 #  define LDBL_TRUE_MIN __LDBL_DENORM_MIN__

Modified: cfe/trunk/test/Headers/float.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/float.c?rev=354691&r1=354690&r2=354691&view=diff
==
--- cfe/trunk/test/Headers/float.c (original)
+++ cfe/trunk/test/Headers/float.c Fri Feb 22 12:48:54 2019
@@ -45,7 +45,7 @@
 #endif
 
 
-#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 
201103L
+#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 
201703L
 #ifndef FLT_DECIMAL_DIG
 #error "Mandatory macro FLT_DECIMAL_DIG is missing."
 #elif   FLT_DECIMAL_DIG < 6
@@ -215,7 +215,7 @@ _Static_assert(FLT_MANT_DIG == __FLT_MAN
 _Static_assert(DBL_MANT_DIG == __DBL_MANT_DIG__, "");
 _Static_assert(LDBL_MANT_DIG == __LDBL_MANT_DIG__, "");
 
-#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 
201103L
+#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 
201703L
 _Static_assert(FLT_DECIMAL_DIG == __FLT_DECIMAL_DIG__, "");
 _Static_assert(DBL_DECIMAL_DIG == __DBL_DECIMAL_DIG__, "");
 _Static_assert(LDBL_DECIMAL_DIG == __LDBL_DECIMAL_DIG__, "");


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r361278 - [clang][Darwin] Refactor header search path logic into the driver

2019-05-21 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Tue May 21 10:48:04 2019
New Revision: 361278

URL: http://llvm.org/viewvc/llvm-project?rev=361278&view=rev
Log:
[clang][Darwin] Refactor header search path logic into the driver

Summary:
This commit moves the logic for determining system, resource and C++
header search paths from CC1 to the driver. This refactor has already
been made for several platforms, but Darwin had been left behind.

This refactor tries to implement the previous search path logic with
perfect accuracy. In particular, the order of all include paths inside
CC1 and all paths that were skipped because nonexistent are conserved
after the refactor. This change was also tested against a code base
of significant size and revealed no problems.

Reviewers: jfb, arphaman

Subscribers: nemanjai, javed.absar, kbarton, christof, jkorous, dexonsmith, 
jsji, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61963

Added:
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/arm64-apple-darwin10/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/arm64-apple-darwin10/.keep
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/lib/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/lib/.keep
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v6/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v6/.keep

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v7/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v7/.keep
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/lib/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/lib/.keep
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/ppc64/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/ppc64/.keep

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/ppc64/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/ppc64/.keep
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/lib/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/lib/.keep
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.0.0/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.0.0/i686-apple-darwin8/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.0.0/i686-apple-darwin8/.keep

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.2.1/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.2.1/i686-apple-darwin10/

cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86

r350649 - [Sema] Teach Clang that aligned allocation is not supported with macosx10.13

2019-01-08 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Tue Jan  8 12:26:56 2019
New Revision: 350649

URL: http://llvm.org/viewvc/llvm-project?rev=350649&view=rev
Log:
[Sema] Teach Clang that aligned allocation is not supported with macosx10.13

Summary:
r306722 added diagnostics when aligned allocation is used with deployment
targets that do not support it, but the first macosx supporting aligned
allocation was incorrectly set to 10.13. In reality, the dylib shipped
with macosx10.13 does not support aligned allocation, but the dylib
shipped with macosx10.14 does.

Reviewers: ahatanak

Subscribers: christof, jkorous, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D56445

Modified:
cfe/trunk/include/clang/Basic/AlignedAllocation.h
cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp
cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp

Modified: cfe/trunk/include/clang/Basic/AlignedAllocation.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AlignedAllocation.h?rev=350649&r1=350648&r2=350649&view=diff
==
--- cfe/trunk/include/clang/Basic/AlignedAllocation.h (original)
+++ cfe/trunk/include/clang/Basic/AlignedAllocation.h Tue Jan  8 12:26:56 2019
@@ -27,8 +27,8 @@ inline llvm::VersionTuple alignedAllocMi
   default:
 break;
   case llvm::Triple::Darwin:
-  case llvm::Triple::MacOSX: // Earliest supporting version is 10.13.
-return llvm::VersionTuple(10U, 13U);
+  case llvm::Triple::MacOSX: // Earliest supporting version is 10.14.
+return llvm::VersionTuple(10U, 14U);
   case llvm::Triple::IOS:
   case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0.
 return llvm::VersionTuple(11U);

Modified: cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp?rev=350649&r1=350648&r2=350649&view=diff
==
--- cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp (original)
+++ cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp Tue Jan  8 
12:26:56 2019
@@ -1,4 +1,4 @@
-// RUN: %clang -target x86_64-apple-macosx10.12 -c -### %s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=UNAVAILABLE
 //
 // RUN: %clang -target arm64-apple-ios10 -c -### %s 2>&1 \
@@ -24,7 +24,7 @@
 //
 // UNAVAILABLE: "-faligned-alloc-unavailable"
 
-// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.14 -c -### %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=AVAILABLE
 //
 // RUN: %clang -target arm64-apple-ios11 -c -### %s 2>&1 \
@@ -54,10 +54,10 @@
 // Check that passing -faligned-allocation or -fno-aligned-allocation stops the
 // driver from passing -faligned-alloc-unavailable to cc1.
 //
-// RUN: %clang -target x86_64-apple-macosx10.12 -faligned-allocation -c -### 
%s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.13 -faligned-allocation -c -### 
%s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=AVAILABLE
 //
-// RUN: %clang -target x86_64-apple-macosx10.12 -fno-aligned-allocation -c 
-### %s 2>&1 \
+// RUN: %clang -target x86_64-apple-macosx10.13 -fno-aligned-allocation -c 
-### %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=AVAILABLE
 
 // AVAILABLE-NOT: "-faligned-alloc-unavailable"

Modified: cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp?rev=350649&r1=350648&r2=350649&view=diff
==
--- cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp (original)
+++ cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp Tue Jan  8 
12:26:56 2019
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions 
-faligned-alloc-unavailable -std=c++1z -verify %s
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -std=c++1z 
-verify -DNO_ERRORS %s
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions 
-faligned-allocation -faligned-alloc-unavailable -std=c++14 -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions 
-faligned-alloc-unavailable -std=c++1z -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions -std=c++1z 
-verify -DNO_ERRORS %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions 
-faligned-allocation -faligned-alloc-unavailable -std=c++14 -verify %s
 // RUN: %clang_cc1 -triple arm64-apple-ios10.0.0 -fexceptions 
-faligned-alloc-unavailable -std=c++1z -verify -DIOS %s
 // RUN: %clang_cc1 -triple arm64-apple-ios10.0.0 -fexceptions -std=c++1z 
-verify -DNO_ERRORS %s
 // RUN: %clang_cc1 -triple arm64-apple-tvos10.0.0 -fexceptions 
-faligned-alloc-unavailable -std=c++1z -verify -DTVOS %s
@@ -11

[libcxx] r336368 - [NFC] Add to the synopsis of

2018-07-05 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Thu Jul  5 09:16:03 2018
New Revision: 336368

URL: http://llvm.org/viewvc/llvm-project?rev=336368&view=rev
Log:
[NFC] Add  to the synopsis of 

Summary:
It is part of the synopsis in the Standard and  does include it,
but it was left out of the synopsis comment.

Reviewers: EricWF, mclow.lists

Subscribers: christof, llvm-commits

Differential Revision: https://reviews.llvm.org/D48611

Modified:
libcxx/trunk/include/utility

Modified: libcxx/trunk/include/utility
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/utility?rev=336368&r1=336367&r2=336368&view=diff
==
--- libcxx/trunk/include/utility (original)
+++ libcxx/trunk/include/utility Thu Jul  5 09:16:03 2018
@@ -14,6 +14,8 @@
 /*
 utility synopsis
 
+#include 
+
 namespace std
 {
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r336369 - [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

2018-07-05 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Thu Jul  5 09:49:38 2018
New Revision: 336369

URL: http://llvm.org/viewvc/llvm-project?rev=336369&view=rev
Log:
[libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

Summary:
We never actually mean to always inline a function -- all the uses of
the macro I could find are actually attempts to control the visibility
of symbols. This is better described by _LIBCPP_INLINE_VISIBILITY, which
is actually always defined the same.

This change is orthogonal to the decision of what we're actually going
to do with _LIBCPP_INLINE_VISIBILITY -- it just simplifies things by
having one canonical way of doing things.

Reviewers: EricWF

Subscribers: christof, llvm-commits, dexonsmith, erikvanderpoel, mclow.lists

Differential Revision: https://reviews.llvm.org/D48892

Modified:
libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
libcxx/trunk/include/__bsd_locale_fallbacks.h
libcxx/trunk/include/__config
libcxx/trunk/include/__locale
libcxx/trunk/include/__nullptr
libcxx/trunk/include/any
libcxx/trunk/include/cmath
libcxx/trunk/include/codecvt
libcxx/trunk/include/exception
libcxx/trunk/include/experimental/dynarray
libcxx/trunk/include/experimental/filesystem
libcxx/trunk/include/functional
libcxx/trunk/include/future
libcxx/trunk/include/initializer_list
libcxx/trunk/include/ios
libcxx/trunk/include/locale
libcxx/trunk/include/math.h
libcxx/trunk/include/memory
libcxx/trunk/include/new
libcxx/trunk/include/ostream
libcxx/trunk/include/regex
libcxx/trunk/include/stdexcept
libcxx/trunk/include/streambuf
libcxx/trunk/include/support/android/locale_bionic.h
libcxx/trunk/include/support/xlocale/__posix_l_fallback.h
libcxx/trunk/include/support/xlocale/__strtonum_fallback.h
libcxx/trunk/include/system_error
libcxx/trunk/include/typeinfo
libcxx/trunk/include/vector
libcxx/trunk/src/support/win32/thread_win32.cpp

Modified: libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst?rev=336369&r1=336368&r2=336369&view=diff
==
--- libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst (original)
+++ libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst Thu Jul  5 09:49:38 2018
@@ -41,10 +41,10 @@ Visibility Macros
   library and has an empty definition otherwise.
 
 **_LIBCPP_INLINE_VISIBILITY**
-  Mark a function as hidden and force inlining whenever possible.
-
-**_LIBCPP_ALWAYS_INLINE**
-  A synonym for `_LIBCPP_INLINE_VISIBILITY`
+  Mark a function as not being part of the ABI of any final linked image that
+  uses it, and also as being internal to each TU that uses that function. In
+  other words, the address of a function marked with this attribute is not
+  guaranteed to be the same across translation units.
 
 **_LIBCPP_TYPE_VIS**
   Mark a type's typeinfo, vtable and members as having default visibility.

Modified: libcxx/trunk/include/__bsd_locale_fallbacks.h
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__bsd_locale_fallbacks.h?rev=336369&r1=336368&r2=336369&view=diff
==
--- libcxx/trunk/include/__bsd_locale_fallbacks.h (original)
+++ libcxx/trunk/include/__bsd_locale_fallbacks.h Thu Jul  5 09:49:38 2018
@@ -24,28 +24,28 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return MB_CUR_MAX;
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 wint_t __libcpp_btowc_l(int __c, locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return btowc(__c);
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 int __libcpp_wctob_l(wint_t __c, locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return wctob(__c);
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
  size_t __len, mbstate_t *__ps, locale_t __l)
 {
@@ -53,14 +53,14 @@ size_t __libcpp_wcsnrtombs_l(char *__des
 return wcsnrtombs(__dest, __src, __nwc, __len, __ps);
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 size_t __libcpp_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t 
__l)
 {
 __libcpp_locale_guard __current(__l);
 return wcrtomb(__s, __wc, __ps);
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t 
__nms,
   size_t __len, mbstate_t *__ps, locale_t __l)
 {
@@ -68,7 +68,7 @@ size_t __libcpp_mbsnrtowcs_l(wchar_t * _
 return mbsnrtowcs(__dest, __src, __nms, __len, __ps);
 }
 

[libcxx] r336382 - Revert "[libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY"

2018-07-05 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Thu Jul  5 11:41:50 2018
New Revision: 336382

URL: http://llvm.org/viewvc/llvm-project?rev=336382&view=rev
Log:
Revert "[libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by 
_LIBCPP_INLINE_VISIBILITY"

This reverts commit r336369. The commit had two problems:
1. __pbump was marked as _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY instead of
   _LIBCPP_INLINE_VISIBILITY, which lead to two symbols being added in the
   dylib and the check-cxx-abilist failing.

2. The LLDB tests started failing because they undefine
   `_LIBCPP_INLINE_VISIBILITY`. I need to figure out why they do that and
   fix the tests before we can go forward with this change.

Modified:
libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
libcxx/trunk/include/__bsd_locale_fallbacks.h
libcxx/trunk/include/__config
libcxx/trunk/include/__locale
libcxx/trunk/include/__nullptr
libcxx/trunk/include/any
libcxx/trunk/include/cmath
libcxx/trunk/include/codecvt
libcxx/trunk/include/exception
libcxx/trunk/include/experimental/dynarray
libcxx/trunk/include/experimental/filesystem
libcxx/trunk/include/functional
libcxx/trunk/include/future
libcxx/trunk/include/initializer_list
libcxx/trunk/include/ios
libcxx/trunk/include/locale
libcxx/trunk/include/math.h
libcxx/trunk/include/memory
libcxx/trunk/include/new
libcxx/trunk/include/ostream
libcxx/trunk/include/regex
libcxx/trunk/include/stdexcept
libcxx/trunk/include/streambuf
libcxx/trunk/include/support/android/locale_bionic.h
libcxx/trunk/include/support/xlocale/__posix_l_fallback.h
libcxx/trunk/include/support/xlocale/__strtonum_fallback.h
libcxx/trunk/include/system_error
libcxx/trunk/include/typeinfo
libcxx/trunk/include/vector
libcxx/trunk/src/support/win32/thread_win32.cpp

Modified: libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst?rev=336382&r1=336381&r2=336382&view=diff
==
--- libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst (original)
+++ libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst Thu Jul  5 11:41:50 2018
@@ -41,10 +41,10 @@ Visibility Macros
   library and has an empty definition otherwise.
 
 **_LIBCPP_INLINE_VISIBILITY**
-  Mark a function as not being part of the ABI of any final linked image that
-  uses it, and also as being internal to each TU that uses that function. In
-  other words, the address of a function marked with this attribute is not
-  guaranteed to be the same across translation units.
+  Mark a function as hidden and force inlining whenever possible.
+
+**_LIBCPP_ALWAYS_INLINE**
+  A synonym for `_LIBCPP_INLINE_VISIBILITY`
 
 **_LIBCPP_TYPE_VIS**
   Mark a type's typeinfo, vtable and members as having default visibility.

Modified: libcxx/trunk/include/__bsd_locale_fallbacks.h
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__bsd_locale_fallbacks.h?rev=336382&r1=336381&r2=336382&view=diff
==
--- libcxx/trunk/include/__bsd_locale_fallbacks.h (original)
+++ libcxx/trunk/include/__bsd_locale_fallbacks.h Thu Jul  5 11:41:50 2018
@@ -24,28 +24,28 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_ALWAYS_INLINE
 decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return MB_CUR_MAX;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_ALWAYS_INLINE
 wint_t __libcpp_btowc_l(int __c, locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return btowc(__c);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_ALWAYS_INLINE
 int __libcpp_wctob_l(wint_t __c, locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return wctob(__c);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_ALWAYS_INLINE
 size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
  size_t __len, mbstate_t *__ps, locale_t __l)
 {
@@ -53,14 +53,14 @@ size_t __libcpp_wcsnrtombs_l(char *__des
 return wcsnrtombs(__dest, __src, __nwc, __len, __ps);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_ALWAYS_INLINE
 size_t __libcpp_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t 
__l)
 {
 __libcpp_locale_guard __current(__l);
 return wcrtomb(__s, __wc, __ps);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_ALWAYS_INLINE
 size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t 
__nms,
   size_t __len, mbstate_t *__ps, locale_t __l)
 {
@@ -68,7 +68,7 @@ size_t __libcpp_mbsnrtowcs_l(wchar_t * _
 return mbsnrtowcs(__dest, __src, __nms, __len, __ps);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_ALWAYS_INLINE
 size_t __libcpp_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n,
   

[libcxx] r336665 - [libc++] Declare operators with the proper visibility attribute

2018-07-10 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Tue Jul 10 06:21:03 2018
New Revision: 336665

URL: http://llvm.org/viewvc/llvm-project?rev=336665&view=rev
Log:
[libc++] Declare  operators with the proper visibility attribute

Summary:
Many operators in  were _defined_ with the proper visibility attribute,
but they were _declared_ without any. This is not a problem until we change the
definition of _LIBCPP_INLINE_VISIBILITY to something that requires the
declaration to be decorated.

I also marked `strong_equality::operator weak_equality()` as
`_LIBCPP_INLINE_VISIBILITY`, since it seems like it had been forgotten.

This came up while trying to get rid of `__attribute__((__always_inline__))`
in favor of `__attribute__((internal_linkage))`.

Reviewers: EricWF, mclow.lists

Subscribers: christof, dexonsmith, llvm-commits

Differential Revision: https://reviews.llvm.org/D49104

Modified:
libcxx/trunk/include/compare

Modified: libcxx/trunk/include/compare
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/compare?rev=336665&r1=336664&r2=336665&view=diff
==
--- libcxx/trunk/include/compare (original)
+++ libcxx/trunk/include/compare Tue Jul 10 06:21:03 2018
@@ -88,14 +88,14 @@ public:
   static const weak_equality equivalent;
   static const weak_equality nonequivalent;
 
-  friend constexpr bool operator==(weak_equality __v, _CmpUnspecifiedParam) 
noexcept;
-  friend constexpr bool operator==(_CmpUnspecifiedParam, weak_equality __v) 
noexcept;
-  friend constexpr bool operator!=(weak_equality __v, _CmpUnspecifiedParam) 
noexcept;
-  friend constexpr bool operator!=(_CmpUnspecifiedParam, weak_equality __v) 
noexcept;
+  _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(weak_equality 
__v, _CmpUnspecifiedParam) noexcept;
+  _LIBCPP_INLINE_VISIBILITY friend constexpr bool 
operator==(_CmpUnspecifiedParam, weak_equality __v) noexcept;
+  _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(weak_equality 
__v, _CmpUnspecifiedParam) noexcept;
+  _LIBCPP_INLINE_VISIBILITY friend constexpr bool 
operator!=(_CmpUnspecifiedParam, weak_equality __v) noexcept;
 
 #ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
-  friend constexpr weak_equality operator<=>(weak_equality __v, 
_CmpUnspecifiedParam) noexcept;
-  friend constexpr weak_equality operator<=>(_CmpUnspecifiedParam, 
weak_equality __v) noexcept;
+  _LIBCPP_INLINE_VISIBILITY friend constexpr weak_equality 
operator<=>(weak_equality __v, _CmpUnspecifiedParam) noexcept;
+  _LIBCPP_INLINE_VISIBILITY friend constexpr weak_equality 
operator<=>(_CmpUnspecifiedParam, weak_equality __v) noexcept;
 #endif
 
 private:
@@ -148,20 +148,20 @@ public:
   static const strong_equality nonequivalent;
 
   // conversion
-  constexpr operator weak_equality() const noexcept {
+  _LIBCPP_INLINE_VISIBILITY constexpr operator weak_equality() const noexcept {
 return __value_ == _EqResult::__zero ? weak_equality::equivalent
   : weak_equality::nonequivalent;
   }
 
   // comparisons
-  friend constexpr bool operator==(strong_equality __v, _CmpUnspecifiedParam) 
noexcept;
-  friend constexpr bool operator!=(strong_equality __v, _CmpUnspecifiedParam) 
noexcept;
-  friend constexpr bool operator==(_CmpUnspecifiedParam, strong_equality __v) 
noexcept;
-  friend constexpr bool operator!=(_CmpUnspecifiedParam, strong_equality __v) 
noexcept;
+  _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(strong_equality 
__v, _CmpUnspecifiedParam) noexcept;
+  _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(strong_equality 
__v, _CmpUnspecifiedParam) noexcept;
+  _LIBCPP_INLINE_VISIBILITY friend constexpr bool 
operator==(_CmpUnspecifiedParam, strong_equality __v) noexcept;
+  _LIBCPP_INLINE_VISIBILITY friend constexpr bool 
operator!=(_CmpUnspecifiedParam, strong_equality __v) noexcept;
 
 #ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
-  friend constexpr strong_equality operator<=>(strong_equality __v, 
_CmpUnspecifiedParam) noexcept;
-  friend constexpr strong_equality operator<=>(_CmpUnspecifiedParam, 
strong_equality __v) noexcept;
+  _LIBCPP_INLINE_VISIBILITY friend constexpr strong_equality 
operator<=>(strong_equality __v, _CmpUnspecifiedParam) noexcept;
+  _LIBCPP_INLINE_VISIBILITY friend constexpr strong_equality 
operator<=>(_CmpUnspecifiedParam, strong_equality __v) noexcept;
 #endif
 private:
   _EqResult __value_;
@@ -235,22 +235,22 @@ public:
   }
 
   // comparisons
-  friend constexpr bool operator==(partial_ordering __v, _CmpUnspecifiedParam) 
noexcept;
-  friend constexpr bool operator!=(partial_ordering __v, _CmpUnspecifiedParam) 
noexcept;
-  friend constexpr bool operator< (partial_ordering __v, _CmpUnspecifiedParam) 
noexcept;
-  friend constexpr bool operator<=(partial_ordering __v, _CmpUnspecifiedParam) 
noexcept;
-  friend constexpr bool operator> (partial_ordering __v, _CmpUnspecifiedParam) 
noexcept;
-  friend constexpr bool operator>=(partial_ordering __v, _CmpUnspecifiedParam

[libcxx] r336709 - [libc++] Declare noop_coroutine() with _LIBCPP_INLINE_VISIBILITY

2018-07-10 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Tue Jul 10 10:38:30 2018
New Revision: 336709

URL: http://llvm.org/viewvc/llvm-project?rev=336709&view=rev
Log:
[libc++] Declare noop_coroutine() with _LIBCPP_INLINE_VISIBILITY

Summary:
It was defined with the right visibility, but declared without any visibility.
This function was left out of a prior revision that did the same to several
functions in  (r336665) because the compiler I used didn't support
coroutines. This reinforces the need for automated checks -- there might
still be several cases of this throughout the library.

Reviewers: EricWF

Subscribers: modocache, christof, dexonsmith, llvm-commits

Differential Revision: https://reviews.llvm.org/D49145

Modified:
libcxx/trunk/include/experimental/coroutine

Modified: libcxx/trunk/include/experimental/coroutine
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/coroutine?rev=336709&r1=336708&r2=336709&view=diff
==
--- libcxx/trunk/include/experimental/coroutine (original)
+++ libcxx/trunk/include/experimental/coroutine Tue Jul 10 10:38:30 2018
@@ -283,6 +283,7 @@ public:
   _LIBCPP_CONSTEXPR_AFTER_CXX17 void destroy() const _NOEXCEPT {}
 
 private:
+  _LIBCPP_INLINE_VISIBILITY
   friend coroutine_handle noop_coroutine() _NOEXCEPT;
 
   _LIBCPP_INLINE_VISIBILITY coroutine_handle() _NOEXCEPT {


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r336866 - [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY

2018-07-11 Thread Louis Dionne via cfe-commits
Author: ldionne
Date: Wed Jul 11 16:14:33 2018
New Revision: 336866

URL: http://llvm.org/viewvc/llvm-project?rev=336866&view=rev
Log:
[libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by 
_LIBCPP_INLINE_VISIBILITY

Summary:
We never actually mean to always inline a function -- all the uses of
the macro I could find are actually attempts to control the visibility
of symbols. This is better described by _LIBCPP_INLINE_VISIBILITY, which
is actually always defined the same.

This change is orthogonal to the decision of what we're actually going
to do with _LIBCPP_INLINE_VISIBILITY -- it just simplifies things by
having one canonical way of doing things.

Note that this commit had originally been applied in r336369 and then
reverted in r336382 because of unforeseen problems. Both of these problems
have now been fixed.

Reviewers: EricWF, mclow.lists

Subscribers: christof, dexonsmith, erikvanderpoel

Differential Revision: https://reviews.llvm.org/D48892

Modified:
libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
libcxx/trunk/include/__bsd_locale_fallbacks.h
libcxx/trunk/include/__config
libcxx/trunk/include/__locale
libcxx/trunk/include/__nullptr
libcxx/trunk/include/any
libcxx/trunk/include/cmath
libcxx/trunk/include/codecvt
libcxx/trunk/include/exception
libcxx/trunk/include/experimental/dynarray
libcxx/trunk/include/experimental/filesystem
libcxx/trunk/include/functional
libcxx/trunk/include/future
libcxx/trunk/include/initializer_list
libcxx/trunk/include/ios
libcxx/trunk/include/locale
libcxx/trunk/include/math.h
libcxx/trunk/include/memory
libcxx/trunk/include/new
libcxx/trunk/include/ostream
libcxx/trunk/include/regex
libcxx/trunk/include/stdexcept
libcxx/trunk/include/streambuf
libcxx/trunk/include/support/android/locale_bionic.h
libcxx/trunk/include/support/xlocale/__posix_l_fallback.h
libcxx/trunk/include/support/xlocale/__strtonum_fallback.h
libcxx/trunk/include/system_error
libcxx/trunk/include/typeinfo
libcxx/trunk/include/vector
libcxx/trunk/src/support/win32/thread_win32.cpp

Modified: libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst?rev=336866&r1=336865&r2=336866&view=diff
==
--- libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst (original)
+++ libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst Wed Jul 11 16:14:33 2018
@@ -41,10 +41,10 @@ Visibility Macros
   library and has an empty definition otherwise.
 
 **_LIBCPP_INLINE_VISIBILITY**
-  Mark a function as hidden and force inlining whenever possible.
-
-**_LIBCPP_ALWAYS_INLINE**
-  A synonym for `_LIBCPP_INLINE_VISIBILITY`
+  Mark a function as not being part of the ABI of any final linked image that
+  uses it, and also as being internal to each TU that uses that function. In
+  other words, the address of a function marked with this attribute is not
+  guaranteed to be the same across translation units.
 
 **_LIBCPP_TYPE_VIS**
   Mark a type's typeinfo, vtable and members as having default visibility.

Modified: libcxx/trunk/include/__bsd_locale_fallbacks.h
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__bsd_locale_fallbacks.h?rev=336866&r1=336865&r2=336866&view=diff
==
--- libcxx/trunk/include/__bsd_locale_fallbacks.h (original)
+++ libcxx/trunk/include/__bsd_locale_fallbacks.h Wed Jul 11 16:14:33 2018
@@ -24,28 +24,28 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return MB_CUR_MAX;
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 wint_t __libcpp_btowc_l(int __c, locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return btowc(__c);
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 int __libcpp_wctob_l(wint_t __c, locale_t __l)
 {
 __libcpp_locale_guard __current(__l);
 return wctob(__c);
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
  size_t __len, mbstate_t *__ps, locale_t __l)
 {
@@ -53,14 +53,14 @@ size_t __libcpp_wcsnrtombs_l(char *__des
 return wcsnrtombs(__dest, __src, __nwc, __len, __ps);
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 size_t __libcpp_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t 
__l)
 {
 __libcpp_locale_guard __current(__l);
 return wcrtomb(__s, __wc, __ps);
 }
 
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
 size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t 
__nms,
   size_t _

[libunwind] 0f03626 - [runtimes][NFC] Remove unused or unnecessary CMake variables

2020-07-16 Thread Louis Dionne via cfe-commits

Author: Louis Dionne
Date: 2020-07-16T10:47:08-04:00
New Revision: 0f03626fbf40ba1a74badf2d1476a550535c184f

URL: 
https://github.com/llvm/llvm-project/commit/0f03626fbf40ba1a74badf2d1476a550535c184f
DIFF: 
https://github.com/llvm/llvm-project/commit/0f03626fbf40ba1a74badf2d1476a550535c184f.diff

LOG: [runtimes][NFC] Remove unused or unnecessary CMake variables

Added: 


Modified: 
libcxx/CMakeLists.txt
libcxx/test/lit.site.cfg.in
libcxxabi/CMakeLists.txt
libcxxabi/test/lit.site.cfg.in
libunwind/CMakeLists.txt
libunwind/test/lit.site.cfg.in

Removed: 




diff  --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 26bf553ddeed..caf655d6799a 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -407,14 +407,10 @@ endif ()
 # Configure System
 
#===
 
-set(LIBCXX_COMPILER${CMAKE_CXX_COMPILER})
 set(LIBCXX_SOURCE_DIR  ${CMAKE_CURRENT_SOURCE_DIR})
 set(LIBCXX_BINARY_DIR  ${CMAKE_CURRENT_BINARY_DIR})
 set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build")
 
-string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
-   ${PACKAGE_VERSION})
-
 if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
   set(LIBCXX_LIBRARY_DIR 
${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++)
   set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR})

diff  --git a/libcxx/test/lit.site.cfg.in b/libcxx/test/lit.site.cfg.in
index 939776f2287d..1f3370ccc9bc 100644
--- a/libcxx/test/lit.site.cfg.in
+++ b/libcxx/test/lit.site.cfg.in
@@ -3,7 +3,7 @@
 import os
 import site
 
-config.cxx_under_test   = "@LIBCXX_COMPILER@"
+config.cxx_under_test   = "@CMAKE_CXX_COMPILER@"
 config.project_obj_root = "@CMAKE_BINARY_DIR@"
 config.libcxx_src_root  = "@LIBCXX_SOURCE_DIR@"
 config.libcxx_obj_root  = "@LIBCXX_BINARY_DIR@"

diff  --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index 8881a5018dc4..e4e20d950b89 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -151,13 +151,9 @@ set(CMAKE_MODULE_PATH
   ${CMAKE_MODULE_PATH}
   )
 
-set(LIBCXXABI_COMPILER${CMAKE_CXX_COMPILER})
 set(LIBCXXABI_SOURCE_DIR  ${CMAKE_CURRENT_SOURCE_DIR})
 set(LIBCXXABI_BINARY_DIR  ${CMAKE_CURRENT_BINARY_DIR})
 
-string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
-   ${PACKAGE_VERSION})
-
 if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
   set(LIBCXXABI_LIBRARY_DIR 
${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++)
   set(LIBCXXABI_INSTALL_LIBRARY_DIR 
lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++)

diff  --git a/libcxxabi/test/lit.site.cfg.in b/libcxxabi/test/lit.site.cfg.in
index 75fde7ee9250..06d5706da7d2 100644
--- a/libcxxabi/test/lit.site.cfg.in
+++ b/libcxxabi/test/lit.site.cfg.in
@@ -3,7 +3,7 @@
 import os
 import site
 
-config.cxx_under_test   = "@LIBCXXABI_COMPILER@"
+config.cxx_under_test   = "@CMAKE_CXX_COMPILER@"
 config.project_obj_root = "@CMAKE_BINARY_DIR@"
 config.libcxxabi_src_root   = "@LIBCXXABI_SOURCE_DIR@"
 config.libcxxabi_obj_root   = "@LIBCXXABI_BINARY_DIR@"

diff  --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt
index f20893f4aa86..b50550dc376e 100644
--- a/libunwind/CMakeLists.txt
+++ b/libunwind/CMakeLists.txt
@@ -182,13 +182,9 @@ set(CMAKE_MODULE_PATH
 "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
 ${CMAKE_MODULE_PATH})
 
-set(LIBUNWIND_COMPILER${CMAKE_CXX_COMPILER})
 set(LIBUNWIND_SOURCE_DIR  ${CMAKE_CURRENT_SOURCE_DIR})
 set(LIBUNWIND_BINARY_DIR  ${CMAKE_CURRENT_BINARY_DIR})
 
-string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
-   ${PACKAGE_VERSION})
-
 if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
   set(LIBUNWIND_LIBRARY_DIR 
${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++)
   set(LIBUNWIND_INSTALL_LIBRARY_DIR 
lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++)

diff  --git a/libunwind/test/lit.site.cfg.in b/libunwind/test/lit.site.cfg.in
index d0f0e08fc926..30a996cf3783 100644
--- a/libunwind/test/lit.site.cfg.in
+++ b/libunwind/test/lit.site.cfg.in
@@ -3,7 +3,7 @@
 import os
 import site
 
-config.cxx_under_test   = "@LIBUNWIND_COMPILER@"
+config.cxx_under_test   = "@CMAKE_CXX_COMPILER@"
 config.project_obj_root = "@CMAKE_BINARY_DIR@"
 config.libunwind_src_root   = "@LIBUNWIND_SOURCE_DIR@"
 config.libunwind_obj_root   = "@LIBUNWIND_BINARY_DIR@"



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] 145acac - [libunwind] Remove old keymgr related logic

2020-07-27 Thread Louis Dionne via cfe-commits

Author: Louis Dionne
Date: 2020-07-27T16:12:59-04:00
New Revision: 145acacaea1d7fb4ffc055a3e92ee8fee7c58634

URL: 
https://github.com/llvm/llvm-project/commit/145acacaea1d7fb4ffc055a3e92ee8fee7c58634
DIFF: 
https://github.com/llvm/llvm-project/commit/145acacaea1d7fb4ffc055a3e92ee8fee7c58634.diff

LOG: [libunwind] Remove old keymgr related logic

keymgr used to be used on MacOSX <= 10.6, however we don't build libunwind
from scratch for such old systems anymore. Hence, this code isn't useful
anymore.

Differential Revision: https://reviews.llvm.org/D84677

Added: 


Modified: 
libunwind/src/AddressSpace.hpp
libunwind/src/Unwind_AppleExtras.cpp

Removed: 




diff  --git a/libunwind/src/AddressSpace.hpp b/libunwind/src/AddressSpace.hpp
index 764aaa3489f2..3d1e810f43c0 100644
--- a/libunwind/src/AddressSpace.hpp
+++ b/libunwind/src/AddressSpace.hpp
@@ -39,13 +39,6 @@ struct EHABIIndexEntry {
 };
 #endif
 
-#ifdef __APPLE__
-#include 
-namespace libunwind {
-   bool checkKeyMgrRegisteredFDEs(uintptr_t targetAddr, void *&fde);
-}
-#endif
-
 #include "libunwind.h"
 #include "config.h"
 #include "dwarf2.h"
@@ -651,14 +644,10 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t 
targetAddr,
 
 
 inline bool LocalAddressSpace::findOtherFDE(pint_t targetAddr, pint_t &fde) {
-#ifdef __APPLE__
-  return checkKeyMgrRegisteredFDEs(targetAddr, *((void**)&fde));
-#else
   // TO DO: if OS has way to dynamically register FDEs, check that.
   (void)targetAddr;
   (void)fde;
   return false;
-#endif
 }
 
 inline bool LocalAddressSpace::findFunctionName(pint_t addr, char *buf,

diff  --git a/libunwind/src/Unwind_AppleExtras.cpp 
b/libunwind/src/Unwind_AppleExtras.cpp
index 536303993eff..1d9948aced35 100644
--- a/libunwind/src/Unwind_AppleExtras.cpp
+++ b/libunwind/src/Unwind_AppleExtras.cpp
@@ -12,33 +12,6 @@
 #include "DwarfParser.hpp"
 
 
-// private keymgr stuff
-#define KEYMGR_GCC3_DW2_OBJ_LIST 302
-extern "C" {
- extern void _keymgr_set_and_unlock_processwide_ptr(int key, void *ptr);
- extern void *_keymgr_get_and_lock_processwide_ptr(int key);
-}
-
-// undocumented libgcc "struct object"
-struct libgcc_object {
-  void  *start;
-  void  *unused1;
-  void  *unused2;
-  void  *fde;
-  unsigned long  encoding;
-  void  *fde_end;
-  libgcc_object *next;
-};
-
-// undocumented libgcc "struct km_object_info" referenced by
-// KEYMGR_GCC3_DW2_OBJ_LIST
-struct libgcc_object_info {
-  libgcc_object   *seen_objects;
-  libgcc_object   *unseen_objects;
-  unsigned spare[2];
-};
-
-
 // static linker symbols to prevent wrong two level namespace for _Unwind 
symbols
 #if defined(__arm__)
#define NOT_HERE_BEFORE_5_0(sym) \
@@ -140,44 +113,3 @@ NOT_HERE_BEFORE_5_0(_Unwind_SjLj_Resume_or_Rethrow)
 NOT_HERE_BEFORE_5_0(_Unwind_SjLj_Unregister)
 
 #endif // defined(_LIBUNWIND_BUILD_SJLJ_APIS)
-
-
-namespace libunwind {
-
-_LIBUNWIND_HIDDEN
-bool checkKeyMgrRegisteredFDEs(uintptr_t pc, void *&fde) {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED
-  // lastly check for old style keymgr registration of dynamically generated
-  // FDEs acquire exclusive access to libgcc_object_info
-  libgcc_object_info *head = (libgcc_object_info *)
-_keymgr_get_and_lock_processwide_ptr(KEYMGR_GCC3_DW2_OBJ_LIST);
-  if (head != NULL) {
-// look at each FDE in keymgr
-for (libgcc_object *ob = head->unseen_objects; ob != NULL; ob = ob->next) {
-  CFI_Parser::FDE_Info fdeInfo;
-  CFI_Parser::CIE_Info cieInfo;
-  const char *msg = CFI_Parser::decodeFDE(
-  LocalAddressSpace::sThisAddressSpace,
-  (uintptr_t)ob->fde, &fdeInfo, &cieInfo);
-  if (msg == NULL) {
-// Check if this FDE is for a function that includes the pc
-if ((fdeInfo.pcStart <= pc) && (pc < fdeInfo.pcEnd)) {
-  fde = (void*)fdeInfo.pcStart;
-  _keymgr_set_and_unlock_processwide_ptr(KEYMGR_GCC3_DW2_OBJ_LIST,
- head);
-  return true;
-}
-  }
-}
-  }
-  // release libgcc_object_info
-  _keymgr_set_and_unlock_processwide_ptr(KEYMGR_GCC3_DW2_OBJ_LIST, head);
-#else
-  (void)pc;
-  (void)fde;
-#endif
-  return false;
-}
-
-}
-



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] 6f1d558 - [libunwind] Fix incorrect lit substitutions in tests

2020-04-08 Thread Louis Dionne via cfe-commits

Author: Louis Dionne
Date: 2020-04-08T10:50:09-04:00
New Revision: 6f1d558db42cf92351c649a66c00b881eb75537c

URL: 
https://github.com/llvm/llvm-project/commit/6f1d558db42cf92351c649a66c00b881eb75537c
DIFF: 
https://github.com/llvm/llvm-project/commit/6f1d558db42cf92351c649a66c00b881eb75537c.diff

LOG: [libunwind] Fix incorrect lit substitutions in tests

The LIT substitutions used in libunwind are the same as those from
libc++, and we forgot to update the libunwind tests after the libc++
substitutions started being delimited by braces.

Added: 


Modified: 
libunwind/test/remember_state_leak.pass.sh.s

Removed: 




diff  --git a/libunwind/test/remember_state_leak.pass.sh.s 
b/libunwind/test/remember_state_leak.pass.sh.s
index 821ee926eec8..eb363d0102a8 100644
--- a/libunwind/test/remember_state_leak.pass.sh.s
+++ b/libunwind/test/remember_state_leak.pass.sh.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86, linux
-# RUN: %build -target x86_64-unknown-linux-gnu
-# RUN: %run
+# RUN: %{build} -target x86_64-unknown-linux-gnu
+# RUN: %{run}
 
 # The following assembly is a translation of this code:
 #



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] 5f7a030 - [libunwind] Enable the new libc++ testing format by default

2020-04-13 Thread Louis Dionne via cfe-commits

Author: Louis Dionne
Date: 2020-04-13T18:17:18-04:00
New Revision: 5f7a0301628671b8f4d2c1d9ea90ee723d889a56

URL: 
https://github.com/llvm/llvm-project/commit/5f7a0301628671b8f4d2c1d9ea90ee723d889a56
DIFF: 
https://github.com/llvm/llvm-project/commit/5f7a0301628671b8f4d2c1d9ea90ee723d889a56.diff

LOG: [libunwind] Enable the new libc++ testing format by default

The new format should be equivalent to the old format, and it is now the
default format when running the libc++ and libc++abi tests. This commit
changes the libunwind tests to use the new format by default too. If
unexpected failures are discovered, it should be fine to revert this
commit until they are addressed.

Also note that it is still possible to use the old format by passing
`--param=use_old_format=True` when running Lit for the time being.

Differential Revision: https://reviews.llvm.org/D77733

Added: 


Modified: 
libunwind/test/lit.cfg

Removed: 




diff  --git a/libunwind/test/lit.cfg b/libunwind/test/lit.cfg
index 4ac749392737..262f25af0d70 100644
--- a/libunwind/test/lit.cfg
+++ b/libunwind/test/lit.cfg
@@ -67,9 +67,10 @@ config_module = __import__(config_module_name, 
fromlist=['Configuration'])
 configuration = config_module.Configuration(lit_config, config)
 configuration.configure()
 configuration.print_config_info()
-if lit_config.params.get('use_new_format', False):
-lit_config.note("Using the experimental libc++ testing format")
+if lit_config.params.get('use_old_format', False):
+lit_config.note("Using the old libc++ testing format")
+config.test_format = configuration.get_test_format()
+else:
+lit_config.note("Using the new libc++ testing format")
 import libcxx.test.newformat
 config.test_format = libcxx.test.newformat.CxxStandardLibraryTest()
-else:
-config.test_format = configuration.get_test_format()



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] 0e04342 - [NFCI] Clean up exceptions related CMake and Lit options in libc++abi and libunwind

2020-06-09 Thread Louis Dionne via cfe-commits

Author: Louis Dionne
Date: 2020-06-09T15:34:29-04:00
New Revision: 0e04342ae0399876f3488464d12f5a4da5085456

URL: 
https://github.com/llvm/llvm-project/commit/0e04342ae0399876f3488464d12f5a4da5085456
DIFF: 
https://github.com/llvm/llvm-project/commit/0e04342ae0399876f3488464d12f5a4da5085456.diff

LOG: [NFCI] Clean up exceptions related CMake and Lit options in libc++abi and 
libunwind

First, libc++abi doesn't need to add the no-exceptions Lit feature itself,
since that is already done in the config.py for libc++, which it reuses.
Specifically, config.enable_exceptions is set based on 
@LIBCXXABI_ENABLE_EXCEPTIONS@
in libc++abi's lit.cfg.in, and libc++'s config.py handles that correctly.

Secondly, libunwind's LIBUNWIND_ENABLE_EXCEPTIONS is never set (it's
probably a remnant of copy-pasting code between the runtime libraries),
so the library is always built with exceptions disabled (which makes
sense since it implements the runtime support for exceptions).
Conversely, the test suite is always run with exceptions enabled
(not sure why), but that is preserved by the default behavior of
libc++'s config.py.

Added: 


Modified: 
libcxxabi/test/libcxxabi/test/config.py
libunwind/test/CMakeLists.txt
libunwind/test/libunwind/test/config.py
libunwind/test/lit.cfg
libunwind/test/lit.site.cfg.in

Removed: 




diff  --git a/libcxxabi/test/libcxxabi/test/config.py 
b/libcxxabi/test/libcxxabi/test/config.py
index fe76d193e79e..f1eb453e09f3 100644
--- a/libcxxabi/test/libcxxabi/test/config.py
+++ b/libcxxabi/test/libcxxabi/test/config.py
@@ -38,8 +38,6 @@ def has_cpp_feature(self, feature, required_value):
 
 def configure_features(self):
 super(Configuration, self).configure_features()
-if not self.get_lit_bool('enable_exceptions', True):
-self.config.available_features.add('no-exceptions')
 if not self.has_cpp_feature('noexcept_function_type', 201510):
 
self.config.available_features.add('libcxxabi-no-noexcept-function-type')
 if not self.get_lit_bool('llvm_unwinder', False):

diff  --git a/libunwind/test/CMakeLists.txt b/libunwind/test/CMakeLists.txt
index 40d4acd4e8c2..e608c1708b8a 100644
--- a/libunwind/test/CMakeLists.txt
+++ b/libunwind/test/CMakeLists.txt
@@ -15,7 +15,6 @@ pythonize_bool(LIBUNWIND_BUILD_32_BITS)
 pythonize_bool(LIBCXX_ENABLE_SHARED)
 pythonize_bool(LIBUNWIND_ENABLE_SHARED)
 pythonize_bool(LIBUNWIND_ENABLE_THREADS)
-pythonize_bool(LIBUNWIND_ENABLE_EXCEPTIONS)
 pythonize_bool(LIBUNWIND_USES_ARM_EHABI)
 pythonize_bool(LIBUNWIND_USE_COMPILER_RT)
 pythonize_bool(LIBUNWIND_BUILD_EXTERNAL_THREAD_LIBRARY)

diff  --git a/libunwind/test/libunwind/test/config.py 
b/libunwind/test/libunwind/test/config.py
index 36501f230272..7e4f230d821c 100644
--- a/libunwind/test/libunwind/test/config.py
+++ b/libunwind/test/libunwind/test/config.py
@@ -35,15 +35,11 @@ def has_cpp_feature(self, feature, required_value):
 
 def configure_features(self):
 super(Configuration, self).configure_features()
-if not self.get_lit_bool('enable_exceptions', True):
-self.config.available_features.add('no-exceptions')
 if self.get_lit_bool('arm_ehabi', False):
 self.config.available_features.add('libunwind-arm-ehabi')
 
 def configure_compile_flags(self):
 self.cxx.compile_flags += ['-DLIBUNWIND_NO_TIMER']
-if not self.get_lit_bool('enable_exceptions', True):
-self.cxx.compile_flags += ['-fno-exceptions', 
'-DLIBUNWIND_HAS_NO_EXCEPTIONS']
 # Stack unwinding tests need unwinding tables and these are not
 # generated by default on all Targets.
 self.cxx.compile_flags += ['-funwind-tables']

diff  --git a/libunwind/test/lit.cfg b/libunwind/test/lit.cfg
index 262f25af0d70..7f74bd6e4afb 100644
--- a/libunwind/test/lit.cfg
+++ b/libunwind/test/lit.cfg
@@ -23,9 +23,6 @@ config.suffixes = ['.cpp', '.s']
 # test_source_root: The root path where tests are located.
 config.test_source_root = os.path.dirname(__file__)
 
-# needed to test libunwind with code that throws exceptions
-config.enable_exceptions = True
-
 # Infer the libcxx_test_source_root for configuration import.
 # If libcxx_source_root isn't specified in the config, assume that the libcxx
 # and libunwind source directories are sibling directories.

diff  --git a/libunwind/test/lit.site.cfg.in b/libunwind/test/lit.site.cfg.in
index 37f90a90efdb..809ad1009f4b 100644
--- a/libunwind/test/lit.site.cfg.in
+++ b/libunwind/test/lit.site.cfg.in
@@ -18,7 +18,6 @@ config.test_compiler_flags  = 
"@LIBUNWIND_TEST_COMPILER_FLAGS@"
 config.executor = "@LIBUNWIND_EXECUTOR@"
 config.libunwind_shared = @LIBUNWIND_ENABLE_SHARED@
 config.enable_shared= @LIBCXX_ENABLE_SHARED@
-config.enable_exceptions= @LIBUNWIND_ENABLE_EXCEPTIONS@
 config.arm_ehabi= @LIBUNWIND_US

[libunwind] 168681a - [libc++abi][libunwind] Don't override libc++'s handling of exception features

2020-06-09 Thread Louis Dionne via cfe-commits

Author: Louis Dionne
Date: 2020-06-09T16:03:22-04:00
New Revision: 168681abce63d9cc0cec24cfc1d0caef6fa3a25f

URL: 
https://github.com/llvm/llvm-project/commit/168681abce63d9cc0cec24cfc1d0caef6fa3a25f
DIFF: 
https://github.com/llvm/llvm-project/commit/168681abce63d9cc0cec24cfc1d0caef6fa3a25f.diff

LOG: [libc++abi][libunwind] Don't override libc++'s handling of exception 
features

0e04342ae039 simplified exceptions-related configurations for libc++abi
and libunwind by reusing the logic in libc++. However, it missed the fact
that libc++abi and libunwind were overriding libc++'s handling of exceptions.

This commit removes special handling in libc++abi and libunwind to use
the logic in libc++, which is the right one.

Added: 


Modified: 
libcxxabi/test/libcxxabi/test/config.py
libunwind/test/libunwind/test/config.py

Removed: 




diff  --git a/libcxxabi/test/libcxxabi/test/config.py 
b/libcxxabi/test/libcxxabi/test/config.py
index f1eb453e09f3..37938d53a240 100644
--- a/libcxxabi/test/libcxxabi/test/config.py
+++ b/libcxxabi/test/libcxxabi/test/config.py
@@ -86,8 +86,5 @@ def configure_compile_flags_header_includes(self):
   % libunwind_headers)
 self.cxx.compile_flags += ['-I' + libunwind_headers]
 
-def configure_compile_flags_exceptions(self):
-pass
-
 def configure_compile_flags_rtti(self):
 pass

diff  --git a/libunwind/test/libunwind/test/config.py 
b/libunwind/test/libunwind/test/config.py
index 7e4f230d821c..31f6148879c5 100644
--- a/libunwind/test/libunwind/test/config.py
+++ b/libunwind/test/libunwind/test/config.py
@@ -59,9 +59,6 @@ def configure_compile_flags_header_includes(self):
   % libunwind_headers)
 self.cxx.compile_flags += ['-I' + libunwind_headers]
 
-def configure_compile_flags_exceptions(self):
-pass
-
 def configure_compile_flags_rtti(self):
 pass
 



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] 96e6cbb - [libc++] Allow specifying arbitrary custom executors with the new format

2020-06-11 Thread Louis Dionne via cfe-commits

Author: Louis Dionne
Date: 2020-06-11T16:24:29-04:00
New Revision: 96e6cbbf941d0f937b7e823433d4c222967a1817

URL: 
https://github.com/llvm/llvm-project/commit/96e6cbbf941d0f937b7e823433d4c222967a1817
DIFF: 
https://github.com/llvm/llvm-project/commit/96e6cbbf941d0f937b7e823433d4c222967a1817.diff

LOG: [libc++] Allow specifying arbitrary custom executors with the new format

The integration between CMake and executor selection in the new format
wasn't very flexible -- only the default executor and SSH executors were
supported.

This patch makes it possible to specify arbitrary executors with the new
format. With the new testing format, a custom executor is just a script
that gets called with a command-line to execute, and some arguments like
--env, --codesign_identity and --execdir. As such, the default executor
is just run.py.

Remote execution with the SSH executor can be achived by specifying
LIBCXX_EXECUTOR=" --host ". Similarly, arbitrary
scripts can be provided.

Added: 


Modified: 
libcxx/test/CMakeLists.txt
libcxx/utils/libcxx/test/config.py
libcxxabi/test/CMakeLists.txt
libunwind/test/CMakeLists.txt

Removed: 




diff  --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt
index 5068cbd1b1b0..b68f59f38e76 100644
--- a/libcxx/test/CMakeLists.txt
+++ b/libcxx/test/CMakeLists.txt
@@ -81,7 +81,7 @@ endif()
 
 set(LIBCXX_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING
 "TargetInfo to use when setting up test environment.")
-set(LIBCXX_EXECUTOR "None" CACHE STRING
+set(LIBCXX_EXECUTOR "${Python3_EXECUTABLE} 
${CMAKE_CURRENT_LIST_DIR}/../utils/run.py" CACHE STRING
 "Executor to use when running tests.")
 
 set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not 
edit!")

diff  --git a/libcxx/utils/libcxx/test/config.py 
b/libcxx/utils/libcxx/test/config.py
index 5eccc2783a74..44cb95943877 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -189,18 +189,22 @@ def get_test_format(self):
 exec_env=self.exec_env)
 
 def configure_executor(self):
-exec_str = self.get_lit_conf('executor', "None")
-te = eval(exec_str)
-if te:
-self.lit_config.note("Using executor: %r" % exec_str)
-if self.lit_config.useValgrind:
-self.lit_config.fatal("The libc++ test suite can't run under 
Valgrind with a custom executor")
-else:
-te = LocalExecutor()
+if self.get_lit_conf('use_old_format'):
+exec_str = self.get_lit_conf('executor', "None")
+te = eval(exec_str)
+if te:
+self.lit_config.note("Using executor: %r" % exec_str)
+if self.lit_config.useValgrind:
+self.lit_config.fatal("The libc++ test suite can't run 
under Valgrind with a custom executor")
+else:
+te = LocalExecutor()
 
-te.target_info = self.target_info
-self.target_info.executor = te
-self.executor = te
+te.target_info = self.target_info
+self.target_info.executor = te
+self.executor = te
+else:
+self.executor = self.get_lit_conf('executor')
+self.lit_config.note("Using executor: {}".format(self.executor))
 
 def configure_target_info(self):
 self.target_info = make_target_info(self)
@@ -751,14 +755,8 @@ def configure_substitutions(self):
 '--codesign_identity "{}"'.format(codesign_ident),
 '--env {}'.format(env_vars)
 ]
-if isinstance(self.executor, SSHExecutor):
-exec_args.append('--host {}'.format(self.executor.user_prefix + 
self.executor.host))
-executor = os.path.join(self.libcxx_src_root, 'utils', 'ssh.py')
-else:
-executor = os.path.join(self.libcxx_src_root, 'utils', 'run.py')
-sub.append(('%{exec}', '{} {} {} -- 
'.format(pipes.quote(sys.executable),
- pipes.quote(executor),
- ' '.join(exec_args
+if not self.get_lit_conf('use_old_format'):
+sub.append(('%{exec}', '{} {} -- '.format(self.executor, ' 
'.join(exec_args
 if self.get_lit_conf('libcxx_gdb'):
 sub.append(('%{libcxx_gdb}', self.get_lit_conf('libcxx_gdb')))
 

diff  --git a/libcxxabi/test/CMakeLists.txt b/libcxxabi/test/CMakeLists.txt
index bedfce8bc397..2160f52c3350 100644
--- a/libcxxabi/test/CMakeLists.txt
+++ b/libcxxabi/test/CMakeLists.txt
@@ -32,7 +32,7 @@ if(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX AND NOT 
LIBCXX_ENABLE_SHARED)
 endif()
 
 if(DEFINED LIBCXX_ENABLE_STATIC
-   AND NOT LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX 
+   AND NOT LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX
AND NOT LIBCXX_ENABLE_STATIC)
   message(FATAL_ERROR "LIBCXXABI

[libunwind] c55051e - [libunwind] Allow specifying custom Lit config files

2020-06-25 Thread Louis Dionne via cfe-commits

Author: Louis Dionne
Date: 2020-06-25T12:15:15-04:00
New Revision: c55051eea5d3cd57abfd9727f519b670517704d9

URL: 
https://github.com/llvm/llvm-project/commit/c55051eea5d3cd57abfd9727f519b670517704d9
DIFF: 
https://github.com/llvm/llvm-project/commit/c55051eea5d3cd57abfd9727f519b670517704d9.diff

LOG: [libunwind] Allow specifying custom Lit config files

This is the libunwind counterpart of 0c66af970c80.

Added: 
libunwind/test/lit.cfg.py

Modified: 
libunwind/CMakeLists.txt
libunwind/test/CMakeLists.txt
libunwind/test/lit.site.cfg.in

Removed: 
libunwind/test/lit.cfg



diff  --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt
index d3f791e17f10..7065112627a2 100644
--- a/libunwind/CMakeLists.txt
+++ b/libunwind/CMakeLists.txt
@@ -154,6 +154,8 @@ set(LIBUNWIND_TEST_LINKER_FLAGS "" CACHE STRING
 "Additional linker flags for test programs.")
 set(LIBUNWIND_TEST_COMPILER_FLAGS "" CACHE STRING
 "Additional compiler flags for test programs.")
+set(LIBUNWIND_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/lit.site.cfg.in" 
CACHE STRING
+"The Lit testing configuration to use when running the tests.")
 
 if (NOT LIBUNWIND_ENABLE_SHARED AND NOT LIBUNWIND_ENABLE_STATIC)
   message(FATAL_ERROR "libunwind must be built as either a shared or static 
library.")

diff  --git a/libunwind/test/CMakeLists.txt b/libunwind/test/CMakeLists.txt
index 26e7842b7a1f..794a59f58f84 100644
--- a/libunwind/test/CMakeLists.txt
+++ b/libunwind/test/CMakeLists.txt
@@ -25,12 +25,11 @@ set(LIBUNWIND_EXECUTOR "${Python3_EXECUTABLE} 
${LIBUNWIND_LIBCXX_PATH}/utils/run
 "Executor to use when running tests.")
 
 set(AUTO_GEN_COMMENT "## Autogenerated by libunwind configuration.\n# Do not 
edit!")
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+configure_lit_site_cfg(
+  "${LIBUNWIND_TEST_CONFIG}"
   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
-  @ONLY)
+  MAIN_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py")
 
 add_lit_testsuite(check-unwind "Running libunwind tests"
   ${CMAKE_CURRENT_BINARY_DIR}
-  DEPENDS ${LIBUNWIND_TEST_DEPS}
-  )
+  DEPENDS ${LIBUNWIND_TEST_DEPS})

diff  --git a/libunwind/test/lit.cfg b/libunwind/test/lit.cfg
deleted file mode 100644
index 7f74bd6e4afb..
--- a/libunwind/test/lit.cfg
+++ /dev/null
@@ -1,73 +0,0 @@
-# -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79:
-
-# Configuration file for the 'lit' test runner.
-
-
-import os
-import site
-
-site.addsitedir(os.path.dirname(__file__))
-
-
-# Tell pylint that we know config and lit_config exist somewhere.
-if 'PYLINT_IMPORT' in os.environ:
-config = object()
-lit_config = object()
-
-# name: The name of this test suite.
-config.name = 'libunwind'
-
-# suffixes: A list of file extensions to treat as test files.
-config.suffixes = ['.cpp', '.s']
-
-# test_source_root: The root path where tests are located.
-config.test_source_root = os.path.dirname(__file__)
-
-# Infer the libcxx_test_source_root for configuration import.
-# If libcxx_source_root isn't specified in the config, assume that the libcxx
-# and libunwind source directories are sibling directories.
-libcxx_src_root = getattr(config, 'libcxx_src_root', None)
-if not libcxx_src_root:
-libcxx_src_root = os.path.join(config.test_source_root, '../../libcxx')
-libcxx_test_src_root = os.path.join(libcxx_src_root, 'utils')
-if os.path.isfile(os.path.join(libcxx_test_src_root, 'libcxx', '__init__.py')):
-site.addsitedir(libcxx_test_src_root)
-else:
-lit_config.fatal('Could not find libcxx test directory for test imports'
- ' in: %s' % libcxx_test_src_root)
-
-# Infer the test_exec_root from the libcxx_object root.
-obj_root = getattr(config, 'libunwind_obj_root', None)
-
-# Check that the test exec root is known.
-if obj_root is None:
-import libcxx.test.config
-libcxx.test.config.loadSiteConfig(
-lit_config, config, 'libunwind_site_config', 'LIBUNWIND_SITE_CONFIG')
-obj_root = getattr(config, 'libunwind_obj_root', None)
-if obj_root is None:
-import tempfile
-obj_root = tempfile.mkdtemp(prefix='libunwind-testsuite-')
-lit_config.warning('Creating temporary directory for object root: %s' %
-   obj_root)
-
-config.test_exec_root = os.path.join(obj_root, 'test')
-
-cfg_variant = getattr(config, 'configuration_variant', 'libunwind')
-if cfg_variant:
-lit_config.note('Using configuration variant: %s' % cfg_variant)
-
-# Load the Configuration class from the module name .test.config.
-config_module_name = '.'.join([cfg_variant, 'test', 'config'])
-config_module = __import__(config_module_name, fromlist=['Configuration'])
-
-configuration = config_module.Configuration(lit_config, config)
-configuration.configure()
-configuration.print_config_info()
-if lit_config.params.get('use_old_format', False):
-lit_config.note("Using the old libc++ testing for

[libunwind] 70f6389 - [runtimes] Rename newformat to just format, now that the old format has been removed

2020-06-30 Thread Louis Dionne via cfe-commits

Author: Louis Dionne
Date: 2020-06-30T10:10:30-04:00
New Revision: 70f6389257a85a8fa7f128a05a1ccbd0dbba191c

URL: 
https://github.com/llvm/llvm-project/commit/70f6389257a85a8fa7f128a05a1ccbd0dbba191c
DIFF: 
https://github.com/llvm/llvm-project/commit/70f6389257a85a8fa7f128a05a1ccbd0dbba191c.diff

LOG: [runtimes] Rename newformat to just format, now that the old format has 
been removed

Added: 

libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp

libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-run.sh.cpp
libcxx/test/libcxx/selftest/compile.fail.cpp/compile-error.compile.fail.cpp

libcxx/test/libcxx/selftest/compile.fail.cpp/compile-success.compile.fail.cpp
libcxx/test/libcxx/selftest/compile.pass.cpp/compile-error.compile.pass.cpp

libcxx/test/libcxx/selftest/compile.pass.cpp/compile-success.compile.pass.cpp
libcxx/test/libcxx/selftest/compile.pass.cpp/link-error.compile.pass.cpp
libcxx/test/libcxx/selftest/compile.pass.cpp/run-error.compile.pass.cpp
libcxx/test/libcxx/selftest/convenience_substitutions/build_run.sh.cpp
libcxx/test/libcxx/selftest/fail.cpp/compile-failure.fail.cpp
libcxx/test/libcxx/selftest/fail.cpp/compile-success.fail.cpp
libcxx/test/libcxx/selftest/fail.cpp/lit.local.cfg
libcxx/test/libcxx/selftest/fail.cpp/no-diagnostics-unmarked.fail.cpp
libcxx/test/libcxx/selftest/fail.cpp/no-diagnostics.fail.cpp
libcxx/test/libcxx/selftest/fail.cpp/right-diagnostic.fail.cpp
libcxx/test/libcxx/selftest/fail.cpp/wrong-diagnostic.fail.cpp
libcxx/test/libcxx/selftest/file_dependencies/a.txt

libcxx/test/libcxx/selftest/file_dependencies/absolute-and-relative-paths.sh.cpp
libcxx/test/libcxx/selftest/file_dependencies/dir/b.txt

libcxx/test/libcxx/selftest/file_dependencies/substitute-in-dependencies.sh.cpp
libcxx/test/libcxx/selftest/link.fail.cpp/compile-error.link.fail.cpp
libcxx/test/libcxx/selftest/link.fail.cpp/link-error.link.fail.cpp
libcxx/test/libcxx/selftest/link.fail.cpp/link-success.link.fail.cpp
libcxx/test/libcxx/selftest/link.pass.cpp/compile-error.link.pass.cpp
libcxx/test/libcxx/selftest/link.pass.cpp/link-error.link.pass.cpp
libcxx/test/libcxx/selftest/link.pass.cpp/link-success.link.pass.cpp
libcxx/test/libcxx/selftest/link.pass.cpp/run-error.link.pass.cpp
libcxx/test/libcxx/selftest/pass.cpp/compile-error.pass.cpp
libcxx/test/libcxx/selftest/pass.cpp/link-error.pass.cpp
libcxx/test/libcxx/selftest/pass.cpp/run-error.pass.cpp
libcxx/test/libcxx/selftest/pass.cpp/run-success.pass.cpp
libcxx/test/libcxx/selftest/pass.cpp/werror.pass.cpp
libcxx/test/libcxx/selftest/pass.mm/compile-error.pass.mm
libcxx/test/libcxx/selftest/pass.mm/link-error.pass.mm
libcxx/test/libcxx/selftest/pass.mm/no-arc.pass.mm
libcxx/test/libcxx/selftest/pass.mm/run-error.pass.mm
libcxx/test/libcxx/selftest/pass.mm/run-success.pass.mm
libcxx/test/libcxx/selftest/pass.mm/use-objective-cxx.pass.mm
libcxx/test/libcxx/selftest/remote-substitutions.sh.cpp
libcxx/test/libcxx/selftest/run.fail.cpp/compile-error.run.fail.cpp
libcxx/test/libcxx/selftest/run.fail.cpp/link-error.run.fail.cpp
libcxx/test/libcxx/selftest/run.fail.cpp/run-error.run.fail.cpp
libcxx/test/libcxx/selftest/run.fail.cpp/run-success.run.fail.cpp
libcxx/test/libcxx/selftest/sh.cpp/empty.sh.cpp
libcxx/test/libcxx/selftest/sh.cpp/run-error.sh.cpp
libcxx/test/libcxx/selftest/sh.cpp/run-success.sh.cpp
libcxx/test/libcxx/selftest/sh.cpp/substitutions.sh.cpp
libcxx/test/libcxx/selftest/sh.cpp/werror.sh.cpp
libcxx/test/libcxx/selftest/shell-escape-pipes.sh.cpp
libcxx/test/libcxx/selftest/shell-escape.sh.cpp
libcxx/test/libcxx/selftest/tmpdir-exists.sh.cpp
libcxx/test/libcxx/selftest/verify.cpp/no-diagnostics-unmarked.verify.cpp
libcxx/test/libcxx/selftest/verify.cpp/no-diagnostics.verify.cpp
libcxx/test/libcxx/selftest/verify.cpp/no-werror.verify.cpp
libcxx/test/libcxx/selftest/verify.cpp/right-diagnostic.verify.cpp
libcxx/test/libcxx/selftest/verify.cpp/wrong-diagnostic.verify.cpp
libcxx/utils/libcxx/test/format.py

Modified: 
libcxx/test/lit.site.cfg.in
libcxx/utils/libcxx/test/dsl.py
libcxxabi/test/lit.site.cfg.in
libunwind/test/lit.site.cfg.in

Removed: 

libcxx/test/libcxx/selftest/newformat/additional_compile_flags/substitutes-in-compile-flags.sh.cpp

libcxx/test/libcxx/selftest/newformat/additional_compile_flags/substitutes-in-run.sh.cpp

libcxx/test/libcxx/selftest/newformat/compile.fail.cpp/compile-error.compile.fail.cpp

libcxx/test/libcxx/selftest/newformat/compile.fail.cpp/compile-success.compile.fail.cpp

libcxx/test/libcxx/selftest/newformat/compile.pass.cpp/compile-error.compile.pass.cpp

libcxx/test/libcxx/selftest/newformat/compile.pass.cpp/compile-success.compile.pass.cpp

libcxx/test/libcxx/selftest/newformat/compile.

[libunwind] e8dac8b - [libunwind][NFC] Fix typo in comment

2020-08-11 Thread Louis Dionne via cfe-commits

Author: Louis Dionne
Date: 2020-08-11T15:24:52-04:00
New Revision: e8dac8b3dbe7a31af291032f1f3e95e789200590

URL: 
https://github.com/llvm/llvm-project/commit/e8dac8b3dbe7a31af291032f1f3e95e789200590
DIFF: 
https://github.com/llvm/llvm-project/commit/e8dac8b3dbe7a31af291032f1f3e95e789200590.diff

LOG: [libunwind][NFC] Fix typo in comment

Added: 


Modified: 
libunwind/src/UnwindCursor.hpp

Removed: 




diff  --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp
index f346c720d22c..48902ea0250c 100644
--- a/libunwind/src/UnwindCursor.hpp
+++ b/libunwind/src/UnwindCursor.hpp
@@ -1759,7 +1759,7 @@ bool UnwindCursor::getInfoFromCompactEncodingSection(pint_t pc,
 }
   }
 
-  // extact personality routine, if encoding says function has one
+  // extract personality routine, if encoding says function has one
   uint32_t personalityIndex = (encoding & UNWIND_PERSONALITY_MASK) >>
   (__builtin_ctz(UNWIND_PERSONALITY_MASK));
   if (personalityIndex != 0) {



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] 9b211a5 - [libunwind] Fix incorrect check for out-of-boundedness

2020-08-11 Thread Louis Dionne via cfe-commits

Author: Louis Dionne
Date: 2020-08-11T15:37:57-04:00
New Revision: 9b211a5076310f14081dd257b0cbac6857534bc3

URL: 
https://github.com/llvm/llvm-project/commit/9b211a5076310f14081dd257b0cbac6857534bc3
DIFF: 
https://github.com/llvm/llvm-project/commit/9b211a5076310f14081dd257b0cbac6857534bc3.diff

LOG: [libunwind] Fix incorrect check for out-of-boundedness

If the personalityIndex (which is 0-based) is equal to the length of
the personality array, we should error out.

rdar://18013273

Added: 


Modified: 
libunwind/src/UnwindCursor.hpp

Removed: 




diff  --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp
index 48902ea0250c..03e21fb87a8d 100644
--- a/libunwind/src/UnwindCursor.hpp
+++ b/libunwind/src/UnwindCursor.hpp
@@ -1764,7 +1764,7 @@ bool UnwindCursor::getInfoFromCompactEncodingSection(pint_t pc,
   (__builtin_ctz(UNWIND_PERSONALITY_MASK));
   if (personalityIndex != 0) {
 --personalityIndex; // change 1-based to zero-based index
-if (personalityIndex > sectionHeader.personalityArrayCount()) {
+if (personalityIndex >= sectionHeader.personalityArrayCount()) {
   _LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with personality index %d,  "
 "but personality table has only %d entries",
 encoding, personalityIndex,



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 9aee35b - [Clang] Fix the incorrect return type of atomic_is_lock_free

2020-05-11 Thread Louis Dionne via cfe-commits

Author: Kamlesh Kumar
Date: 2020-05-11T10:48:35-04:00
New Revision: 9aee35bcc90faa9db3ea0111c0a80ebee7446cac

URL: 
https://github.com/llvm/llvm-project/commit/9aee35bcc90faa9db3ea0111c0a80ebee7446cac
DIFF: 
https://github.com/llvm/llvm-project/commit/9aee35bcc90faa9db3ea0111c0a80ebee7446cac.diff

LOG: [Clang] Fix the incorrect return type of atomic_is_lock_free

Fixing the return type of atomic_is_lock_free as per
https://en.cppreference.com/w/c/atomic/atomic_is_lock_free

Differential Revision: https://reviews.llvm.org/D79504

Added: 


Modified: 
clang/include/clang/Basic/Builtins.def
clang/test/CodeGen/atomic-ops.c
clang/test/CodeGen/big-atomic-ops.c

Removed: 




diff  --git a/clang/include/clang/Basic/Builtins.def 
b/clang/include/clang/Basic/Builtins.def
index 9613f312d52d..4f1a7f24c432 100644
--- a/clang/include/clang/Basic/Builtins.def
+++ b/clang/include/clang/Basic/Builtins.def
@@ -724,7 +724,7 @@ ATOMIC_BUILTIN(__c11_atomic_fetch_max, "v.", "t")
 ATOMIC_BUILTIN(__c11_atomic_fetch_min, "v.", "t")
 BUILTIN(__c11_atomic_thread_fence, "vi", "n")
 BUILTIN(__c11_atomic_signal_fence, "vi", "n")
-BUILTIN(__c11_atomic_is_lock_free, "iz", "n")
+BUILTIN(__c11_atomic_is_lock_free, "bz", "n")
 
 // GNU atomic builtins.
 ATOMIC_BUILTIN(__atomic_load, "v.", "t")
@@ -753,8 +753,8 @@ BUILTIN(__atomic_test_and_set, "bvD*i", "n")
 BUILTIN(__atomic_clear, "vvD*i", "n")
 BUILTIN(__atomic_thread_fence, "vi", "n")
 BUILTIN(__atomic_signal_fence, "vi", "n")
-BUILTIN(__atomic_always_lock_free, "izvCD*", "n")
-BUILTIN(__atomic_is_lock_free, "izvCD*", "n")
+BUILTIN(__atomic_always_lock_free, "bzvCD*", "n")
+BUILTIN(__atomic_is_lock_free, "bzvCD*", "n")
 
 // OpenCL 2.0 atomic builtins.
 ATOMIC_BUILTIN(__opencl_atomic_init, "v.", "t")

diff  --git a/clang/test/CodeGen/atomic-ops.c b/clang/test/CodeGen/atomic-ops.c
index 25ecb4328876..2cf5d2beb3a8 100644
--- a/clang/test/CodeGen/atomic-ops.c
+++ b/clang/test/CodeGen/atomic-ops.c
@@ -343,20 +343,20 @@ struct Incomplete;
 int lock_free(struct Incomplete *incomplete) {
   // CHECK-LABEL: @lock_free
 
-  // CHECK: call i32 @__atomic_is_lock_free(i32 3, i8* null)
+  // CHECK: call zeroext i1 @__atomic_is_lock_free(i32 3, i8* null)
   __c11_atomic_is_lock_free(3);
 
-  // CHECK: call i32 @__atomic_is_lock_free(i32 16, i8* {{.*}}@sixteen{{.*}})
+  // CHECK: call zeroext i1 @__atomic_is_lock_free(i32 16, i8* 
{{.*}}@sixteen{{.*}})
   __atomic_is_lock_free(16, &sixteen);
 
-  // CHECK: call i32 @__atomic_is_lock_free(i32 17, i8* {{.*}}@seventeen{{.*}})
+  // CHECK: call zeroext i1 @__atomic_is_lock_free(i32 17, i8* 
{{.*}}@seventeen{{.*}})
   __atomic_is_lock_free(17, &seventeen);
 
-  // CHECK: call i32 @__atomic_is_lock_free(i32 4, {{.*}})
+  // CHECK: call zeroext i1 @__atomic_is_lock_free(i32 4, {{.*}})
   __atomic_is_lock_free(4, incomplete);
 
   char cs[20];
-  // CHECK: call i32 @__atomic_is_lock_free(i32 4, {{.*}})
+  // CHECK: call zeroext i1 @__atomic_is_lock_free(i32 4, {{.*}})
   __atomic_is_lock_free(4, cs+1);
 
   // CHECK-NOT: call

diff  --git a/clang/test/CodeGen/big-atomic-ops.c 
b/clang/test/CodeGen/big-atomic-ops.c
index 6a7a7001f96d..b06302f73f96 100644
--- a/clang/test/CodeGen/big-atomic-ops.c
+++ b/clang/test/CodeGen/big-atomic-ops.c
@@ -198,20 +198,20 @@ struct Seventeen {
 int lock_free(struct Incomplete *incomplete) {
   // CHECK: @lock_free
 
-  // CHECK: call i32 @__atomic_is_lock_free(i64 3, i8* null)
+  // CHECK: call zeroext i1 @__atomic_is_lock_free(i64 3, i8* null)
   __c11_atomic_is_lock_free(3);
 
-  // CHECK: call i32 @__atomic_is_lock_free(i64 16, i8* {{.*}}@sixteen{{.*}})
+  // CHECK: call zeroext i1 @__atomic_is_lock_free(i64 16, i8* 
{{.*}}@sixteen{{.*}})
   __atomic_is_lock_free(16, &sixteen);
 
-  // CHECK: call i32 @__atomic_is_lock_free(i64 17, i8* {{.*}}@seventeen{{.*}})
+  // CHECK: call zeroext i1 @__atomic_is_lock_free(i64 17, i8* 
{{.*}}@seventeen{{.*}})
   __atomic_is_lock_free(17, &seventeen);
 
-  // CHECK: call i32 @__atomic_is_lock_free(i64 4, {{.*}})
+  // CHECK: call zeroext i1 @__atomic_is_lock_free(i64 4, {{.*}})
   __atomic_is_lock_free(4, incomplete);
 
   char cs[20];
-  // CHECK: call i32 @__atomic_is_lock_free(i64 4, {{.*}})
+  // CHECK: call zeroext i1 @__atomic_is_lock_free(i64 4, {{.*}})
   __atomic_is_lock_free(4, cs+1);
 
   // CHECK-NOT: call



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] 6332a00 - [libunwind] Fix a few libunwind includes

2022-09-07 Thread Louis Dionne via cfe-commits

Author: Ryan Prichard
Date: 2022-09-07T22:18:09-04:00
New Revision: 6332a00d696d37942f2743851c86f1d4493968f0

URL: 
https://github.com/llvm/llvm-project/commit/6332a00d696d37942f2743851c86f1d4493968f0
DIFF: 
https://github.com/llvm/llvm-project/commit/6332a00d696d37942f2743851c86f1d4493968f0.diff

LOG: [libunwind] Fix a few libunwind includes

In UnwindCursor.hpp, include config.h before checking 
_LIBUNWIND_SUPPORT_SEH_UNWIND.

Include libunwind_ext.h for UNW_STEP_SUCCESS.

Differential Revision: https://reviews.llvm.org/D86766

Added: 


Modified: 
libunwind/src/CompactUnwinder.hpp
libunwind/src/DwarfInstructions.hpp
libunwind/src/UnwindCursor.hpp

Removed: 




diff  --git a/libunwind/src/CompactUnwinder.hpp 
b/libunwind/src/CompactUnwinder.hpp
index 0b2b5e111bfc2..a7a8a153d86a4 100644
--- a/libunwind/src/CompactUnwinder.hpp
+++ b/libunwind/src/CompactUnwinder.hpp
@@ -19,6 +19,7 @@
 #include 
 
 #include "Registers.hpp"
+#include "libunwind_ext.h"
 
 #define EXTRACT_BITS(value, mask)  
\
   ((value >> __builtin_ctz(mask)) & (((1 << __builtin_popcount(mask))) - 1))

diff  --git a/libunwind/src/DwarfInstructions.hpp 
b/libunwind/src/DwarfInstructions.hpp
index 77f13832d68fd..f81f96ce5a36d 100644
--- a/libunwind/src/DwarfInstructions.hpp
+++ b/libunwind/src/DwarfInstructions.hpp
@@ -16,10 +16,11 @@
 #include 
 #include 
 
-#include "dwarf2.h"
-#include "Registers.hpp"
 #include "DwarfParser.hpp"
+#include "Registers.hpp"
 #include "config.h"
+#include "dwarf2.h"
+#include "libunwind_ext.h"
 
 
 namespace libunwind {

diff  --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp
index e8b9556c035aa..27eca08191495 100644
--- a/libunwind/src/UnwindCursor.hpp
+++ b/libunwind/src/UnwindCursor.hpp
@@ -38,6 +38,17 @@
 #define _LIBUNWIND_CHECK_LINUX_SIGRETURN 1
 #endif
 
+#include "AddressSpace.hpp"
+#include "CompactUnwinder.hpp"
+#include "config.h"
+#include "DwarfInstructions.hpp"
+#include "EHHeaderParser.hpp"
+#include "libunwind.h"
+#include "libunwind_ext.h"
+#include "Registers.hpp"
+#include "RWMutex.hpp"
+#include "Unwind-EHABI.h"
+
 #if defined(_LIBUNWIND_SUPPORT_SEH_UNWIND)
 // Provide a definition for the DISPATCHER_CONTEXT struct for old (Win7 and
 // earlier) SDKs.
@@ -75,18 +86,6 @@ extern "C" _Unwind_Reason_Code __libunwind_seh_personality(
 
 #endif
 
-#include "config.h"
-
-#include "AddressSpace.hpp"
-#include "CompactUnwinder.hpp"
-#include "config.h"
-#include "DwarfInstructions.hpp"
-#include "EHHeaderParser.hpp"
-#include "libunwind.h"
-#include "Registers.hpp"
-#include "RWMutex.hpp"
-#include "Unwind-EHABI.h"
-
 namespace libunwind {
 
 #if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[flang] [compiler-rt] [clang-tools-extra] [clang] [libc] [lld] [llvm] [libcxxabi] [libcxx] [libc++] Fix the behavior of throwing `operator new` under -fno-exceptions (PR #69498)

2023-11-06 Thread Louis Dionne via cfe-commits

https://github.com/ldionne updated 
https://github.com/llvm/llvm-project/pull/69498

>From 77c0256c3ae99808a8def68bfcf5eee2fad704ca Mon Sep 17 00:00:00 2001
From: Louis Dionne 
Date: Wed, 14 Jun 2023 17:49:22 -0700
Subject: [PATCH 1/8] [libc++] Fix the behavior of throwing `operator new`
 under -fno-exceptions

In D144319, Clang tried to land a change that would cause some functions
that are not supposed to return nullptr to optimize better. As reported
in https://reviews.llvm.org/D144319#4203982, libc++ started seeing failures
in its CI shortly after this change was landed.

As explained in D146379, the reason for these failures is that libc++'s
throwing `operator new` can in fact return nullptr when compiled with
exceptions disabled. However, this contradicts the Standard, which
clearly says that the throwing version of `operator new(size_t)`
should never return nullptr. This is actually a long standing issue.
I've previously seen a case where LTO would optimize incorrectly based
on the assumption that `operator new` doesn't return nullptr, an
assumption that was violated in that case because libc++.dylib was
compiled with -fno-exceptions.

Unfortunately, fixing this is kind of tricky. The Standard has a few
requirements for the allocation functions, some of which are impossible
to satisfy under -fno-exceptions:
1. `operator new(size_t)` must never return nullptr
2. `operator new(size_t, nothrow_t)` must call the throwing version
 and return nullptr on failure to allocate
3. We can't throw exceptions when compiled with -fno-exceptions

In the case where exceptions are enabled, things work nicely. `new(size_t)`
throws and `new(size_t, nothrow_t)` uses a try-catch to return nullptr.
However, when compiling the library with -fno-exceptions, we can't throw
an exception from `new(size_t)`, and we can't catch anything from
`new(size_t, nothrow_t)`. The only thing we can do from `new(size_t)`
is actually abort the program, which does not make it possible for
`new(size_t, nothrow_t)` to catch something and return nullptr.

This patch makes the following changes:
1. When compiled with -fno-exceptions, the throwing version of
   `operator new` will now abort on failure instead of returning
   nullptr on failure. This resolves the issue that the compiler
   could mis-compile based on the assumption that nullptr is never
   returned. This constitutes an API and ABI breaking change for
   folks compiling the library with -fno-exceptions (which is not
   the general public, who merely uses libc++ headers but use a
   shared library that has already been compiled). This should mostly
   impact vendors and other folks who compile libc++.dylib themselves.

2. When the library is compiled with -fexceptions, the nothrow version
   of `operator new` has no change. When the library is compiled with
   -fno-exceptions, the nothrow version of `operator new` will now check
   whether the throwing version of `operator new` has been overridden.
   If it has not been overridden, then it will use an implementation
   equivalent to that of the throwing `operator new`, except it will
   return nullptr on failure to allocate (instead of terminating).
   However, if the throwing `operator new` has been overridden, it is
   now an error NOT to also override the nothrow `operator new`. Indeed,
   there is no way for us to implement a valid nothrow `operator new`
   without knowing the exact implementation of the throwing version.

rdar://103958777

Differential Revision: https://reviews.llvm.org/D150610
---
 libcxx/docs/ReleaseNotes/18.rst   | 23 +
 libcxx/include/CMakeLists.txt |  1 +
 libcxx/include/__overridable_function | 38 
 libcxx/include/new|  9 +-
 libcxx/src/new.cpp| 79 +++-
 ...new_not_overridden_fno_exceptions.pass.cpp | 56 
 .../new_dont_return_nullptr.pass.cpp  | 37 
 libcxx/test/support/check_assertion.h |  6 ++
 libcxxabi/src/stdlib_new_delete.cpp   | 90 ++-
 9 files changed, 291 insertions(+), 48 deletions(-)
 create mode 100644 libcxx/include/__overridable_function
 create mode 100644 
libcxx/test/libcxx/language.support/support.dynamic/assert.nothrow_new_not_overridden_fno_exceptions.pass.cpp
 create mode 100644 
libcxx/test/libcxx/language.support/support.dynamic/new_dont_return_nullptr.pass.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index ac78563aa73848f..bf017613a01b892 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -118,6 +118,29 @@ LLVM 20
 ABI Affecting Changes
 -
 
+- When the shared/static library is built with ``-fno-exceptions``, the 
behavior of ``operator new`` was changed
+  to make it standards-conforming. In LLVM 17 and before, the throwing 
versions of ``operator new`` would return
+  ``nullptr`` upon failure to allocate, when 

[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-11-08 Thread Louis Dionne via cfe-commits

https://github.com/ldionne requested changes to this pull request.

I think this is generally reasonable but I'm requesting a few changes.

https://github.com/llvm/llvm-project/pull/70817
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-11-08 Thread Louis Dionne via cfe-commits


@@ -2494,6 +2494,19 @@ void DarwinClang::AddClangCXXStdlibIncludeArgs(
<< "\"\n";
 }
 
+// Check for the folder where the executable is located, if different.
+if (getDriver().getInstalledDir() != getDriver().Dir) {
+  InstallBin = llvm::StringRef(getDriver().Dir.c_str());
+  llvm::sys::path::append(InstallBin, "..", "include", "c++", "v1");
+  if (getVFS().exists(InstallBin)) {
+addSystemInclude(DriverArgs, CC1Args, InstallBin);
+return;
+  } else if (DriverArgs.hasArg(options::OPT_v)) {
+llvm::errs() << "ignoring nonexistent directory \"" << InstallBin
+ << "\"\n";
+  }
+}
+
 // Otherwise, check for (2)

ldionne wrote:

```suggestion
// Otherwise, check for (3)
```

https://github.com/llvm/llvm-project/pull/70817
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-11-08 Thread Louis Dionne via cfe-commits


@@ -2494,6 +2494,19 @@ void DarwinClang::AddClangCXXStdlibIncludeArgs(
<< "\"\n";
 }
 
+// Check for the folder where the executable is located, if different.
+if (getDriver().getInstalledDir() != getDriver().Dir) {
+  InstallBin = llvm::StringRef(getDriver().Dir.c_str());
+  llvm::sys::path::append(InstallBin, "..", "include", "c++", "v1");
+  if (getVFS().exists(InstallBin)) {
+addSystemInclude(DriverArgs, CC1Args, InstallBin);
+return;
+  } else if (DriverArgs.hasArg(options::OPT_v)) {
+llvm::errs() << "ignoring nonexistent directory \"" << InstallBin
+ << "\"\n";
+  }
+}
+
 // Otherwise, check for (2)
 llvm::SmallString<128> SysrootUsr = Sysroot;
 llvm::sys::path::append(SysrootUsr, "usr", "include", "c++", "v1");

ldionne wrote:

Not attached to this line: please add tests for this new behavior.

https://github.com/llvm/llvm-project/pull/70817
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-11-08 Thread Louis Dionne via cfe-commits


@@ -2494,6 +2494,19 @@ void DarwinClang::AddClangCXXStdlibIncludeArgs(
<< "\"\n";

ldionne wrote:

Please update the documentation above:

```
// On Darwin, libc++ can be installed in one of the following places:
// 1. Alongside the compiler in /include/c++/v1
// 2. Alongside the compiler in 
/../include/c++/v1
// 3. In a SDK (or a custom sysroot) in /usr/include/c++/v1
//
// The precedence of paths is as listed above, i.e. we take the first path
// that exists. Note that we never include libc++ twice -- we take the first
// path that exists and don't send the other paths to CC1 (otherwise 
// include_next could break).
//
// Also note that in most cases, (1) and (2) are exactly the same path.
// Those two paths will differ only when the `clang` program being run
// is actually a symlink to the real executable.
```

https://github.com/llvm/llvm-project/pull/70817
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-11-08 Thread Louis Dionne via cfe-commits


@@ -2494,6 +2494,19 @@ void DarwinClang::AddClangCXXStdlibIncludeArgs(
<< "\"\n";
 }
 
+// Check for the folder where the executable is located, if different.

ldionne wrote:

```suggestion
// (2) Check for the folder where the executable is located, if different.
```

https://github.com/llvm/llvm-project/pull/70817
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-11-08 Thread Louis Dionne via cfe-commits

https://github.com/ldionne edited 
https://github.com/llvm/llvm-project/pull/70817
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [libc++][hardening] Fix references to old names for hardening modes (PR #71743)

2023-11-08 Thread Louis Dionne via cfe-commits

https://github.com/ldionne approved this pull request.


https://github.com/llvm/llvm-project/pull/71743
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [libc++][hardening] Fix references to old names for hardening modes (PR #71743)

2023-11-08 Thread Louis Dionne via cfe-commits


@@ -116,7 +116,7 @@ else()
   set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
   set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
   set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
-  set(LIBCXX_HARDENING_MODE "unchecked" CACHE STRING "")
+  set(LIBCXX_HARDENING_MODE "none" CACHE STRING "")

ldionne wrote:

@petrhosek Can we set up a Fuchsia build bot? We even have one for Android now!

https://github.com/llvm/llvm-project/pull/71743
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [libc++][hardening] Fix references to old names for hardening modes (PR #71743)

2023-11-08 Thread Louis Dionne via cfe-commits

https://github.com/ldionne edited 
https://github.com/llvm/llvm-project/pull/71743
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-11-08 Thread Louis Dionne via cfe-commits


@@ -2494,6 +2494,19 @@ void DarwinClang::AddClangCXXStdlibIncludeArgs(
<< "\"\n";
 }
 
+// Check for the folder where the executable is located, if different.
+if (getDriver().getInstalledDir() != getDriver().Dir) {
+  InstallBin = llvm::StringRef(getDriver().Dir.c_str());
+  llvm::sys::path::append(InstallBin, "..", "include", "c++", "v1");
+  if (getVFS().exists(InstallBin)) {
+addSystemInclude(DriverArgs, CC1Args, InstallBin);
+return;
+  } else if (DriverArgs.hasArg(options::OPT_v)) {
+llvm::errs() << "ignoring nonexistent directory \"" << InstallBin
+ << "\"\n";
+  }
+}
+
 // Otherwise, check for (2)
 llvm::SmallString<128> SysrootUsr = Sysroot;
 llvm::sys::path::append(SysrootUsr, "usr", "include", "c++", "v1");

ldionne wrote:

I think you probably want to add new tests in 
`clang/test/Driver/darwin-header-search-libcxx.cpp`. You also mentioned that 
other platforms (e.g. Linux?) handle search paths this way, right? Can you show 
where this is handled? They might have some tests you could take inspiration 
from?

https://github.com/llvm/llvm-project/pull/70817
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] [compiler-rt] [clang] [lld] [flang] [libcxxabi] [clang-tools-extra] [llvm] [libc] [libc++] Fix the behavior of throwing `operator new` under -fno-exceptions (PR #69498)

2023-11-08 Thread Louis Dionne via cfe-commits

https://github.com/ldionne updated 
https://github.com/llvm/llvm-project/pull/69498

>From 77c0256c3ae99808a8def68bfcf5eee2fad704ca Mon Sep 17 00:00:00 2001
From: Louis Dionne 
Date: Wed, 14 Jun 2023 17:49:22 -0700
Subject: [PATCH 1/9] [libc++] Fix the behavior of throwing `operator new`
 under -fno-exceptions

In D144319, Clang tried to land a change that would cause some functions
that are not supposed to return nullptr to optimize better. As reported
in https://reviews.llvm.org/D144319#4203982, libc++ started seeing failures
in its CI shortly after this change was landed.

As explained in D146379, the reason for these failures is that libc++'s
throwing `operator new` can in fact return nullptr when compiled with
exceptions disabled. However, this contradicts the Standard, which
clearly says that the throwing version of `operator new(size_t)`
should never return nullptr. This is actually a long standing issue.
I've previously seen a case where LTO would optimize incorrectly based
on the assumption that `operator new` doesn't return nullptr, an
assumption that was violated in that case because libc++.dylib was
compiled with -fno-exceptions.

Unfortunately, fixing this is kind of tricky. The Standard has a few
requirements for the allocation functions, some of which are impossible
to satisfy under -fno-exceptions:
1. `operator new(size_t)` must never return nullptr
2. `operator new(size_t, nothrow_t)` must call the throwing version
 and return nullptr on failure to allocate
3. We can't throw exceptions when compiled with -fno-exceptions

In the case where exceptions are enabled, things work nicely. `new(size_t)`
throws and `new(size_t, nothrow_t)` uses a try-catch to return nullptr.
However, when compiling the library with -fno-exceptions, we can't throw
an exception from `new(size_t)`, and we can't catch anything from
`new(size_t, nothrow_t)`. The only thing we can do from `new(size_t)`
is actually abort the program, which does not make it possible for
`new(size_t, nothrow_t)` to catch something and return nullptr.

This patch makes the following changes:
1. When compiled with -fno-exceptions, the throwing version of
   `operator new` will now abort on failure instead of returning
   nullptr on failure. This resolves the issue that the compiler
   could mis-compile based on the assumption that nullptr is never
   returned. This constitutes an API and ABI breaking change for
   folks compiling the library with -fno-exceptions (which is not
   the general public, who merely uses libc++ headers but use a
   shared library that has already been compiled). This should mostly
   impact vendors and other folks who compile libc++.dylib themselves.

2. When the library is compiled with -fexceptions, the nothrow version
   of `operator new` has no change. When the library is compiled with
   -fno-exceptions, the nothrow version of `operator new` will now check
   whether the throwing version of `operator new` has been overridden.
   If it has not been overridden, then it will use an implementation
   equivalent to that of the throwing `operator new`, except it will
   return nullptr on failure to allocate (instead of terminating).
   However, if the throwing `operator new` has been overridden, it is
   now an error NOT to also override the nothrow `operator new`. Indeed,
   there is no way for us to implement a valid nothrow `operator new`
   without knowing the exact implementation of the throwing version.

rdar://103958777

Differential Revision: https://reviews.llvm.org/D150610
---
 libcxx/docs/ReleaseNotes/18.rst   | 23 +
 libcxx/include/CMakeLists.txt |  1 +
 libcxx/include/__overridable_function | 38 
 libcxx/include/new|  9 +-
 libcxx/src/new.cpp| 79 +++-
 ...new_not_overridden_fno_exceptions.pass.cpp | 56 
 .../new_dont_return_nullptr.pass.cpp  | 37 
 libcxx/test/support/check_assertion.h |  6 ++
 libcxxabi/src/stdlib_new_delete.cpp   | 90 ++-
 9 files changed, 291 insertions(+), 48 deletions(-)
 create mode 100644 libcxx/include/__overridable_function
 create mode 100644 
libcxx/test/libcxx/language.support/support.dynamic/assert.nothrow_new_not_overridden_fno_exceptions.pass.cpp
 create mode 100644 
libcxx/test/libcxx/language.support/support.dynamic/new_dont_return_nullptr.pass.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index ac78563aa73848f..bf017613a01b892 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -118,6 +118,29 @@ LLVM 20
 ABI Affecting Changes
 -
 
+- When the shared/static library is built with ``-fno-exceptions``, the 
behavior of ``operator new`` was changed
+  to make it standards-conforming. In LLVM 17 and before, the throwing 
versions of ``operator new`` would return
+  ``nullptr`` upon failure to allocate, when 

[clang-tools-extra] [clang] [llvm] [libcxx] [libc++] P2770R0: "Stashing stashing iterators for proper flattening" (PR #66033)

2023-12-05 Thread Louis Dionne via cfe-commits

https://github.com/ldionne approved this pull request.

LGTM, we can merge once CI is green. Thanks!

https://github.com/llvm/llvm-project/pull/66033
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang] [llvm] [libcxx] [FIX] Fix the function isctype failed in arm64-big-endian (PR #73200)

2023-12-07 Thread Louis Dionne via cfe-commits

https://github.com/ldionne approved this pull request.


https://github.com/llvm/llvm-project/pull/73200
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang] [llvm] [libcxx] [FIX] Fix the function isctype failed in arm64-big-endian (PR #73200)

2023-12-07 Thread Louis Dionne via cfe-commits

https://github.com/ldionne closed 
https://github.com/llvm/llvm-project/pull/73200
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] [libcxxabi] [libcxx] [runtimes] Don't link against compiler-rt explicitly when we use -nostdlib++ (PR #75089)

2023-12-11 Thread Louis Dionne via cfe-commits

https://github.com/ldionne created 
https://github.com/llvm/llvm-project/pull/75089

When we use the -nostdlib++ flag, we don't need to explicitly link against 
compiler-rt, since the compiler already links against it by default. This 
simplifies the flags that we need to use when building with Clang and GCC, and 
opens the door to further simplifications since most platforms won't need to 
detect whether libgcc and libgcc_s are supported anymore.

Furthermore, on platforms where -nostdlib++ is used, this patch prevents 
manually linking compiler-rt *before* other system libraries. For example, 
Apple platforms have several compiler-rt symbols defined in libSystem.dylib. If 
we manually link against compiler-rt, we end up overriding the default link 
order preferred by the compiler and potentially using the symbols from the 
clang-provided libclang_rt.a library instead of the system provided one.

Note that we don't touch how libunwind links against compiler-rt when it builds 
the .so/.a because libunwind currently doesn't use -nodefaultlibs and we want 
to avoid rocking the boat too much.

rdar://119506163

>From 60950d80acb9364a5e4bc87dd496f80693e28b2a Mon Sep 17 00:00:00 2001
From: Louis Dionne 
Date: Mon, 11 Dec 2023 14:17:26 -0500
Subject: [PATCH] [runtimes] Don't link against compiler-rt explicitly when we
 use -nostdlib++

When we use the -nostdlib++ flag, we don't need to explicitly link
against compiler-rt, since the compiler already links against it by
default. This simplifies the flags that we need to use when building
with Clang and GCC, and opens the door to further simplifications since
most platforms won't need to detect whether libgcc and libgcc_s are
supported anymore.

Furthermore, on platforms where -nostdlib++ is used, this patch prevents
manually linking compiler-rt *before* other system libraries. For example,
Apple platforms have several compiler-rt symbols defined in libSystem.dylib.
If we manually link against compiler-rt, we end up overriding the default
link order preferred by the compiler and potentially using the symbols
from the clang-provided libclang_rt.a library instead of the system
provided one.

Note that we don't touch how libunwind links against compiler-rt when
it builds the .so/.a because libunwind currently doesn't use -nodefaultlibs
and we want to avoid rocking the boat too much.

rdar://119506163
---
 libcxx/CMakeLists.txt   | 18 ++
 libcxx/cmake/config-ix.cmake|  7 ++-
 libcxxabi/cmake/config-ix.cmake |  7 ++-
 libcxxabi/src/CMakeLists.txt|  5 -
 libunwind/cmake/config-ix.cmake |  7 ++-
 5 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 31fc9cec1c57f2..2a1458a098d2e7 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -655,15 +655,17 @@ function(cxx_link_system_libraries target)
 target_add_link_flags_if_supported(${target} PRIVATE "--unwindlib=none")
   endif()
 
-  if (LIBCXX_USE_COMPILER_RT)
-find_compiler_rt_library(builtins LIBCXX_BUILTINS_LIBRARY)
-if (LIBCXX_BUILTINS_LIBRARY)
-  target_link_libraries(${target} PRIVATE "${LIBCXX_BUILTINS_LIBRARY}")
+  if (MSVC)
+if (LIBCXX_USE_COMPILER_RT)
+  find_compiler_rt_library(builtins LIBCXX_BUILTINS_LIBRARY)
+  if (LIBCXX_BUILTINS_LIBRARY)
+target_link_libraries(${target} PRIVATE "${LIBCXX_BUILTINS_LIBRARY}")
+  endif()
+elseif (LIBCXX_HAS_GCC_LIB)
+  target_link_libraries(${target} PRIVATE gcc)
+elseif (LIBCXX_HAS_GCC_S_LIB)
+  target_link_libraries(${target} PRIVATE gcc_s)
 endif()
-  elseif (LIBCXX_HAS_GCC_LIB)
-target_link_libraries(${target} PRIVATE gcc)
-  elseif (LIBCXX_HAS_GCC_S_LIB)
-target_link_libraries(${target} PRIVATE gcc_s)
   endif()
 
   if (LIBCXX_HAS_ATOMIC_LIB)
diff --git a/libcxx/cmake/config-ix.cmake b/libcxx/cmake/config-ix.cmake
index a365517936e756..1e8c2f5ce46321 100644
--- a/libcxx/cmake/config-ix.cmake
+++ b/libcxx/cmake/config-ix.cmake
@@ -45,7 +45,9 @@ else()
   endif()
 endif()
 
-if (CXX_SUPPORTS_NOSTDLIBXX_FLAG OR C_SUPPORTS_NODEFAULTLIBS_FLAG)
+# Only link against compiler-rt manually if we use -nodefaultlibs, since
+# otherwise the compiler will do the right thing on its own.
+if (NOT CXX_SUPPORTS_NOSTDLIBXX_FLAG AND C_SUPPORTS_NODEFAULTLIBS_FLAG)
   if (LIBCXX_USE_COMPILER_RT)
 include(HandleCompilerRT)
 find_compiler_rt_library(builtins LIBCXX_BUILTINS_LIBRARY
@@ -73,6 +75,9 @@ if (CXX_SUPPORTS_NOSTDLIBXX_FLAG OR 
C_SUPPORTS_NODEFAULTLIBS_FLAG)
 moldname mingwex msvcrt)
 list(APPEND CMAKE_REQUIRED_LIBRARIES ${MINGW_LIBRARIES})
   endif()
+endif()
+
+if (CXX_SUPPORTS_NOSTDLIBXX_FLAG OR C_SUPPORTS_NODEFAULTLIBS_FLAG)
   if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)
 set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all")
   endif ()
diff --git a/libcxxabi/cmake/config-ix.cmake b/libcxxabi/cmake/config-ix

[libunwind] [libunwind] Fix an inconsistent indentation (NFC) (PR #72314)

2023-11-15 Thread Louis Dionne via cfe-commits

ldionne wrote:

LGTM, the AIX failure seems unrelated.

https://github.com/llvm/llvm-project/pull/72314
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] [libunwind] Fix an inconsistent indentation (NFC) (PR #72314)

2023-11-15 Thread Louis Dionne via cfe-commits

https://github.com/ldionne closed 
https://github.com/llvm/llvm-project/pull/72314
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] [libunwind] Fix running tests with MSan (PR #67860)

2023-11-15 Thread Louis Dionne via cfe-commits

ldionne wrote:

Gentle ping!

https://github.com/llvm/llvm-project/pull/67860
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-11-15 Thread Louis Dionne via cfe-commits


@@ -172,3 +172,32 @@
 // RUN:   --check-prefix=CHECK-LIBCXX-STDLIB-UNSPECIFIED %s
 // CHECK-LIBCXX-STDLIB-UNSPECIFIED: "-cc1"
 // CHECK-LIBCXX-STDLIB-UNSPECIFIED: "-internal-isystem" 
"[[SYSROOT]]/usr/include/c++/v1"
+
+// 

ldionne wrote:

Can you try to integrate your test to the existing ones a bit more closely? 
They are not really specific to xpm/npm, so it makes sense to support them in a 
platform agnostic way.

For example, we need to add a test where we set up a symlinked Clang and then 
run with a toolchain that has headers in it, and confirm that this takes 
precedence over the ones in the symlink directory. In other words, we now have 
(1), (2) and (3) places where we look for headers in. Previously, we pretty 
exhaustively checked the combinations for the two locations we checked -- now 
we should at least try to check:

- Headers in (1) and in (2) -> (1) is preferred over (2)
- Headers in (2) and in (3) -> (2) is preferred over (3) -- you already check 
that with your current test
- Headers in (2) and nowhere else -> (2) is used

Also, we should make the comments in the tests platform-agnostic. We also 
probably want to insert the tests in the right place in the file and I suspect 
that using `(1)` `(2)` and `(3)` terminology to explain what we're testing 
would help.

https://github.com/llvm/llvm-project/pull/70817
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-11-15 Thread Louis Dionne via cfe-commits


@@ -172,3 +172,32 @@
 // RUN:   --check-prefix=CHECK-LIBCXX-STDLIB-UNSPECIFIED %s
 // CHECK-LIBCXX-STDLIB-UNSPECIFIED: "-cc1"
 // CHECK-LIBCXX-STDLIB-UNSPECIFIED: "-internal-isystem" 
"[[SYSROOT]]/usr/include/c++/v1"
+
+// 

ldionne wrote:

BTW this looks good to me apart from these test improvements.

https://github.com/llvm/llvm-project/pull/70817
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-15 Thread Louis Dionne via cfe-commits

ldionne wrote:

This seems reasonable. I read the discussion about the size of the member but I 
think this is unlikely to change much -- plus I think the compiler should be 
able to diagnose in case the string becomes smaller and we'd be copying from a 
past-the-end location into the data structure: https://godbolt.org/z/qP736q5je

Clang doesn't warn right now but GCC does. I filed 
https://github.com/llvm/llvm-project/issues/72455 about that.

https://github.com/llvm/llvm-project/pull/72043
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-15 Thread Louis Dionne via cfe-commits

https://github.com/ldionne closed 
https://github.com/llvm/llvm-project/pull/72043
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Fix to attribute plugins reaching an unreachable (PR #70877)

2023-11-15 Thread Louis Dionne via cfe-commits

ldionne wrote:

This is weird, it's the first time I see this and I couldn't find any obvious 
offending commit. It looks like it shouldn't be related, but at the same time 
we're not seeing this issue in any of the other builds in the Clang pipeline. 
You could consider updating the PR with the latest `main` content to re-trigger 
a CI run and see if that still fails.

https://github.com/llvm/llvm-project/pull/70877
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-11-16 Thread Louis Dionne via cfe-commits

https://github.com/ldionne approved this pull request.

LGTM assuming CI passes. Thanks!

https://github.com/llvm/llvm-project/pull/70817
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm] [clang-tools-extra] [libunwind] [clang] [libcxx] [libc++] Allow running the test suite with optimizations (PR #68753)

2023-11-16 Thread Louis Dionne via cfe-commits

https://github.com/ldionne updated 
https://github.com/llvm/llvm-project/pull/68753

>From 9824ef111975386152173916c1fd6a85264be0a0 Mon Sep 17 00:00:00 2001
From: Louis Dionne 
Date: Tue, 10 Oct 2023 16:35:11 -0700
Subject: [PATCH 1/9] [libc++] Allow running the test suite with optimizations

This patch adds a configuration of the libc++ test suite that enables
optimizations when building the tests. It also adds a new CI configuration
to exercise this on a regular basis. This is added in the context of [1],
which requires building with optimizations in order to hit the bug.

[1]: https://github.com/llvm/llvm-project/issues/68552
---
 libcxx/cmake/caches/Generic-optimized.cmake |  4 +++
 libcxx/utils/ci/buildkite-pipeline.yml  | 18 +
 libcxx/utils/ci/run-buildbot|  5 
 libcxx/utils/libcxx/test/params.py  | 28 -
 4 files changed, 54 insertions(+), 1 deletion(-)
 create mode 100644 libcxx/cmake/caches/Generic-optimized.cmake

diff --git a/libcxx/cmake/caches/Generic-optimized.cmake 
b/libcxx/cmake/caches/Generic-optimized.cmake
new file mode 100644
index 000..577a5de9f34c539
--- /dev/null
+++ b/libcxx/cmake/caches/Generic-optimized.cmake
@@ -0,0 +1,4 @@
+set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
+set(LIBCXX_TEST_PARAMS "optimization=speed" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
+set(LIBUNWIND_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
diff --git a/libcxx/utils/ci/buildkite-pipeline.yml 
b/libcxx/utils/ci/buildkite-pipeline.yml
index ebfb35eee91e1ed..1b52d994081c46f 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -743,6 +743,24 @@ steps:
   limit: 2
 timeout_in_minutes: 120
 
+  - label: "Optimized build and test suite"
+command: "libcxx/utils/ci/run-buildbot generic-optimized"
+artifact_paths:
+  - "**/test-results.xml"
+  - "**/*.abilist"
+env:
+CC: "clang-${LLVM_HEAD_VERSION}"
+CXX: "clang++-${LLVM_HEAD_VERSION}"
+ENABLE_CLANG_TIDY: "On"
+agents:
+  queue: "libcxx-builders"
+  os: "linux"
+retry:
+  automatic:
+- exit_status: -1  # Agent was lost
+  limit: 2
+timeout_in_minutes: 120
+
   # Other non-testing CI jobs
   - label: "Benchmarks"
 command: "libcxx/utils/ci/run-buildbot benchmarks"
diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index a71318123db3b12..18243b44a3d745c 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -479,6 +479,11 @@ generic-abi-unstable)
 generate-cmake -C 
"${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-abi-unstable.cmake"
 check-runtimes
 ;;
+generic-optimized)
+clean
+generate-cmake -C 
"${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-optimized.cmake"
+check-runtimes
+;;
 apple-system)
 clean
 
diff --git a/libcxx/utils/libcxx/test/params.py 
b/libcxx/utils/libcxx/test/params.py
index 456794b9b1cce95..9452f179aea3fec 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -11,7 +11,7 @@
 from pathlib import Path
 
 from libcxx.test.dsl import *
-from libcxx.test.features import _isMSVC
+from libcxx.test.features import _isClang, _isAppleClang, _isGCC, _isMSVC
 
 
 _warningFlags = [
@@ -90,6 +90,21 @@ def getStdFlag(cfg, std):
 return "-std=" + fallbacks[std]
 return None
 
+def getSpeedOptimizationFlag(cfg):
+if _isClang(cfg) or _isAppleClang(cfg) or _isGCC(cfg):
+return "-O3"
+elif _isMSVC(cfg):
+return "/O2"
+else:
+raise RuntimeError("Can't figure out what compiler is used in the 
configuration")
+
+def getSizeOptimizationFlag(cfg):
+if _isClang(cfg) or _isAppleClang(cfg) or _isGCC(cfg):
+return "-Os"
+elif _isMSVC(cfg):
+return "/O1"
+else:
+raise RuntimeError("Can't figure out what compiler is used in the 
configuration")
 
 # fmt: off
 DEFAULT_PARAMETERS = [
@@ -121,6 +136,17 @@ def getStdFlag(cfg, std):
 AddCompileFlag(lambda cfg: getStdFlag(cfg, std)),
 ],
 ),
+Parameter(
+name="optimization",
+choices=["none", "speed", "size"],
+type=str,
+help="The version of the standard to compile the test suite with.",
+default="none",
+actions=lambda opt: filter(None, [
+AddCompileFlag(lambda cfg: getSpeedOptimizationFlag(cfg)) if opt 
== "speed" else None,
+AddCompileFlag(lambda cfg: getSizeOptimizationFlag(cfg)) if opt == 
"size" else None,
+]),
+),
 Parameter(
 name="enable_modules",
 choices=["none", "clang", "clang-lsv"],

>From f799be39afed6b82d1942a87cea66a4d1192d765 Mon Sep 17 00:00:00 2001
From: Louis Dionne 
Date: Wed, 1 Nov 2023 10:56:30 -0400
Subject: [PATCH 2/9] Fix incorrect help

---
 libcxx/utils/libcxx/test/params.py | 2 +-
 1 file changed, 1 insertion(+

[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-11-16 Thread Louis Dionne via cfe-commits

ldionne wrote:

That's a question for the Clang regulars -- I generally don't run those tests 
since I primarily work on libc++, not Clang.

https://github.com/llvm/llvm-project/pull/70817
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] [clang] [compiler-rt] [llvm] fix python SyntaxWarnings in check-all output (PR #72538)

2023-11-16 Thread Louis Dionne via cfe-commits

https://github.com/ldionne approved this pull request.

LGTM. @petrhosek might want to take a quick look at the compiler-rt part though.

https://github.com/llvm/llvm-project/pull/72538
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] [libunwind] Introduce _LIBUNWIND_TRACE_DWARF_EVAL for increased baremetal friendliness (PR #72040)

2023-11-16 Thread Louis Dionne via cfe-commits


@@ -381,24 +381,22 @@ typename A::pint_t
 DwarfInstructions::evaluateExpression(pint_t expression, A &addressSpace,
 const R ®isters,
 pint_t initialStackValue) {
-  const bool log = false;
   pint_t p = expression;
   pint_t expressionEnd = expression + 20; // temp, until len read
   pint_t length = (pint_t)addressSpace.getULEB128(p, expressionEnd);
   expressionEnd = p + length;
-  if (log)
-fprintf(stderr, "evaluateExpression(): length=%" PRIu64 "\n",
-(uint64_t)length);
+  _LIBUNWIND_TRACE_DWARF_EVAL("evaluateExpression(): length=%" PRIu64 "\n",
+  (uint64_t)length);
   pint_t stack[100];
   pint_t *sp = stack;
   *(++sp) = initialStackValue;
 
   while (p < expressionEnd) {
-if (log) {
-  for (pint_t *t = sp; t > stack; --t) {
-fprintf(stderr, "sp[] = 0x%" PRIx64 "\n", (uint64_t)(*t));
-  }
+#if _LIBUNWIND_TRACING_DWARF_EVAL

ldionne wrote:

Not attached to this line: do we want to remove the `` include in this 
file then? But we'd need to include it from `config.h`?

https://github.com/llvm/llvm-project/pull/72040
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] [libunwind] Introduce _LIBUNWIND_TRACE_DWARF_EVAL for increased baremetal friendliness (PR #72040)

2023-11-16 Thread Louis Dionne via cfe-commits

https://github.com/ldionne approved this pull request.

This looks like an improvement to me. I have a comment/question about the 
`stdio.h` include which is now dangling, but apart from that I'm happy with the 
patch.

https://github.com/llvm/llvm-project/pull/72040
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[compiler-rt] [clang] [lldb] [llvm] [libcxx] [lld] [mlir] [clang-tools-extra] [libc++][ranges] Implement ranges::contains_subrange (PR #66963)

2023-11-16 Thread Louis Dionne via cfe-commits

ldionne wrote:

Gentle ping. There's outstanding feedback to address on this review. 
@ZijunZhaoCCK if you don't think you'll have time to pursue this PR anymore, 
it's all good but please let us know so we can assign it to someone else!

https://github.com/llvm/llvm-project/pull/66963
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] [libunwind] Introduce _LIBUNWIND_TRACE_DWARF_EVAL for increased baremetal friendliness (PR #72040)

2023-11-16 Thread Louis Dionne via cfe-commits


@@ -381,24 +381,22 @@ typename A::pint_t
 DwarfInstructions::evaluateExpression(pint_t expression, A &addressSpace,
 const R ®isters,
 pint_t initialStackValue) {
-  const bool log = false;
   pint_t p = expression;
   pint_t expressionEnd = expression + 20; // temp, until len read
   pint_t length = (pint_t)addressSpace.getULEB128(p, expressionEnd);
   expressionEnd = p + length;
-  if (log)
-fprintf(stderr, "evaluateExpression(): length=%" PRIu64 "\n",
-(uint64_t)length);
+  _LIBUNWIND_TRACE_DWARF_EVAL("evaluateExpression(): length=%" PRIu64 "\n",
+  (uint64_t)length);
   pint_t stack[100];
   pint_t *sp = stack;
   *(++sp) = initialStackValue;
 
   while (p < expressionEnd) {
-if (log) {
-  for (pint_t *t = sp; t > stack; --t) {
-fprintf(stderr, "sp[] = 0x%" PRIx64 "\n", (uint64_t)(*t));
-  }
+#if _LIBUNWIND_TRACING_DWARF_EVAL

ldionne wrote:

Yeah, I think that sounds like the best approach to me (i.e. removing 
`` everywhere except in `"config.h"`). You can do it in this patch or 
in a follow-up, I don't mind.

https://github.com/llvm/llvm-project/pull/72040
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] [libcxxabi] Remove deprecated warning from cmake files (PR #72595)

2023-11-16 Thread Louis Dionne via cfe-commits

https://github.com/ldionne approved this pull request.

Thanks a bunch for the cleanup! We often forget these but it always feels great 
to find one and clean it up!

https://github.com/llvm/llvm-project/pull/72595
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] [libcxxabi] Remove deprecated warning from cmake files (PR #72595)

2023-11-16 Thread Louis Dionne via cfe-commits

https://github.com/ldionne closed 
https://github.com/llvm/llvm-project/pull/72595
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] [libunwind] Introduce _LIBUNWIND_TRACE_DWARF_EVAL for increased baremetal friendliness (PR #72040)

2023-11-16 Thread Louis Dionne via cfe-commits


@@ -381,24 +381,22 @@ typename A::pint_t
 DwarfInstructions::evaluateExpression(pint_t expression, A &addressSpace,
 const R ®isters,
 pint_t initialStackValue) {
-  const bool log = false;
   pint_t p = expression;
   pint_t expressionEnd = expression + 20; // temp, until len read
   pint_t length = (pint_t)addressSpace.getULEB128(p, expressionEnd);
   expressionEnd = p + length;
-  if (log)
-fprintf(stderr, "evaluateExpression(): length=%" PRIu64 "\n",
-(uint64_t)length);
+  _LIBUNWIND_TRACE_DWARF_EVAL("evaluateExpression(): length=%" PRIu64 "\n",
+  (uint64_t)length);
   pint_t stack[100];
   pint_t *sp = stack;
   *(++sp) = initialStackValue;
 
   while (p < expressionEnd) {
-if (log) {
-  for (pint_t *t = sp; t > stack; --t) {
-fprintf(stderr, "sp[] = 0x%" PRIx64 "\n", (uint64_t)(*t));
-  }
+#if _LIBUNWIND_TRACING_DWARF_EVAL

ldionne wrote:

We normally don't output like that from the tests, but I am not aware of any 
mechanism available from libunwind to conditionally output information. FWIW I 
think it would be reasonable for your patch not to change that test (even 
though it would be a barrier for porting the tests to bare metal).

https://github.com/llvm/llvm-project/pull/72040
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] [llvm] [libcxx] [libc++] Allow running the test suite with optimizations (PR #68753)

2023-11-17 Thread Louis Dionne via cfe-commits

https://github.com/ldionne updated 
https://github.com/llvm/llvm-project/pull/68753

>From 2a5035e7b1db4b77ec30426c988478a35b077b7b Mon Sep 17 00:00:00 2001
From: Louis Dionne 
Date: Tue, 10 Oct 2023 16:35:11 -0700
Subject: [PATCH] [libc++] Allow running the test suite with optimizations

This patch adds a configuration of the libc++ test suite that enables
optimizations when building the tests. It also adds a new CI configuration
to exercise this on a regular basis. This is added in the context of [1],
which requires building with optimizations in order to hit the bug.

[1]: https://github.com/llvm/llvm-project/issues/68552
---
 .github/workflows/libcxx-build-and-test.yaml  |  2 +-
 .../caches/Generic-optimized-speed.cmake  |  4 +++
 .../support.dynamic/libcpp_deallocate.sh.cpp  | 17 +--
 .../path.member/path.assign/move.pass.cpp |  2 +-
 .../path.member/path.construct/move.pass.cpp  |  2 +-
 .../new.size.replace.indirect.pass.cpp|  3 +-
 .../new.size.replace.pass.cpp |  3 +-
 .../new.size_align.replace.indirect.pass.cpp  |  7 +++--
 ...ze_align_nothrow.replace.indirect.pass.cpp |  7 +++--
 .../new.size_align_nothrow.replace.pass.cpp   |  7 +++--
 ...new.size_nothrow.replace.indirect.pass.cpp |  3 +-
 .../new.size_nothrow.replace.pass.cpp |  3 +-
 .../new.size.replace.pass.cpp |  3 +-
 ...ze_align_nothrow.replace.indirect.pass.cpp |  7 +++--
 ...new.size_nothrow.replace.indirect.pass.cpp |  3 +-
 .../func.wrap.func.alg/swap.pass.cpp  | 16 +--
 .../func.wrap.func.con/F.pass.cpp |  2 +-
 .../func.wrap.func.con/copy_assign.pass.cpp   |  8 +++---
 .../func.wrap.func.con/copy_move.pass.cpp |  8 +++---
 .../nullptr_t_assign.pass.cpp |  2 +-
 .../func.wrap.func.mod/swap.pass.cpp  | 12 
 .../make_shared.pass.cpp  |  4 +--
 libcxx/test/support/count_new.h   |  5 
 libcxx/test/support/do_not_optimize.h | 28 +++
 libcxx/utils/ci/run-buildbot  |  5 
 libcxx/utils/libcxx/test/params.py| 28 ++-
 libunwind/test/libunwind_02.pass.cpp  | 26 +
 libunwind/test/unw_resume.pass.cpp|  2 +-
 libunwind/test/unwind_leaffunction.pass.cpp   | 20 +++--
 29 files changed, 169 insertions(+), 70 deletions(-)
 create mode 100644 libcxx/cmake/caches/Generic-optimized-speed.cmake
 create mode 100644 libcxx/test/support/do_not_optimize.h

diff --git a/.github/workflows/libcxx-build-and-test.yaml 
b/.github/workflows/libcxx-build-and-test.yaml
index a649993c65dc42f..f0bfd6db9503d75 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -151,6 +151,7 @@ jobs:
   'generic-no-tzdb',
   'generic-no-unicode',
   'generic-no-wide-characters',
+  'generic-optimized-speed',
   'generic-static',
   'generic-with_llvm_unwinder'
 ]
@@ -193,4 +194,3 @@ jobs:
 **/CMakeError.log
 **/CMakeOutput.log
 **/crash_diagnostics/*
-  
diff --git a/libcxx/cmake/caches/Generic-optimized-speed.cmake 
b/libcxx/cmake/caches/Generic-optimized-speed.cmake
new file mode 100644
index 000..577a5de9f34c539
--- /dev/null
+++ b/libcxx/cmake/caches/Generic-optimized-speed.cmake
@@ -0,0 +1,4 @@
+set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
+set(LIBCXX_TEST_PARAMS "optimization=speed" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
+set(LIBUNWIND_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
diff --git 
a/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp 
b/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
index fb56ce4518a7182..6e6229b752a7a6e 100644
--- 
a/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
+++ 
b/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
@@ -34,6 +34,7 @@
 #include 
 #include 
 
+#include "do_not_optimize.h"
 #include "test_macros.h"
 
 TEST_DIAGNOSTIC_PUSH
@@ -187,13 +188,13 @@ void test_allocator_and_new_match() {
   stats.reset();
 #if defined(NO_SIZE) && defined(NO_ALIGN)
   {
-int* x = new int(42);
+int* x = support::do_not_optimize(new int(42));
 delete x;
 assert(stats.expect_plain());
   }
   stats.reset();
   {
-AlignedType* a = new AlignedType();
+AlignedType* a = support::do_not_optimize(new AlignedType());
 delete a;
 assert(stats.expect_plain());
   }
@@ -202,14 +203,14 @@ void test_allocator_and_new_match() {
   stats.reset();
 #if TEST_STD_VER >= 11
   {
-int* x = new int(42);
+int* x = support::do_not_optimize(new int(42));
 delete x;
 assert(stats.expect_plain());
   }
 #endif
   stats.reset();
   {
-AlignedType* a = new AlignedType();
+AlignedType* a = support::do_not_optimize(new AlignedTy

[compiler-rt] [clang] [libcxx] [llvm] fix python SyntaxWarnings in check-all output (PR #72538)

2023-11-17 Thread Louis Dionne via cfe-commits

https://github.com/ldionne closed 
https://github.com/llvm/llvm-project/pull/72538
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm] [libcxx] [libunwind] [libc++] Allow running the test suite with optimizations (PR #68753)

2023-11-17 Thread Louis Dionne via cfe-commits

https://github.com/ldionne updated 
https://github.com/llvm/llvm-project/pull/68753

>From 2a5035e7b1db4b77ec30426c988478a35b077b7b Mon Sep 17 00:00:00 2001
From: Louis Dionne 
Date: Tue, 10 Oct 2023 16:35:11 -0700
Subject: [PATCH 1/2] [libc++] Allow running the test suite with optimizations

This patch adds a configuration of the libc++ test suite that enables
optimizations when building the tests. It also adds a new CI configuration
to exercise this on a regular basis. This is added in the context of [1],
which requires building with optimizations in order to hit the bug.

[1]: https://github.com/llvm/llvm-project/issues/68552
---
 .github/workflows/libcxx-build-and-test.yaml  |  2 +-
 .../caches/Generic-optimized-speed.cmake  |  4 +++
 .../support.dynamic/libcpp_deallocate.sh.cpp  | 17 +--
 .../path.member/path.assign/move.pass.cpp |  2 +-
 .../path.member/path.construct/move.pass.cpp  |  2 +-
 .../new.size.replace.indirect.pass.cpp|  3 +-
 .../new.size.replace.pass.cpp |  3 +-
 .../new.size_align.replace.indirect.pass.cpp  |  7 +++--
 ...ze_align_nothrow.replace.indirect.pass.cpp |  7 +++--
 .../new.size_align_nothrow.replace.pass.cpp   |  7 +++--
 ...new.size_nothrow.replace.indirect.pass.cpp |  3 +-
 .../new.size_nothrow.replace.pass.cpp |  3 +-
 .../new.size.replace.pass.cpp |  3 +-
 ...ze_align_nothrow.replace.indirect.pass.cpp |  7 +++--
 ...new.size_nothrow.replace.indirect.pass.cpp |  3 +-
 .../func.wrap.func.alg/swap.pass.cpp  | 16 +--
 .../func.wrap.func.con/F.pass.cpp |  2 +-
 .../func.wrap.func.con/copy_assign.pass.cpp   |  8 +++---
 .../func.wrap.func.con/copy_move.pass.cpp |  8 +++---
 .../nullptr_t_assign.pass.cpp |  2 +-
 .../func.wrap.func.mod/swap.pass.cpp  | 12 
 .../make_shared.pass.cpp  |  4 +--
 libcxx/test/support/count_new.h   |  5 
 libcxx/test/support/do_not_optimize.h | 28 +++
 libcxx/utils/ci/run-buildbot  |  5 
 libcxx/utils/libcxx/test/params.py| 28 ++-
 libunwind/test/libunwind_02.pass.cpp  | 26 +
 libunwind/test/unw_resume.pass.cpp|  2 +-
 libunwind/test/unwind_leaffunction.pass.cpp   | 20 +++--
 29 files changed, 169 insertions(+), 70 deletions(-)
 create mode 100644 libcxx/cmake/caches/Generic-optimized-speed.cmake
 create mode 100644 libcxx/test/support/do_not_optimize.h

diff --git a/.github/workflows/libcxx-build-and-test.yaml 
b/.github/workflows/libcxx-build-and-test.yaml
index a649993c65dc42f..f0bfd6db9503d75 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -151,6 +151,7 @@ jobs:
   'generic-no-tzdb',
   'generic-no-unicode',
   'generic-no-wide-characters',
+  'generic-optimized-speed',
   'generic-static',
   'generic-with_llvm_unwinder'
 ]
@@ -193,4 +194,3 @@ jobs:
 **/CMakeError.log
 **/CMakeOutput.log
 **/crash_diagnostics/*
-  
diff --git a/libcxx/cmake/caches/Generic-optimized-speed.cmake 
b/libcxx/cmake/caches/Generic-optimized-speed.cmake
new file mode 100644
index 000..577a5de9f34c539
--- /dev/null
+++ b/libcxx/cmake/caches/Generic-optimized-speed.cmake
@@ -0,0 +1,4 @@
+set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
+set(LIBCXX_TEST_PARAMS "optimization=speed" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
+set(LIBUNWIND_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
diff --git 
a/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp 
b/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
index fb56ce4518a7182..6e6229b752a7a6e 100644
--- 
a/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
+++ 
b/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
@@ -34,6 +34,7 @@
 #include 
 #include 
 
+#include "do_not_optimize.h"
 #include "test_macros.h"
 
 TEST_DIAGNOSTIC_PUSH
@@ -187,13 +188,13 @@ void test_allocator_and_new_match() {
   stats.reset();
 #if defined(NO_SIZE) && defined(NO_ALIGN)
   {
-int* x = new int(42);
+int* x = support::do_not_optimize(new int(42));
 delete x;
 assert(stats.expect_plain());
   }
   stats.reset();
   {
-AlignedType* a = new AlignedType();
+AlignedType* a = support::do_not_optimize(new AlignedType());
 delete a;
 assert(stats.expect_plain());
   }
@@ -202,14 +203,14 @@ void test_allocator_and_new_match() {
   stats.reset();
 #if TEST_STD_VER >= 11
   {
-int* x = new int(42);
+int* x = support::do_not_optimize(new int(42));
 delete x;
 assert(stats.expect_plain());
   }
 #endif
   stats.reset();
   {
-AlignedType* a = new AlignedType();
+AlignedType* a = support::do_not_optimize(new Align

[libunwind] 0133e25 - [runtimes][NFC] Remove trailing whitespace

2023-11-17 Thread Louis Dionne via cfe-commits

Author: Louis Dionne
Date: 2023-11-17T16:50:49-05:00
New Revision: 0133e25d99df9468ec3d9b523f14733a4b5e7180

URL: 
https://github.com/llvm/llvm-project/commit/0133e25d99df9468ec3d9b523f14733a4b5e7180
DIFF: 
https://github.com/llvm/llvm-project/commit/0133e25d99df9468ec3d9b523f14733a4b5e7180.diff

LOG: [runtimes][NFC] Remove trailing whitespace

Added: 


Modified: 
libcxx/utils/data/unicode/emoji-data.txt
libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_32.pass.sh.S
libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_64.pass.sh.S
libunwind/src/DwarfInstructions.hpp
libunwind/src/UnwindRegistersSave.S

Removed: 




diff  --git a/libcxx/utils/data/unicode/emoji-data.txt 
b/libcxx/utils/data/unicode/emoji-data.txt
index 999a43677993910..7942fc89a355943 100644
--- a/libcxx/utils/data/unicode/emoji-data.txt
+++ b/libcxx/utils/data/unicode/emoji-data.txt
@@ -9,8 +9,8 @@
 #
 # For documentation and usage, see https://www.unicode.org/reports/tr51
 #
-# Format: 
-#  ;  #  
+# Format:
+#  ;  # 
 # Note: there is no guarantee as to the structure of whitespace or comments
 #
 # Characters and sequences are listed in code point order. Users should be 
shown a more natural order.

diff  --git 
a/libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_32.pass.sh.S 
b/libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_32.pass.sh.S
index d8a3ae0e91a05ef..71c3ab9409a81a3 100644
--- a/libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_32.pass.sh.S
+++ b/libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_32.pass.sh.S
@@ -127,30 +127,30 @@
.rename H.50._ZTIi{TC},"_ZTIi"
.rename H.54.main{TC},"main"
 
-   .lglobl H.10.NO_SYMBOL{PR}  
-   .globl  ._Z4barfv   
-   .globl  .main   
-   .lglobl H.16..__4   
-   .lglobl H.18..__8   
-   .lglobl H.20..__3   
-   .lglobl H.26.NO_SYMBOL{RO}  
-   .lglobl E.28.__STATIC{RW}   
-   .lglobl __4{DS} 
-   .lglobl __8{DS} 
-   .lglobl __3{DS} 
-   .globl  _Z4barfv{DS}
-   .extern _ZTIi{UA}   
-   .globl  main{DS}
+   .lglobl H.10.NO_SYMBOL{PR}
+   .globl  ._Z4barfv
+   .globl  .main
+   .lglobl H.16..__4
+   .lglobl H.18..__8
+   .lglobl H.20..__3
+   .lglobl H.26.NO_SYMBOL{RO}
+   .lglobl E.28.__STATIC{RW}
+   .lglobl __4{DS}
+   .lglobl __8{DS}
+   .lglobl __3{DS}
+   .globl  _Z4barfv{DS}
+   .extern _ZTIi{UA}
+   .globl  main{DS}
.extern .__cxa_allocate_exception{PR}
-   .extern .__cxa_throw{PR}
+   .extern .__cxa_throw{PR}
.extern .wrap__xlc_exception_handle{PR}
.extern .__xlc_catch_matchv2{PR}
-   .extern .__cxa_begin_catch{PR}  
-   .extern .printf{PR} 
-   .extern .__cxa_end_catch{PR}
-   .extern ._Unwind_Resume{PR} 
-   .extern .__cxa_rethrow{PR}  
-   .extern ._ZSt9terminatev{PR}
+   .extern .__cxa_begin_catch{PR}
+   .extern .printf{PR}
+   .extern .__cxa_end_catch{PR}
+   .extern ._Unwind_Resume{PR}
+   .extern .__cxa_rethrow{PR}
+   .extern ._ZSt9terminatev{PR}
 
 
 # .text section
@@ -158,7 +158,7 @@
 
 
 
-   .csect  H.10.NO_SYMBOL{PR}, 7   
+   .csect  H.10.NO_SYMBOL{PR}, 7
 ._Z4barfv:  # 0x (H.10.NO_SYMBOL)
mfspr  r0,LR
stuSP,-80(SP)
@@ -414,61 +414,61 @@ H.20..__3:  # 0x0240 
(H.10.NO_SYMBOL+0x240)
 # .data section
 
 
-   .toc# 0x0280 
+   .toc# 0x0280
 T.46._Z4barfv:
.tc H.46._Z4barfv{TC},_Z4barfv{DS}
 T.50._ZTIi:
.tc H.50._ZTIi{TC},_ZTIi{UA}
 T.54.main:
-   .tc H.54.main{TC},main{DS}  
+   .tc H.54.main{TC},main{DS}
 T.30.__STATIC:
.tc H.30.__STATIC{TC},E.28.__STATIC{RW}
 T.24.NO_SYMBOL:
.tc H.24.NO_SYMBOL{TC},H.26.NO_SYMBOL{RO}
 T.34.__4:
-   .tc H.34.__4{TC},__4{DS}
+   .tc H.34.__4{TC},__4{DS}
 T.38.__8:
-   .tc H.38.__8{TC},__8{DS}
+   .tc H.38.__8{TC},__8{DS}
 T.42.__3:
-   .tc H.42.__3{TC},__3{DS}
+   .tc H.42.__3{TC},__3{DS}
 
 
-   .csect  _Z4barfv{DS}
+   .csect  _Z4barfv{DS}
.long   ._Z4barfv   # "\0\0\0\0"
.long   TOC{TC0}# "\0\0\002\200"
.long   0x  # "\0\0\0\0"
 # End  csect   _Z4barfv{DS}
 
 
-   .csect  main{DS}
+   .csect  main{DS}
.long   .main   # "\0\0\0\200"
.long   TOC{TC0}# "\0\0\002\200"
.long   0x  # "\0\0\0\0"
 # End  csect   main{DS}
 
 

[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-11-20 Thread Louis Dionne via cfe-commits

https://github.com/ldionne closed 
https://github.com/llvm/llvm-project/pull/70817
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] [libunwind] [llvm] [libc++] Allow running the test suite with optimizations (PR #68753)

2023-11-20 Thread Louis Dionne via cfe-commits

https://github.com/ldionne updated 
https://github.com/llvm/llvm-project/pull/68753

>From 2a5035e7b1db4b77ec30426c988478a35b077b7b Mon Sep 17 00:00:00 2001
From: Louis Dionne 
Date: Tue, 10 Oct 2023 16:35:11 -0700
Subject: [PATCH 1/3] [libc++] Allow running the test suite with optimizations

This patch adds a configuration of the libc++ test suite that enables
optimizations when building the tests. It also adds a new CI configuration
to exercise this on a regular basis. This is added in the context of [1],
which requires building with optimizations in order to hit the bug.

[1]: https://github.com/llvm/llvm-project/issues/68552
---
 .github/workflows/libcxx-build-and-test.yaml  |  2 +-
 .../caches/Generic-optimized-speed.cmake  |  4 +++
 .../support.dynamic/libcpp_deallocate.sh.cpp  | 17 +--
 .../path.member/path.assign/move.pass.cpp |  2 +-
 .../path.member/path.construct/move.pass.cpp  |  2 +-
 .../new.size.replace.indirect.pass.cpp|  3 +-
 .../new.size.replace.pass.cpp |  3 +-
 .../new.size_align.replace.indirect.pass.cpp  |  7 +++--
 ...ze_align_nothrow.replace.indirect.pass.cpp |  7 +++--
 .../new.size_align_nothrow.replace.pass.cpp   |  7 +++--
 ...new.size_nothrow.replace.indirect.pass.cpp |  3 +-
 .../new.size_nothrow.replace.pass.cpp |  3 +-
 .../new.size.replace.pass.cpp |  3 +-
 ...ze_align_nothrow.replace.indirect.pass.cpp |  7 +++--
 ...new.size_nothrow.replace.indirect.pass.cpp |  3 +-
 .../func.wrap.func.alg/swap.pass.cpp  | 16 +--
 .../func.wrap.func.con/F.pass.cpp |  2 +-
 .../func.wrap.func.con/copy_assign.pass.cpp   |  8 +++---
 .../func.wrap.func.con/copy_move.pass.cpp |  8 +++---
 .../nullptr_t_assign.pass.cpp |  2 +-
 .../func.wrap.func.mod/swap.pass.cpp  | 12 
 .../make_shared.pass.cpp  |  4 +--
 libcxx/test/support/count_new.h   |  5 
 libcxx/test/support/do_not_optimize.h | 28 +++
 libcxx/utils/ci/run-buildbot  |  5 
 libcxx/utils/libcxx/test/params.py| 28 ++-
 libunwind/test/libunwind_02.pass.cpp  | 26 +
 libunwind/test/unw_resume.pass.cpp|  2 +-
 libunwind/test/unwind_leaffunction.pass.cpp   | 20 +++--
 29 files changed, 169 insertions(+), 70 deletions(-)
 create mode 100644 libcxx/cmake/caches/Generic-optimized-speed.cmake
 create mode 100644 libcxx/test/support/do_not_optimize.h

diff --git a/.github/workflows/libcxx-build-and-test.yaml 
b/.github/workflows/libcxx-build-and-test.yaml
index a649993c65dc42f..f0bfd6db9503d75 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -151,6 +151,7 @@ jobs:
   'generic-no-tzdb',
   'generic-no-unicode',
   'generic-no-wide-characters',
+  'generic-optimized-speed',
   'generic-static',
   'generic-with_llvm_unwinder'
 ]
@@ -193,4 +194,3 @@ jobs:
 **/CMakeError.log
 **/CMakeOutput.log
 **/crash_diagnostics/*
-  
diff --git a/libcxx/cmake/caches/Generic-optimized-speed.cmake 
b/libcxx/cmake/caches/Generic-optimized-speed.cmake
new file mode 100644
index 000..577a5de9f34c539
--- /dev/null
+++ b/libcxx/cmake/caches/Generic-optimized-speed.cmake
@@ -0,0 +1,4 @@
+set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
+set(LIBCXX_TEST_PARAMS "optimization=speed" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
+set(LIBUNWIND_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
diff --git 
a/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp 
b/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
index fb56ce4518a7182..6e6229b752a7a6e 100644
--- 
a/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
+++ 
b/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
@@ -34,6 +34,7 @@
 #include 
 #include 
 
+#include "do_not_optimize.h"
 #include "test_macros.h"
 
 TEST_DIAGNOSTIC_PUSH
@@ -187,13 +188,13 @@ void test_allocator_and_new_match() {
   stats.reset();
 #if defined(NO_SIZE) && defined(NO_ALIGN)
   {
-int* x = new int(42);
+int* x = support::do_not_optimize(new int(42));
 delete x;
 assert(stats.expect_plain());
   }
   stats.reset();
   {
-AlignedType* a = new AlignedType();
+AlignedType* a = support::do_not_optimize(new AlignedType());
 delete a;
 assert(stats.expect_plain());
   }
@@ -202,14 +203,14 @@ void test_allocator_and_new_match() {
   stats.reset();
 #if TEST_STD_VER >= 11
   {
-int* x = new int(42);
+int* x = support::do_not_optimize(new int(42));
 delete x;
 assert(stats.expect_plain());
   }
 #endif
   stats.reset();
   {
-AlignedType* a = new AlignedType();
+AlignedType* a = support::do_not_optimize(new Align

[libcxx] [libunwind] [llvm] [libc++] Allow running the test suite with optimizations (PR #68753)

2023-11-20 Thread Louis Dionne via cfe-commits


@@ -0,0 +1,28 @@
+// -*- C++ -*-
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef SUPPORT_DO_NOT_OPTIMIZE_H
+#define SUPPORT_DO_NOT_OPTIMIZE_H
+
+#include "test_macros.h"
+
+namespace support {
+// This function can be used to hide some objects from compiler optimizations.
+//
+// For example, this is useful to hide the result of a call to `new` and ensure
+// that the compiler doesn't elide the call to new/delete. Otherwise, elliding
+// calls to new/delete is allowed by the Standard and compilers actually do it
+// when optimizations are enabled.
+template 
+TEST_CONSTEXPR __attribute__((noinline)) T* do_not_optimize(T* ptr) 
TEST_NOEXCEPT {

ldionne wrote:

I must have missed that.

https://github.com/llvm/llvm-project/pull/68753
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)

2023-11-21 Thread Louis Dionne via cfe-commits

ldionne wrote:

The CI issues are flakes (we just made major changes to our infrastructure and 
we're still adjusting). I think this is good to go.

https://github.com/llvm/llvm-project/pull/72040
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [libcxx] Unifying __is_trivial_equality_predicate and __is_trivial_plus_operation into __desugars_to (PR #68642)

2023-10-30 Thread Louis Dionne via cfe-commits


@@ -18,8 +18,11 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-template 
-struct __is_trivial_plus_operation : false_type {};
+template 

ldionne wrote:

I think what we want is something like this:

```
struct __equal_tag {};
struct __plus_tag {};
// etc...

template 
struct __desugars_to : false_type {};


// std::equal_to and friends
template  struct __desugars_to<__equal_tag, equal_to<_Tp>, _Tp, _Tp> 
: true_type {};
template  struct __desugars_to<__equal_tag, 
equal_to, _Tp, _Up> : true_type {};
template  struct __desugars_to<__equal_tag, __equal, _Tp, 
_Up> : true_type {};
template  struct __desugars_to<__equal_tag, 
ranges::equal_to, _Tp, _Up> : true_type {};

// std::plus and friends
etc...
```

I originally thought that using `std::equal_to<>` as a "tag" to represent the 
canonical operation was a good idea, but since it doesn't exist in older 
standards we end up having to use `std::equal_to` explicitly, and that 
really obfuscates the fact that it's meant to be a tag.

https://github.com/llvm/llvm-project/pull/68642
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


  1   2   3   4   5   6   7   8   9   10   >