Re: [libcxx] r339943 - Establish the header. NFC yet. Reviewed as https://reviews.llvm.org/D50815

2018-08-17 Thread Marshall Clow via cfe-commits
On Fri, Aug 17, 2018 at 8:49 AM, Marshall Clow 
wrote:

> On Thu, Aug 16, 2018 at 3:30 PM, Vitaly Buka 
> wrote:
>
>> This brakes some bots
>> http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-
>> fast/builds/22441
>>
>> /b/sanitizer-x86_64-linux-fast/build/libcxx_build_msan/include/c++/v1/algorithm:648:10:
>>  fatal error: 'bit' file not found
>> #include 
>>  ^
>> 1 error generated.
>>
>> That's very weird.
>
> I suspect that you have a build system problem, since you picked up the
> new  (that #includes )
> but not the new file 
>
> How can that be?
>
>
Looks like I needed to put a line in libcxx/include/CMakeLists.txt .
Sorry for the noise.
Will re-commit.

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


Re: [libcxx] r339943 - Establish the header. NFC yet. Reviewed as https://reviews.llvm.org/D50815

2018-08-17 Thread Marshall Clow via cfe-commits
On Thu, Aug 16, 2018 at 3:30 PM, Vitaly Buka  wrote:

> This brakes some bots
> http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/22441
>
> /b/sanitizer-x86_64-linux-fast/build/libcxx_build_msan/include/c++/v1/algorithm:648:10:
>  fatal error: 'bit' file not found
> #include 
>  ^
> 1 error generated.
>
> That's very weird.

I suspect that you have a build system problem, since you picked up the new
 (that #includes )
but not the new file 

How can that be?

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


Re: [libcxx] r339943 - Establish the header. NFC yet. Reviewed as https://reviews.llvm.org/D50815

2018-08-16 Thread Vitaly Buka via cfe-commits
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/27733
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/14670

On Thu, Aug 16, 2018 at 3:30 PM Vitaly Buka  wrote:

> This brakes some bots
> http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/22441
>
> /b/sanitizer-x86_64-linux-fast/build/libcxx_build_msan/include/c++/v1/algorithm:648:10:
>  fatal error: 'bit' file not found
> #include 
>  ^
> 1 error generated.
>
>
> On Thu, Aug 16, 2018 at 2:36 PM Marshall Clow via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> Author: marshall
>> Date: Thu Aug 16 14:35:38 2018
>> New Revision: 339943
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=339943=rev
>> Log:
>> Establish the  header. NFC yet. Reviewed as
>> https://reviews.llvm.org/D50815
>>
>> Added:
>> libcxx/trunk/include/bit
>> Modified:
>> libcxx/trunk/include/algorithm
>> libcxx/trunk/include/module.modulemap
>> libcxx/trunk/test/libcxx/double_include.sh.cpp
>>
>> Modified: libcxx/trunk/include/algorithm
>> URL:
>> http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/algorithm?rev=339943=339942=339943=diff
>>
>> ==
>> --- libcxx/trunk/include/algorithm (original)
>> +++ libcxx/trunk/include/algorithm Thu Aug 16 14:35:38 2018
>> @@ -645,13 +645,7 @@ template >  #include 
>>  #include 
>>  #include 
>> -
>> -#if defined(__IBMCPP__)
>> -#include "support/ibm/support.h"
>> -#endif
>> -#if defined(_LIBCPP_COMPILER_MSVC)
>> -#include 
>> -#endif
>> +#include 
>>
>>  #include <__debug>
>>
>> @@ -788,135 +782,6 @@ struct __debug_less
>>
>>  #endif  // _LIBCPP_DEBUG
>>
>> -// Precondition:  __x != 0
>> -inline _LIBCPP_INLINE_VISIBILITY
>> -unsigned __ctz(unsigned __x) {
>> -#ifndef _LIBCPP_COMPILER_MSVC
>> -return static_cast(__builtin_ctz(__x));
>> -#else
>> -  static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
>> -  static_assert(sizeof(unsigned long) == 4, "");
>> -  unsigned long where;
>> -  // Search from LSB to MSB for first set bit.
>> -  // Returns zero if no set bit is found.
>> -  if (_BitScanForward(, __x))
>> -return where;
>> -  return 32;
>> -#endif
>> -}
>> -
>> -inline _LIBCPP_INLINE_VISIBILITY
>> -unsigned long __ctz(unsigned long __x) {
>> -#ifndef _LIBCPP_COMPILER_MSVC
>> -return static_cast(__builtin_ctzl(__x));
>> -#else
>> -static_assert(sizeof(unsigned long) == sizeof(unsigned), "");
>> -return __ctz(static_cast(__x));
>> -#endif
>> -}
>> -
>> -inline _LIBCPP_INLINE_VISIBILITY
>> -unsigned long long __ctz(unsigned long long __x) {
>> -#ifndef _LIBCPP_COMPILER_MSVC
>> -return static_cast(__builtin_ctzll(__x));
>> -#else
>> -unsigned long where;
>> -// Search from LSB to MSB for first set bit.
>> -// Returns zero if no set bit is found.
>> -#if defined(_LIBCPP_HAS_BITSCAN64)
>> -(defined(_M_AMD64) || defined(__x86_64__))
>> -  if (_BitScanForward64(, __x))
>> -return static_cast(where);
>> -#else
>> -  // Win32 doesn't have _BitScanForward64 so emulate it with two 32 bit
>> calls.
>> -  // Scan the Low Word.
>> -  if (_BitScanForward(, static_cast(__x)))
>> -return where;
>> -  // Scan the High Word.
>> -  if (_BitScanForward(, static_cast(__x >> 32)))
>> -return where + 32; // Create a bit offset from the LSB.
>> -#endif
>> -  return 64;
>> -#endif // _LIBCPP_COMPILER_MSVC
>> -}
>> -
>> -// Precondition:  __x != 0
>> -inline _LIBCPP_INLINE_VISIBILITY
>> -unsigned __clz(unsigned __x) {
>> -#ifndef _LIBCPP_COMPILER_MSVC
>> -return static_cast(__builtin_clz(__x));
>> -#else
>> -  static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
>> -  static_assert(sizeof(unsigned long) == 4, "");
>> -  unsigned long where;
>> -  // Search from LSB to MSB for first set bit.
>> -  // Returns zero if no set bit is found.
>> -  if (_BitScanReverse(, __x))
>> -return 31 - where;
>> -  return 32; // Undefined Behavior.
>> -#endif
>> -}
>> -
>> -inline _LIBCPP_INLINE_VISIBILITY
>> -unsigned long __clz(unsigned long __x) {
>> -#ifndef _LIBCPP_COMPILER_MSVC
>> -return static_cast(__builtin_clzl (__x));
>> -#else
>> -static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
>> -return __clz(static_cast(__x));
>> -#endif
>> -}
>> -
>> -inline _LIBCPP_INLINE_VISIBILITY
>> -unsigned long long __clz(unsigned long long __x) {
>> -#ifndef _LIBCPP_COMPILER_MSVC
>> -return static_cast(__builtin_clzll(__x));
>> -#else
>> -  unsigned long where;
>> -// BitScanReverse scans from MSB to LSB for first set bit.
>> -// Returns 0 if no set bit is found.
>> -#if defined(_LIBCPP_HAS_BITSCAN64)
>> -  if (_BitScanReverse64(, __x))
>> -return static_cast(63 - where);
>> -#else
>> -  // Scan the high 32 bits.
>> -  if (_BitScanReverse(, static_cast(__x >> 32)))
>> -return 63 - (where + 32); // Create a bit offset from the MSB.
>> -  // Scan the low 32 bits.
>> -  if (_BitScanReverse(, static_cast(__x)))
>> -return 

Re: [libcxx] r339943 - Establish the header. NFC yet. Reviewed as https://reviews.llvm.org/D50815

2018-08-16 Thread Vitaly Buka via cfe-commits
This brakes some bots
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/22441

/b/sanitizer-x86_64-linux-fast/build/libcxx_build_msan/include/c++/v1/algorithm:648:10:
fatal error: 'bit' file not found
#include 
 ^
1 error generated.


On Thu, Aug 16, 2018 at 2:36 PM Marshall Clow via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: marshall
> Date: Thu Aug 16 14:35:38 2018
> New Revision: 339943
>
> URL: http://llvm.org/viewvc/llvm-project?rev=339943=rev
> Log:
> Establish the  header. NFC yet. Reviewed as
> https://reviews.llvm.org/D50815
>
> Added:
> libcxx/trunk/include/bit
> Modified:
> libcxx/trunk/include/algorithm
> libcxx/trunk/include/module.modulemap
> libcxx/trunk/test/libcxx/double_include.sh.cpp
>
> Modified: libcxx/trunk/include/algorithm
> URL:
> http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/algorithm?rev=339943=339942=339943=diff
>
> ==
> --- libcxx/trunk/include/algorithm (original)
> +++ libcxx/trunk/include/algorithm Thu Aug 16 14:35:38 2018
> @@ -645,13 +645,7 @@ template   #include 
>  #include 
>  #include 
> -
> -#if defined(__IBMCPP__)
> -#include "support/ibm/support.h"
> -#endif
> -#if defined(_LIBCPP_COMPILER_MSVC)
> -#include 
> -#endif
> +#include 
>
>  #include <__debug>
>
> @@ -788,135 +782,6 @@ struct __debug_less
>
>  #endif  // _LIBCPP_DEBUG
>
> -// Precondition:  __x != 0
> -inline _LIBCPP_INLINE_VISIBILITY
> -unsigned __ctz(unsigned __x) {
> -#ifndef _LIBCPP_COMPILER_MSVC
> -return static_cast(__builtin_ctz(__x));
> -#else
> -  static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
> -  static_assert(sizeof(unsigned long) == 4, "");
> -  unsigned long where;
> -  // Search from LSB to MSB for first set bit.
> -  // Returns zero if no set bit is found.
> -  if (_BitScanForward(, __x))
> -return where;
> -  return 32;
> -#endif
> -}
> -
> -inline _LIBCPP_INLINE_VISIBILITY
> -unsigned long __ctz(unsigned long __x) {
> -#ifndef _LIBCPP_COMPILER_MSVC
> -return static_cast(__builtin_ctzl(__x));
> -#else
> -static_assert(sizeof(unsigned long) == sizeof(unsigned), "");
> -return __ctz(static_cast(__x));
> -#endif
> -}
> -
> -inline _LIBCPP_INLINE_VISIBILITY
> -unsigned long long __ctz(unsigned long long __x) {
> -#ifndef _LIBCPP_COMPILER_MSVC
> -return static_cast(__builtin_ctzll(__x));
> -#else
> -unsigned long where;
> -// Search from LSB to MSB for first set bit.
> -// Returns zero if no set bit is found.
> -#if defined(_LIBCPP_HAS_BITSCAN64)
> -(defined(_M_AMD64) || defined(__x86_64__))
> -  if (_BitScanForward64(, __x))
> -return static_cast(where);
> -#else
> -  // Win32 doesn't have _BitScanForward64 so emulate it with two 32 bit
> calls.
> -  // Scan the Low Word.
> -  if (_BitScanForward(, static_cast(__x)))
> -return where;
> -  // Scan the High Word.
> -  if (_BitScanForward(, static_cast(__x >> 32)))
> -return where + 32; // Create a bit offset from the LSB.
> -#endif
> -  return 64;
> -#endif // _LIBCPP_COMPILER_MSVC
> -}
> -
> -// Precondition:  __x != 0
> -inline _LIBCPP_INLINE_VISIBILITY
> -unsigned __clz(unsigned __x) {
> -#ifndef _LIBCPP_COMPILER_MSVC
> -return static_cast(__builtin_clz(__x));
> -#else
> -  static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
> -  static_assert(sizeof(unsigned long) == 4, "");
> -  unsigned long where;
> -  // Search from LSB to MSB for first set bit.
> -  // Returns zero if no set bit is found.
> -  if (_BitScanReverse(, __x))
> -return 31 - where;
> -  return 32; // Undefined Behavior.
> -#endif
> -}
> -
> -inline _LIBCPP_INLINE_VISIBILITY
> -unsigned long __clz(unsigned long __x) {
> -#ifndef _LIBCPP_COMPILER_MSVC
> -return static_cast(__builtin_clzl (__x));
> -#else
> -static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
> -return __clz(static_cast(__x));
> -#endif
> -}
> -
> -inline _LIBCPP_INLINE_VISIBILITY
> -unsigned long long __clz(unsigned long long __x) {
> -#ifndef _LIBCPP_COMPILER_MSVC
> -return static_cast(__builtin_clzll(__x));
> -#else
> -  unsigned long where;
> -// BitScanReverse scans from MSB to LSB for first set bit.
> -// Returns 0 if no set bit is found.
> -#if defined(_LIBCPP_HAS_BITSCAN64)
> -  if (_BitScanReverse64(, __x))
> -return static_cast(63 - where);
> -#else
> -  // Scan the high 32 bits.
> -  if (_BitScanReverse(, static_cast(__x >> 32)))
> -return 63 - (where + 32); // Create a bit offset from the MSB.
> -  // Scan the low 32 bits.
> -  if (_BitScanReverse(, static_cast(__x)))
> -return 63 - where;
> -#endif
> -  return 64; // Undefined Behavior.
> -#endif // _LIBCPP_COMPILER_MSVC
> -}
> -
> -inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned __x) {
> -#ifndef _LIBCPP_COMPILER_MSVC
> -  return __builtin_popcount  (__x);
> -#else
> -  static_assert(sizeof(unsigned) == 4, "");
> -  return __popcnt(__x);
> -#endif
> -}
> -
> -inline 

[libcxx] r339943 - Establish the header. NFC yet. Reviewed as https://reviews.llvm.org/D50815

2018-08-16 Thread Marshall Clow via cfe-commits
Author: marshall
Date: Thu Aug 16 14:35:38 2018
New Revision: 339943

URL: http://llvm.org/viewvc/llvm-project?rev=339943=rev
Log:
Establish the  header. NFC yet. Reviewed as https://reviews.llvm.org/D50815

Added:
libcxx/trunk/include/bit
Modified:
libcxx/trunk/include/algorithm
libcxx/trunk/include/module.modulemap
libcxx/trunk/test/libcxx/double_include.sh.cpp

Modified: libcxx/trunk/include/algorithm
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/algorithm?rev=339943=339942=339943=diff
==
--- libcxx/trunk/include/algorithm (original)
+++ libcxx/trunk/include/algorithm Thu Aug 16 14:35:38 2018
@@ -645,13 +645,7 @@ template 
 #include 
 #include 
-
-#if defined(__IBMCPP__)
-#include "support/ibm/support.h"
-#endif
-#if defined(_LIBCPP_COMPILER_MSVC)
-#include 
-#endif
+#include 
 
 #include <__debug>
 
@@ -788,135 +782,6 @@ struct __debug_less
 
 #endif  // _LIBCPP_DEBUG
 
-// Precondition:  __x != 0
-inline _LIBCPP_INLINE_VISIBILITY
-unsigned __ctz(unsigned __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
-return static_cast(__builtin_ctz(__x));
-#else
-  static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
-  static_assert(sizeof(unsigned long) == 4, "");
-  unsigned long where;
-  // Search from LSB to MSB for first set bit.
-  // Returns zero if no set bit is found.
-  if (_BitScanForward(, __x))
-return where;
-  return 32;
-#endif
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-unsigned long __ctz(unsigned long __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
-return static_cast(__builtin_ctzl(__x));
-#else
-static_assert(sizeof(unsigned long) == sizeof(unsigned), "");
-return __ctz(static_cast(__x));
-#endif
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-unsigned long long __ctz(unsigned long long __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
-return static_cast(__builtin_ctzll(__x));
-#else
-unsigned long where;
-// Search from LSB to MSB for first set bit.
-// Returns zero if no set bit is found.
-#if defined(_LIBCPP_HAS_BITSCAN64)
-(defined(_M_AMD64) || defined(__x86_64__))
-  if (_BitScanForward64(, __x))
-return static_cast(where);
-#else
-  // Win32 doesn't have _BitScanForward64 so emulate it with two 32 bit calls.
-  // Scan the Low Word.
-  if (_BitScanForward(, static_cast(__x)))
-return where;
-  // Scan the High Word.
-  if (_BitScanForward(, static_cast(__x >> 32)))
-return where + 32; // Create a bit offset from the LSB.
-#endif
-  return 64;
-#endif // _LIBCPP_COMPILER_MSVC
-}
-
-// Precondition:  __x != 0
-inline _LIBCPP_INLINE_VISIBILITY
-unsigned __clz(unsigned __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
-return static_cast(__builtin_clz(__x));
-#else
-  static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
-  static_assert(sizeof(unsigned long) == 4, "");
-  unsigned long where;
-  // Search from LSB to MSB for first set bit.
-  // Returns zero if no set bit is found.
-  if (_BitScanReverse(, __x))
-return 31 - where;
-  return 32; // Undefined Behavior.
-#endif
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-unsigned long __clz(unsigned long __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
-return static_cast(__builtin_clzl (__x));
-#else
-static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
-return __clz(static_cast(__x));
-#endif
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-unsigned long long __clz(unsigned long long __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
-return static_cast(__builtin_clzll(__x));
-#else
-  unsigned long where;
-// BitScanReverse scans from MSB to LSB for first set bit.
-// Returns 0 if no set bit is found.
-#if defined(_LIBCPP_HAS_BITSCAN64)
-  if (_BitScanReverse64(, __x))
-return static_cast(63 - where);
-#else
-  // Scan the high 32 bits.
-  if (_BitScanReverse(, static_cast(__x >> 32)))
-return 63 - (where + 32); // Create a bit offset from the MSB.
-  // Scan the low 32 bits.
-  if (_BitScanReverse(, static_cast(__x)))
-return 63 - where;
-#endif
-  return 64; // Undefined Behavior.
-#endif // _LIBCPP_COMPILER_MSVC
-}
-
-inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
-  return __builtin_popcount  (__x);
-#else
-  static_assert(sizeof(unsigned) == 4, "");
-  return __popcnt(__x);
-#endif
-}
-
-inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned long __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
-  return __builtin_popcountl (__x);
-#else
-  static_assert(sizeof(unsigned long) == 4, "");
-  return __popcnt(__x);
-#endif
-}
-
-inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned long long __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
-  return __builtin_popcountll(__x);
-#else
-  static_assert(sizeof(unsigned long long) == 8, "");
-  return __popcnt64(__x);
-#endif
-}
-
 // all_of
 
 template 

Added: libcxx/trunk/include/bit
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/bit?rev=339943=auto