TTobias Hieta[libc++][mdspan] Fix layout_left::stride(r)
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[libc++][ranges] Implement the changes to node-based containers from P1206 ( ranges::to): - add the from_range_t constructors and the related deduction guides; - add the insert_range/assign_range/etc. member functions. (Note: this patch is split from https://reviews.llvm.org/D142335) Differential Revision: https://reviews.llvm.org/D149830 | 2 年前 | |
[libc++][format] Improves diagnostics. Improves both the compile-time and run-time errors. At compile-time it does a bit more work to get more specific errors. This could be done at run-time too, but that has a performance penalty. Since it's expected most use-cases use format* instead of vformat* the compile-time errors are more common. For example when using std::format_to("{:-c}", 42); Before compile output would contain std::__throw_format_error("The format-spec should consume the input or end with a '}'"); Now it contains std::__throw_format_error("The format specifier does not allow the sign option"); Given a better indication the sign option is not allowed. Note the output is still not user-friendly; C++ doesn't have good facilities to generate nice messages from the library. In general all messages have been reviewed and improved, using a more consistent style and using less terms used in the standard. For example format-spec -> format specifier arg-id -> argument index Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D152624 | 2 年前 | |
[libc++] Enable [[nodiscard]] extensions by default Adding [[nodiscard]] to functions is a conforming extension and done extensively in the MSVC STL. Reviewed By: ldionne, EricWF, #libc Spies: #libc_vendors, cjdb, mgrang, jloser, libcxx-commits Differential Revision: https://reviews.llvm.org/D128267 | 3 年前 | |
[libc++] Make test_allocator constexpr-friendly for constexpr string/vector Make test_allocator etc. constexpr-friendly so they can be used to test constexpr string and possibly constexpr vector Reviewed By: Quuxplusone, #libc, ldionne Differential Revision: https://reviews.llvm.org/D110994 | 4 年前 | |
Support tests in freestanding Summary: Freestanding is *weird*. The standard allows it to differ in a bunch of odd manners from regular C++, and the committee would like to improve that situation. I'd like to make libc++ behave better with what freestanding should be, so that it can be a tool we use in improving the standard. To do that we need to try stuff out, both with "freestanding the language mode" and "freestanding the library subset". Let's start with the super basic: run the libc++ tests in freestanding, using clang as the compiler, and see what works. The easiest hack to do this: In utils/libcxx/test/config.py add: self.cxx.compile_flags += ['-ffreestanding'] Run the tests and they all fail. Why? Because in freestanding main isn't special. This "not special" property has two effects: main doesn't get mangled, and main isn't allowed to omit its return statement. The first means main gets mangled and the linker can't create a valid executable for us to test. The second means we spew out warnings (ew) and the compiler doesn't insert the return we omitted, and main just falls of the end and does whatever undefined behavior (if you're luck, ud2 leading to non-zero return code). Let's start my work with the basics. This patch changes all libc++ tests to declare main as int main(int, char** so it mangles consistently (enabling us to declare another extern "C" main for freestanding which calls the mangled one), and adds return 0; to all places where it was missing. This touches 6124 files, and I apologize. The former was done with The Magic Of Sed. The later was done with a (not quite correct but decent) clang tool: https://gist.github.com/jfbastien/793819ff360baa845483dde81170feed This works for most tests, though I did have to adjust a few places when e.g. the test runs with -x c, macros are used for main (such as for the filesystem tests), etc. Once this is in we can create a freestanding bot which will prevent further regressions. After that, we can start the real work of supporting C++ freestanding fairly well in libc++. <rdar://problem/47754795> Reviewers: ldionne, mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, arphaman, miyuki, libcxx-commits Differential Revision: https://reviews.llvm.org/D57624 llvm-svn: 353086 | 7 年前 | |
[libc++][format] Improves diagnostics. Improves both the compile-time and run-time errors. At compile-time it does a bit more work to get more specific errors. This could be done at run-time too, but that has a performance penalty. Since it's expected most use-cases use format* instead of vformat* the compile-time errors are more common. For example when using std::format_to("{:-c}", 42); Before compile output would contain std::__throw_format_error("The format-spec should consume the input or end with a '}'"); Now it contains std::__throw_format_error("The format specifier does not allow the sign option"); Given a better indication the sign option is not allowed. Note the output is still not user-friendly; C++ doesn't have good facilities to generate nice messages from the library. In general all messages have been reviewed and improved, using a more consistent style and using less terms used in the standard. For example format-spec -> format specifier arg-id -> argument index Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D152624 | 2 年前 | |
[libc++][ranges] Implement the changes to node-based containers from P1206 ( ranges::to): - add the from_range_t constructors and the related deduction guides; - add the insert_range/assign_range/etc. member functions. (Note: this patch is split from https://reviews.llvm.org/D142335) Differential Revision: https://reviews.llvm.org/D149830 | 2 年前 | |
[libc++][mdspan] Fix layout_left::stride(r) It was using the stride calculation of layout_right. Reviewed By: philnik Differential Revision: https://reviews.llvm.org/D157065 (cherry picked from commit 0f4d7d81c9d08512a3871596fa2a14b737233c80) | 2 年前 | |
[libc++] NFC: Normalize #endif // comment indentation | 5 年前 | |
[libc++] NFC: Normalize #endif // comment indentation | 5 年前 | |
[libc++] NFC: Normalize #endif // comment indentation | 5 年前 | |
[libc++] Qualifies size_t. This has been done using the following command find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)size_t)|\1std::\2|' \{} \; And manually removed some false positives in std/depr/depr.c.headers. The std module doesn't export ::size_t, this is a preparation for that module. Reviewed By: ldionne, #libc, EricWF, philnik Differential Revision: https://reviews.llvm.org/D146088 | 3 年前 | |
[libc++] Fix an exception safety issue in forward_list and add tests. When inserting nodes into a forward list, each new node is allocated but not constructed. The constructor was being called explicitly on the node value_ but the next_ pointer remained uninitialized rather than being set to null. This bug is only triggered in the cleanup code if an exception is thrown -- upon successful creation of new nodes, the last incorrect "next" value is overwritten to a correct pointer. This issue was found due to new tests added in https://reviews.llvm.org/D149830. Differential Revision: https://reviews.llvm.org/D152327 | 3 年前 | |
[libc++] Fix an exception safety issue in forward_list and add tests. When inserting nodes into a forward list, each new node is allocated but not constructed. The constructor was being called explicitly on the node value_ but the next_ pointer remained uninitialized rather than being set to null. This bug is only triggered in the cleanup code if an exception is thrown -- upon successful creation of new nodes, the last incorrect "next" value is overwritten to a correct pointer. This issue was found due to new tests added in https://reviews.llvm.org/D149830. Differential Revision: https://reviews.llvm.org/D152327 | 3 年前 | |
[libc++][ranges] Implement the changes to node-based containers from P1206 ( ranges::to): - add the from_range_t constructors and the related deduction guides; - add the insert_range/assign_range/etc. member functions. (Note: this patch is split from https://reviews.llvm.org/D142335) Differential Revision: https://reviews.llvm.org/D149830 | 2 年前 | |
[libc++][ranges] Implement the changes to node-based containers from P1206 ( ranges::to): - add the from_range_t constructors and the related deduction guides; - add the insert_range/assign_range/etc. member functions. (Note: this patch is split from https://reviews.llvm.org/D142335) Differential Revision: https://reviews.llvm.org/D149830 | 2 年前 | |
[libc++] Expand the contents of LIBCXX_ENABLE_FILESYSTEM Since LIBCXX_ENABLE_FILESYSTEM now truly represents whether the platform supports a filesystem (as opposed to whether the <filesystem> library is provided), we can provide a few additional classes from the <filesystem> library even when the platform does not have support for a filesystem. For example, this allows performing path manipulations using std::filesystem::path even on platforms where there is no actual filesystem. rdar://107061236 Differential Revision: https://reviews.llvm.org/D152382 | 3 年前 | |
[libc++][NFC] Consistently use newline between license and include guard | 3 年前 | |
[libc++][NFC] Consistently use newline between license and include guard | 3 年前 | |
[libc++] [test] Update "test_compare.h" users to avoid removed-in-C++20 members. NFCI. Drive-by minor improvements to a couple of uses of min_pointer. Differential Revision: https://reviews.llvm.org/D103366 | 5 年前 | |
[libc++] [test] No longer rely on std::hash<T>::argument_type. Differential Revision: https://reviews.llvm.org/D104166 | 5 年前 |