summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
...
* First part of P1227R2 - change span over to use 'size_t' instead of ↵Marshall Clow2019-02-277-51/+47
| | | | | | 'ptrdiff_t'. Reviewed as https://reviews.llvm.org/D58639. llvm-svn: 354936
* [libc++] Add <filesystem> to the min-mac macro header testLouis Dionne2019-02-261-0/+2
| | | | llvm-svn: 354932
* Remove P1272R1, it was not moved in KonaMarshall Clow2019-02-261-1/+0
| | | | llvm-svn: 354904
* Put a 'first implemented' version into the entry for P1357Marshall Clow2019-02-261-1/+1
| | | | llvm-svn: 354901
* Mark several issues (and one paper) as complete. Reviewed as D58099; but I ↵Marshall Clow2019-02-262-8/+8
| | | | | | added LWG3101 and LWG3144 and P1357R1 as well. llvm-svn: 354898
* Implement P1357: Traits for [Un]bounded Arrays; adopted in KonaMarshall Clow2019-02-263-0/+171
| | | | llvm-svn: 354891
* [libc++] Rename _NOALIAS macro to _LIBCPP_NOALIASLouis Dionne2019-02-262-6/+6
| | | | | | | | | | | | | | Summary: For consistency, libc++ macros always start with _LIBCPP. This should have no functionality change. Reviewers: EricWF, mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D58558 llvm-svn: 354848
* LWG3101 - span's Container constructors need another constraint. Reviewed as ↵Marshall Clow2019-02-253-64/+10
| | | | | | https://reviews.llvm.org/D57058. llvm-svn: 354805
* Commit LWG3144 - span does not have a const_pointer typedef. Reviewed as D57039.Marshall Clow2019-02-252-4/+10
| | | | llvm-svn: 354802
* First part of P1024: Usability Enhancements for std::span. Remove operator() ↵Marshall Clow2019-02-254-15/+175
| | | | | | for indexing, and add 'front' and 'back' calls. llvm-svn: 354801
* Update status page with papers/issues adopted in KonaMarshall Clow2019-02-251-3/+37
| | | | llvm-svn: 354796
* [libcxx] Make sure all experimental tests are disabled when ↵Louis Dionne2019-02-2332-30/+6
| | | | | | | | | | | | | | | | enable_experimental=False Summary: Previously, we'd run some experimental tests even when enable_experimental=False was used with lit. Reviewers: EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits, mclow.lists Differential Revision: https://reviews.llvm.org/D55834 llvm-svn: 354725
* [NFC] Fix incorrect comment in std::function testLouis Dionne2019-02-211-1/+1
| | | | llvm-svn: 354537
* Fix the build with gcc when `-Wredundant-decls` is passedDimitry Andric2019-02-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: gcc warns that `__throw_runtime_error` is declared both in `<__locale>` and `<stdexcept>`, if `-Wredundant-decls` is passed on the command line; this is the case with FreeBSD when ${WARNS} == 6. Since `<__locale>` gets its first declaration via a transitive include of `<stdexcept>`, and the second declaration is after the first invocation of `__throw_runtime_error`, delete that second declaration. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com> Reviewers: kristina, MaskRay, EricWF, ldionne, ngie Reviewed By: EricWF Subscribers: krytarowski, brooks, emaste, dim, christof, jdoerfert, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D58425 llvm-svn: 354515
* [compiler-rt] Build custom libcxx with libcxxabiJonas Hahnfeld2019-02-172-2/+2
| | | | | | | | | | | | | | | This changes add_custom_libcxx to also build libcxxabi and merges the two into a static and hermetic library. There are multiple advantages: 1) The resulting libFuzzer doesn't expose C++ internals and looks like a plain C library. 2) We don't have to manually link in libstdc++ to provide cxxabi. 3) The sanitizer tests cannot interfere with an installed version of libc++.so in LD_LIBRARY_PATH. Differential Revision: https://reviews.llvm.org/D58013 llvm-svn: 354212
* [libcxx] Do not assume the number of elements in a moved-from associative ↵Louis Dionne2019-02-134-12/+24
| | | | | | | | | container Reviewed as https://reviews.llvm.org/D57903. Thanks to Andrey Maksimov for the patch. llvm-svn: 353955
* [libc++] Avoid UB in the no-exceptions mode in a few placesLouis Dionne2019-02-1214-50/+301
| | | | | | | | | | | | | | | | | | | | | | | Summary: A few places in the library seem to behave unexpectedly when the library is compiled or used with exceptions disabled. For example, not throwing an exception when a pointer is NULL can lead us to dereference the pointer later on, which is UB. This patch fixes such occurences. It's hard to tell whether there are other places where the no-exceptions mode misbehaves like this, because the replacement for throwing an exception does not always seem to be abort()ing, but at least this patch will improve the situation somewhat. See http://lists.llvm.org/pipermail/libcxx-dev/2019-January/000172.html Reviewers: mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D57761 llvm-svn: 353850
* [CMake] Avoid passing -rtlib=compiler-rt when using compiler-rtPetr Hosek2019-02-121-4/+0
| | | | | | | | | | | | We build libc++ and libc++abi with -nodefaultlibs, so -rtlib=compiler-rt has no effect and results in an 'argument unused during compilation' warning which breaks the build when using -Werror. We can therefore drop -rtlib=compiler-rt without any functional change; note that the actual compiler-rt linking is handled by HandleCompilerRT. Differential Revision: https://reviews.llvm.org/D58084 llvm-svn: 353786
* Don't declare fenv.h functions when they're a macro.Eric Fiselier2019-02-121-100/+11
| | | | | | | libc still provides function declarations, and these declarations conflict with libc++'s llvm-svn: 353774
* Make the sym_diff utilities more useful.Eric Fiselier2019-02-123-17/+40
| | | | | | In particular when working with static libraries and libstdc++. llvm-svn: 353772
* Add fenv.h headerEric Fiselier2019-02-117-12/+241
| | | | | | | | | | | | | | | | | Summary: Some implementations of fenv.h use macros to define the functions they provide. This can cause problems when `std::fegetround()` is spelled in source. This patch adds a `fenv.h` header to libc++ for the sole purpose of turning those macros into real functions. Reviewers: rsmith, mclow.lists, ldionne Reviewed By: rsmith Subscribers: mgorny, christof, libcxx-commits Differential Revision: https://reviews.llvm.org/D57729 llvm-svn: 353767
* [libcxx] Preserve order, avoid duplicates when merging static archivesPetr Hosek2019-02-111-8/+9
| | | | | | | | | | | glob can return files in arbitrary order which breaks deterministic builds. Rather, use `ar t` to list the files in each archive and preserve the original order. Using `ar q` results in duplicate entries in the archive, instead use `ar r` to avoid duplicates. Differential Revision: https://reviews.llvm.org/D58024 llvm-svn: 353671
* The new file header didn't get carried over when these files wereChandler Carruth2019-02-112-8/+6
| | | | | | "moved" somehow, update them to use it. llvm-svn: 353669
* Update some newly added files that mistakenly used the old file headerChandler Carruth2019-02-112-8/+6
| | | | | | to the new one. llvm-svn: 353668
* fix -Wextra-semi warningsEric Fiselier2019-02-101-5/+5
| | | | llvm-svn: 353650
* Make LIBCXX_STANDARD_VER configurableEric Fiselier2019-02-102-3/+4
| | | | llvm-svn: 353649
* Format sym_extract.py output to minimize diff output.Eric Fiselier2019-02-104-6543/+6545
| | | | | | | | Different versions of python print dictionaries in different orders. This can mess up diffs when updating ABI lists. This patch uses pprint.pformat to print the dicts to get a consistent ordering. llvm-svn: 353634
* Add missing symbols to Apple v2 abi list.Eric Fiselier2019-02-101-0/+6
| | | | | | | | The itoa symbols were added and their addition is documented in the CHANGELOG. I'm not sure why the valarray symbols were missing previously, but they're present in the v1 ABI lists and should be here as well. llvm-svn: 353633
* Add ABI list directories for 8.0Eric Fiselier2019-02-103-0/+6536
| | | | llvm-svn: 353632
* Mark another test as flakyKamil Rytarowski2019-02-091-0/+2
| | | | | | Reported on the NetBSD buildbot. llvm-svn: 353622
* [libcxx] Support runtimes and monorepo locations for testsPetr Hosek2019-02-091-3/+9
| | | | | | | | | | | | | | | | | The test configuration support currently searches for libc++ sources in <ROOT>/projects/libcxx. This change also additionally searches <ROOT>/runtimes/libcxx (so called runtimes layout) and <ROOT>/libcxx (monorepo layout). This matches the logic we already use in CMake, for example: https://github.com/llvm/llvm-project/blob/6fd4e7f/libcxx/CMakeLists.txt#L148 When the monorepo becomes the only supported layout in the future, we can simplify this logic again. Differential Revision: https://reviews.llvm.org/D57776 llvm-svn: 353600
* Add static_asserts to tuple's comparison operators to enforce the ↵Marshall Clow2019-02-071-0/+2
| | | | | | requirement that the tuples be the same size. See PR39183 for an example where we give unexpected results for this bad input case. With this change, we will reject it at compile-time llvm-svn: 353450
* Add UBSAN annotation to __hash_table::rehash; we don't do anything wrong, ↵Marshall Clow2019-02-071-0/+1
| | | | | | but UBSAN's checker flags it as suspicious. See PR38606. NFC llvm-svn: 353448
* Revert "[libc++] Only add dylib-related features when using the system's libc++"Louis Dionne2019-02-061-1/+1
| | | | | | This reverts r353319, which broke our internal CI. llvm-svn: 353321
* [libc++] Only add dylib-related features when using the system's libc++Louis Dionne2019-02-061-1/+1
| | | | | | | | | | | | Otherwise, when testing trunk libc++ on an older system, lit will think that the dylib features are disabled. Ideally, we'd have a notion of running the tests with/without a deployment target (or, equivalently, a deployment target representing trunk where everything is as recent as can be). Since we always have a deployment target right now (which defaults to the current system), we only enable those features when we're going to also be testing with the system libc++. llvm-svn: 353319
* Add a specialization for '__unwrap_iter' to handle const interators. This ↵Marshall Clow2019-02-061-0/+12
| | | | | | enables the 'memmove' optimization for std::copy, etc. llvm-svn: 353311
* [libc++] Fix XFAILs when exceptions are disabledLouis Dionne2019-02-053-3/+3
| | | | | | | | It turns out that I un-XFAILed too many tests in r353210: some tests actually fail whether exceptions are enabled or not because they use types that are marked as unavailable even when exceptions are disabled. llvm-svn: 353215
* [libc++] Fix XFAILs on macOS when exceptions are disabledLouis Dionne2019-02-0545-45/+45
| | | | | | | | Some tests are marked as failing on platforms where the dylib does not provide the required exception classes. However, when testing with exceptions disabled, those tests shouldn't be marked as failing. llvm-svn: 353210
* [CMake] Support compiler-rt builtins library in testsPetr Hosek2019-02-053-3/+13
| | | | | | | | | | | | | | | | | | | | We're building tests with -nostdlib which means that we need to explicitly include the builtins library. When using libgcc (default) we can simply include -lgcc_s on the link line, but when using compiler-rt builtins we need a complete path to the builtins library. This path is already available in CMake as <PROJECT>_BUILTINS_LIBRARY, so we just need to pass that path to lit and if config.compiler_rt is true, link it to the test. Prior to this patch, running tests when compiler-rt is being used as the builtins library was broken as all tests would fail to link, but with this change running tests when compiler-rt bultins library is being used should be supported. Differential Revision: https://reviews.llvm.org/D56701 llvm-svn: 353208
* [libc++] Use UNSUPPORTED instead of TEST_STD_VER #ifdefLouis Dionne2019-02-055-37/+11
| | | | | | | | | | | When the whole test only works starting at some version of the Standard, use UNSUPPORTED lit markup instead of #ifdef TEST_STD_VER. This provides more visibility into the test suite. Reviewed as https://reviews.llvm.org/D57704. Thanks to Andrey Maksimov for the patch. llvm-svn: 353206
* [libcxx] Start defining lit features for tests depending on availabilityLouis Dionne2019-02-0547-321/+65
| | | | | | | | | | | | | | | | | This patch removes some vendor-specific availability XFAILs from the test suite. In the future, when a new feature is introduced in the dylib, an availability macro should be created and a matching lit feature should be created. That way, the test suite can XFAIL whenever the implementation lacks the necessary feature instead of being cluttered by vendor-specific annotations. Right now, those vendor-specific annotations are still somewhat cluttering the test suite by being in `config.py`, but at least they are localized. In the future, we could design a way to define those less intrusively or even automatically based on the availability macros that already exist in <__config>. llvm-svn: 353201
* [libc++] Control whether exceptions are enabled in the macOS trunk testing ↵Louis Dionne2019-02-051-7/+15
| | | | | | script llvm-svn: 353185
* [NFC][libc++] Reindent functionLouis Dionne2019-02-051-4/+2
| | | | llvm-svn: 353180
* Fix double curliesJF Bastien2019-02-051-1/+1
| | | | | | Pointed out by Arthur in D57624. llvm-svn: 353140
* [CMake] Update lit test configurationPetr Hosek2019-02-052-18/+18
| | | | | | | | | There are several changes: - Don't stringify Pythonized bools (that's why we're Pythonizing them) - Support specifying target and sysroot via CMake variables - Use consistent spelling for --target, --sysroot, --gcc-toolchain llvm-svn: 353137
* Support tests in freestandingJF Bastien2019-02-046123-6227/+18208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [CMake] Support CMake variables for setting target, sysroot and toolchainPetr Hosek2019-02-042-5/+20
| | | | | | | | | | | | | | | | | | | | | | CMake has a standard way of setting target triple, sysroot and external toolchain through CMAKE_<LANG>_COMPILER_TARGET, CMAKE_SYSROOT and CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN. These are turned into corresponding --target=, --sysroot= and --gcc-toolchain= variables add included appended to CMAKE_<LANG>_FLAGS. libunwind, libc++abi, libc++ provides their own mechanism through <PROJECT>_TARGET_TRIPLE, <PROJECT>_SYSROOT and <PROJECT>_GCC_TOOLCHAIN variables. These are also passed to lit via lit.site.cfg, and lit config uses these to set the corresponding compiler flags when building tessts. This means that there are two different ways of setting target, sysroot and toolchain, but only one is properly supported in lit. This change extends CMake build for libunwind, libc++abi and libc++ to also support the CMake variables in addition to project specific ones in lit. Differential Revision: https://reviews.llvm.org/D57670 llvm-svn: 353084
* Move the feature test macros script to the utils directory.Eric Fiselier2019-02-022-13/+15
| | | | | | | It doesn't make a lot of sense to keep it with the tests, deep into the test suite directonies. llvm-svn: 352970
* Handle cases where the dirent::d_type macros aren't definedEric Fiselier2019-02-011-0/+3
| | | | llvm-svn: 352942
* add a test and a couple minor bug fixes for the ↵Marshall Clow2019-02-013-2/+7
| | | | | | implicit-signed-integer-truncation sanitizer. This is PR#40566 llvm-svn: 352926
OpenPOWER on IntegriCloud