[PATCH] D144889: [C2x] Support in freestanding

2023-02-28 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. Let's talk about these use cases. > On the one hand, I think many users will want a libc that targets their > particular freestanding environment so that they get the best performance > characteristics (and other considerations) for their target. I think this fits

[PATCH] D144889: [C2x] Support in freestanding

2023-02-27 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. > 1. A normal operating system target with a "hosted" libc. > 2. A baremetal target with an "embedded" libc; basically a stripped down libc > which only includes stuff that doesn't require an operating system. What > exactly this includes varies; may include some form

[PATCH] D144889: [C2x] Support in freestanding

2023-02-27 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. > Okay, so this is potentially ignorance on my part. I was under the impression > that folks using freestanding mode did not want any library to be linked in. > Are there freestanding libc implementations out there that the user would > link in instead that we defer to

[PATCH] D144889: [C2x] Support in freestanding

2023-02-27 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. > Okay, so this is potentially ignorance on my part. I was under the impression > that folks using freestanding mode did not want any library to be linked in. > Are there freestanding libc implementations out there that the user would > link in instead that we defer to

[PATCH] D144889: [C2x] Support in freestanding

2023-02-27 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. A freestanding implementation doesn't necessarily mean that everything is header-only. It's fine to require linking against a (freestanding) C runtime library. All header-only is fine too though, if you want to make that work. Architecturally, I don't feel it is

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-24 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. add a comment, and it will be fine in my eyes. You'll need signoff from the code owner though. Comment at: test/Analysis/padding_cpp.cpp:204-212 +// expected-warning@+1{{Excessive padding in 'struct FakeIntSandwich'}} +struct FakeIntSandwich { + char

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-12 Thread Ben Craig via Phabricator via cfe-commits
bcraig added inline comments. Comment at: test/Analysis/padding_cpp.cpp:204-212 +// expected-warning@+1{{Excessive padding in 'struct FakeIntSandwich'}} +struct FakeIntSandwich { + char c1; + int i; + char c2; +}; + Looking at this again... what new cases

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-12 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. You should probably add whoever the current code owner of that static analyzer to this review. I have very little involvement with Clang these days, so a "LGTM" from me doesn't carry much weight. Comment at:

[PATCH] D41316: [libcxx] Allow random_device to be built optionally

2018-04-24 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. For those that would prefer random device to not exist if it isn't cryptographically secure, please write a wg21 paper. I will gladly review such a paper, and if you need a presenter, then I will present it if I am attending. I won't be at Rapperswil, but I will be at

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2018-04-04 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. In https://reviews.llvm.org/D32411#1056381, @EricWF wrote: > I spoke to STL on the MSVC team a while ago, and he stated that if we > produced a paper describing why we need `#include_next` and the rational > behind it, and they would pass that on to the front-end team.

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2017-12-09 Thread Ben Craig via Phabricator via cfe-commits
bcraig updated this revision to Diff 126275. bcraig added a comment. Rebased https://reviews.llvm.org/D32411 Files: CMakeLists.txt docs/DesignDocs/IncludeNextEmulation.rst include/__config include/__config_site.in include/complex.h include/cstddef include/ctype.h

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2017-12-05 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. Talked with mclow and some Microsoft devs in Albuquerque. I'm not expecting include_next to show up in MSVC. Sometime in the next month I hope to rebase this change. https://reviews.llvm.org/D32411 ___ cfe-commits

[PATCH] D37677: [libc++] implement future synchronization using atomic_flag

2017-09-11 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. In https://reviews.llvm.org/D37677#866743, @Quuxplusone wrote: > This current patch just swaps out std::mutex for a std::mutex-alike class > that claims to be faster for uncontested accesses. Definitely safer than my > interpretation. :) If this patch actually helps,

[PATCH] D37677: [libc++] implement future synchronization using atomic_flag

2017-09-11 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. Is there a benchmark where this demonstrates some performance improvement? I fear that the switch to condition_variable_any will swamp any performance gains from the switch to a spin lock. Also, the spin lock is being held during allocating operations (the exception

[PATCH] D36423: [libc++] Introsort based sorting function

2017-08-21 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. LGTM. You should probably get one other person to approve though. I'm hoping that @EricWF or @mclow.lists will take a look https://reviews.llvm.org/D36423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D36423: [libc++] Introsort based sorting function

2017-08-15 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. The test headers should not be in the production include folder. They should probably be in the benchmark folder. If possible, follow the style and conventions of the existing tests. When you can't follow the style and convention of the existing tests, try to make it

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2017-08-11 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. ping https://reviews.llvm.org/D32411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D34170: [libcxx] Moving compiler specific test infrastructure to compiler.py

2017-08-11 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. ping https://reviews.llvm.org/D34170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D36423: [libc++] Introsort based sorting function

2017-08-10 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. If you want the performance improvements in the BM_sort_std_worst_quick cases preserved, you really need to port the benchmark from Aditya's repo into the libcxx benchmark code base. Otherwise, the next person that comes along to improve std::sort performance may very

[PATCH] D36423: [libc++] Introsort based sorting function

2017-08-08 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. I like this change in general. Dinkumware has been using introsort for 10+ years, so I'm a bit surprised that libc++ wasn't already. Comment at: include/algorithm:4208 + + // Threshold(or depth limit) for introsort is taken to be 2*log2(size) +

[PATCH] D36423: [libc++] Introsort based sorting function

2017-08-08 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. Those are interesting (and useful) results... but they don't look like they came from the same algorithms.bench.cpp that I'm looking at... https://github.com/llvm-mirror/libcxx/blob/master/benchmarks/algorithms.bench.cpp That being said, the benchmark there only does 1k

[PATCH] D36423: [libc++] Introsort based sorting function

2017-08-07 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. alternatively, you could report the comparison of the old code vs. the new code with an existing benchmark, like benchmarks/algorithms.bench.cpp https://reviews.llvm.org/D36423 ___ cfe-commits mailing list

[PATCH] D36423: [libc++] Introsort based sorting function

2017-08-07 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. This patch needs benchmarks that demonstrate the performance changes. https://reviews.llvm.org/D36423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D18174: Fix libcxx build on musl

2017-07-31 Thread Ben Craig via Phabricator via cfe-commits
bcraig added inline comments. Comment at: include/__mutex_base:51 #ifndef _LIBCPP_CXX03_LANG -constexpr mutex() = default; +#ifdef __GLIBC__ +constexpr smeenai wrote: > EricWF wrote: > > Limiting `constexpr` to GLIBC implementations only is incorrect;

[PATCH] D34170: [libcxx] Moving compiler specific test infrastructure to compiler.py

2017-07-23 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. ping https://reviews.llvm.org/D34170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2017-07-23 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. ping https://reviews.llvm.org/D32411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D35174: [libc++] Fix unrepresentable enum for clang-cl unstable ABI

2017-07-10 Thread Ben Craig via Phabricator via cfe-commits
bcraig updated this revision to Diff 105845. bcraig edited the summary of this revision. bcraig added a comment. Switched to static consts https://reviews.llvm.org/D35174 Files: include/string Index: include/string === ---

[PATCH] D35174: [libc++] Fix unrepresentable enum for clang-cl unstable ABI

2017-07-09 Thread Ben Craig via Phabricator via cfe-commits
bcraig created this revision. When using LIBCXX_ABI_UNSTABLE=YES, clang-cl gave the following warning: P:\llvm_master\src\llvm\projects\libcxx\include\string(683,51): warning: enumerator value is not representable in the underlying type 'int' [-Wmicrosoft-enum-value] Fixed by providing a

[PATCH] D34170: [libcxx] Moving compiler specific test infrastructure to compiler.py

2017-07-05 Thread Ben Craig via Phabricator via cfe-commits
bcraig updated this revision to Diff 105268. bcraig added a comment. Rebased. Separating out logging into it's own class. Also tweaked the output slightly so that the language dialect under test shows up as the first line of output. https://reviews.llvm.org/D34170 Files: test/lit.cfg

[PATCH] D34588: Check for _MSC_VER before define _LIBCPP_MSVCRT

2017-06-27 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. _LIBCPP_MS_CRT seems fine too. https://reviews.llvm.org/D34588 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D34588: Check for _MSC_VER before define _LIBCPP_MSVCRT

2017-06-26 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. LGTM, but you should probably get approval from somebody a bit more senior with the project. Comment at: include/__config:234-235 +// a MS compatibility version is specified. # ifndef __MINGW32__ -#define _LIBCPP_MSVCRT // Using Microsoft's C

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2017-06-25 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. ping https://reviews.llvm.org/D32411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D34588: Check for _MSC_VER before define _LIBCPP_MSVCRT

2017-06-24 Thread Ben Craig via Phabricator via cfe-commits
bcraig added inline comments. Comment at: include/__config:234-235 +// a MS compatibility version is specified. # ifndef __MINGW32__ -#define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library +#ifdef _MSC_VER +# define _LIBCPP_MSVCRT // Using Microsoft's C

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2017-06-15 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. ping https://reviews.llvm.org/D32411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D20596: [libcxx] Refactor locale switching, creation, and destruction

2017-06-15 Thread Ben Craig via Phabricator via cfe-commits
bcraig abandoned this revision. bcraig added a comment. This is very stale at this point, and isn't blocking anything. Closing. https://reviews.llvm.org/D20596 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D32146: PR32476: __nop_locale_mgmt.h not needed with newlib 2.5+

2017-06-14 Thread Ben Craig via Phabricator via cfe-commits
bcraig accepted this revision. bcraig added a comment. LGTM. @waltl : Do you need me to submit the changes, or will you handle that? https://reviews.llvm.org/D32146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D34170: [libcxx] Moving compiler specific test infrastructure to compiler.py

2017-06-13 Thread Ben Craig via Phabricator via cfe-commits
bcraig created this revision. format.py and config.py were routinely reaching into the innards of compiler.py, then setting variables in a very gcc / clang-centric way. Now, all the compiler specific code has been moved to compiler.py. These makes it possible to (in theory) build with MSVC

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2017-05-29 Thread Ben Craig via Phabricator via cfe-commits
bcraig updated this revision to Diff 100650. bcraig edited the summary of this revision. https://reviews.llvm.org/D32411 Files: CMakeLists.txt docs/DesignDocs/IncludeNextEmulation.rst include/__config include/__config_site.in include/complex.h include/cstddef include/ctype.h

[PATCH] D33082: Fix Libc++ build with MinGW64

2017-05-25 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. > Are you suggesting that libc++ should stop declaring/defining these > functions, at least publically? I think that we generally shouldn't be giving functions names that are already claimed elsewhere (like mbsnrtowcs and wcsnrtombs). It is my opinion that these

[PATCH] D32146: PR32476: __nop_locale_mgmt.h not needed with newlib 2.5+

2017-05-18 Thread Ben Craig via Phabricator via cfe-commits
bcraig added inline comments. Comment at: include/support/newlib/xlocale.h:20 +#if defined(__NEWLIB__) && (__NEWLIB__ == 2) \ +&& defined(__NEWLIB_MINOR__) && (__NEWLIB_MINOR__ >= 5) \ +&& (!defined(__POSIX_VISIBLE) || (__POSIX_VISIBLE < 200809)) orivej

[PATCH] D33080: [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows

2017-05-12 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. > I noticed that the Windows STL headers have to do this dance with `new` (even > though they do `(foo)(...)` for `min` and `max`). If we're going to need > to guard against a bunch of macros I would like to use a single approach. > Other than updating the `#if

[PATCH] D33082: Fix Libc++ build with MinGW64

2017-05-11 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. I agree that we need to be precise in our platform detection macros. On Windows, we currently need to worry about which compiler is being used, whether we are targeting the mingw environment or the native (?) environment, and which c-runtime is being used. For my

[PATCH] D33080: [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows

2017-05-11 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. I like the warning that you generate for min and max macros existing. Is the push_macro / pop_macro the right way to go though? You could throw extra parenthesis around the declaration and usages of min/max to avoid macro expansion. #define add(x,y) (x)-(y)

[PATCH] D32988: [libc++] Refactor Windows support headers.

2017-05-10 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. LGTM https://reviews.llvm.org/D32988 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32988: [libc++] Refactor Windows support headers.

2017-05-09 Thread Ben Craig via Phabricator via cfe-commits
bcraig added inline comments. Comment at: include/__config:232-235 +#ifndef NOMINMAX +#define NOMINMAX +#endif + I can see this helping when we are build libc++, but I don't think it helps client apps. They could have included windows.h before including our

[PATCH] D32927: [libc++] Implement exception_ptr on Windows

2017-05-07 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. Getting the test suite green sooner rather than later seems like a good reason to temporarily pick a 1-3 year solution rather than a 5+ year solution. Also, as you mention, this isn't all throw away work, so it's still progress. So yeah, this is fine to go in as is.

[PATCH] D32927: [libc++] Implement exception_ptr on Windows

2017-05-06 Thread Ben Craig via Phabricator via cfe-commits
bcraig added inline comments. Comment at: test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp:12 + +// This test fails due to a stack overflow // XFAIL: LIBCXX-WINDOWS-FIXME EricWF wrote: > BillyONeal wrote: > > FWIW it does

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2017-05-04 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. I'm still working on this. Things I've learned: A clang install is bundled with re-implementations of several of these headers. The default #include_next behavior ends up pulling in lots of those. I have been able to get things working with a VC include path and a

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2017-04-24 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. In https://reviews.llvm.org/D32411#735128, @halyavin wrote: > BTW, the list of include files which are located in [PROGRAM_FILES]\Microsoft > Visual Studio 14.0\VC\include directory is > > - stdbool.h > - limits.h > - stdint.h > - setjmp.h > > The rest is in

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2017-04-23 Thread Ben Craig via Phabricator via cfe-commits
bcraig created this revision. Herald added a subscriber: mgorny. Visual Studio 2015 and 2017 don't implement include_next, so we'll use a combination of a computed include and a CMAKE input to make it work. Also, retrofit all the existing invocations of #include_next that we could hit in a

[PATCH] D32147: [PR32479] Avoid newlib vasprintf, since it requires gnu extensions

2017-04-17 Thread Ben Craig via Phabricator via cfe-commits
bcraig updated this revision to Diff 95520. bcraig added reviewers: jyknight, mclow.lists, EricWF. bcraig added a subscriber: cfe-commits. https://reviews.llvm.org/D32147 Files: include/__bsd_locale_fallbacks.h include/__config Index: include/__config

[PATCH] D32146: PR32476: __nop_locale_mgmt.h not needed with newlib 2.5+

2017-04-17 Thread Ben Craig via Phabricator via cfe-commits
bcraig created this revision. newlib 2.5 added the locale management functions, and so our stub __nop_locale_mgmt.h shouldn't be included, as it conflicts with newlibs definitions. newlib 2.4 and earlier still need the header though. Patch by Martin J. O'Riordan