summaryrefslogtreecommitdiffstats
path: root/libcxx/docs
Commit message (Collapse)AuthorAgeFilesLines
* Update the docs for building libc++.Dan Albert2019-11-181-25/+29
| | | | | | | | | | | | | | | | Summary: Rewrite the in-tree build to be a clearer tl;dr like we have for the out-of-tree build. Reviewers: EricWF, mclow.lists, ldionne Reviewed By: ldionne Subscribers: dexonsmith, christof, ldionne, enh, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D69917
* [libc++] [P1612] Add missing feature-test macro __cpp_lib_endian.Louis Dionne2019-11-141-1/+3
| | | | | | Thanks to Marek Kurdej for the patch. Differential Revision: https://reviews.llvm.org/D70221
* [NFC] Fix typos in libc++ documentationLouis Dionne2019-10-011-3/+3
| | | | llvm-svn: 373390
* Reformat the beginning of the testing doc to make clear how to run all the ↵Marshall Clow2019-09-051-5/+8
| | | | | | tests. llvm-svn: 371001
* [libc++] Fix typo in documentation for LIBCXX_HERMETIC_STATIC_LIBRARYLouis Dionne2019-08-231-1/+1
| | | | | | | Thanks to Yichen Yan for the patch. Differential Revision: https://reviews.llvm.org/D66675 llvm-svn: 369800
* [libc++] Use [[nodiscard]] for lock_guard, as an extensionLouis Dionne2019-08-131-0/+1
| | | | | | | | | | | | | | | | | | | Summary: D64914 added support for applying [[nodiscard]] to constructors. This commit uses that capability to flag incorrect uses of std::lock_guard where one forgets to actually create a variable for the lock_guard. rdar://45790820 Reviewers: mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits, Quuxplusone, lebedev.ri Tags: #libc Differential Revision: https://reviews.llvm.org/D65900 llvm-svn: 368664
* Bump the trunk version to 10.0.0svnHans Wennborg2019-07-182-9/+9
| | | | | | and clear the release notes. llvm-svn: 366427
* docs: add documentation for `LIBCXX_INCLUDE_TESTS`Saleem Abdulrasool2019-07-041-0/+6
| | | | | | | | Add some missing documentation for the `LIBCXX_INCLUDE_TESTS` option. Patch by Jean Heyd Meneide! llvm-svn: 365154
* Make GCC in C++03 UnsupportedEric Fiselier2019-06-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch make G++03 explicitly unsupported with libc++, as discussed on the mailing lists. Below is the rational for this decision. ---------------------------------------------------------------------------------------------------- libc++ claims to support GCC with C++03 ("G++03"), and this is a problem for our users. Our C++03 users are all using Clang. They must be. Less than 9% of the C++03 tests pass with GCC [1][2]. No non-trivial C++ program could work. Attempting to support G++03 impacts our QoI considerably. Unlike Clang, G++03 offers almost no C++11 extensions. If we could remove all the fallbacks for G++03, it would mean libc++ could:: * Improve Correctness: Every `#ifdef _LIBCPP_HAS_NO_<C++11-feature>` is a bug manifest. It exists to admit for deviant semantics. * Achieve ABI stability between C++03 and C++11 Differences between our C++03 and C++Rest branches contain ABI bugs. For example `std::nullptr_t` and `std::function::operator()(...)` are currently incompatible between C++11 and C++03, but could be fixed. * Decrease Compile Times and Memory Usage: Writing efficient SFINAE requires C++11. Using alias templates, libc++ could reduce the number of instantiations it produces substantially. * Decrease Binary Size Similar to the last point, G++03 forces metaprogramming techniques that emit more debug information [3] [4]. Compared to libstdc++, debug information size increases of +10% are not uncommon. Reviewers: ldionne, mclow.lists, EricWF Reviewed By: ldionne, EricWF Subscribers: zoecarver, aprantl, dexonsmith, arphaman, libcxx-commits, #libc Differential Revision: https://reviews.llvm.org/D63154 llvm-svn: 363219
* Add documentation and tests for Clangs C++11 extensions in C++03.Eric Fiselier2019-06-112-0/+119
| | | | | | | | | | | | | | | | As we gear up to drop support for GCC in C++03, we should make clear what our C++03 mode is, the C++11 extensions it provides, and the C++11 extensions it depends on. The section of this document discussing user-facing extensions has been left blank while the community discusses new directions. For now it's just a warning to users. Additionally, the document contains examples of how these extensions should be used and why. For example, using alias templates over class templates. llvm-svn: 363110
* [libcxx] Slightly improved policy for handling experimental featuresLouis Dionne2019-06-113-0/+207
| | | | | | | | | | | | | | | | | | | | Summary: Following the discussion on the libcxx-dev mailing list (http://lists.llvm.org/pipermail/libcxx-dev/2019-May/000358.html), this implements the new policy for handling experimental features and their deprecation. We basically add a deprecation warning for std::experimental::filesystem, and we remove a bunch of <experimental/*> headers that were now empty. Reviewers: mclow.lists, EricWF Subscribers: mgorny, christof, jkorous, dexonsmith, arphaman, libcxx-commits, jfb Tags: #libc Differential Revision: https://reviews.llvm.org/D62428 llvm-svn: 363072
* update debugging docs to be less out of dateEric Fiselier2019-06-081-23/+14
| | | | llvm-svn: 362866
* [Docs] Modernize references to macOSJ. Ryan Stinnett2019-05-303-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This updates all places in documentation that refer to "Mac OS X", "OS X", etc. to instead use the modern name "macOS" when no specific version number is mentioned. If a specific version is mentioned, this attempts to use the OS name at the time of that version: * Mac OS X for 10.0 - 10.7 * OS X for 10.8 - 10.11 * macOS for 10.12 - present Reviewers: JDevlieghere Subscribers: mgorny, christof, arphaman, cfe-commits, lldb-commits, libcxx-commits, llvm-commits Tags: #clang, #lldb, #libc, #llvm Differential Revision: https://reviews.llvm.org/D62654 llvm-svn: 362113
* Rework std::type_info definition to support systems without fullyEric Fiselier2019-05-291-0/+15
| | | | | | | | | | | | | | | | | | merged type info names. Previously std::type_info always expected type info string to be unique. But this isn't always the case. Like when -Bsymbolic is passed to the linker or due to llvm.org/PR37398. This patch adds the LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT CMake option which, when specified, overrides the default configuration for the library. The current defaults still assume unique names even though this isn't strictly correct for ELF binaries. We should consider changing the default in a follow up commit. llvm-svn: 361913
* P0722R3: Implement library support for destroying deleteEric Fiselier2019-05-231-1/+1
| | | | | | | | | | | | | | | | | | Summary: This provides the `std::destroying_delete_t` declaration in C++2a and after. (Even when the compiler doesn't support the language feature). However, the feature test macro `__cpp_lib_destroying_delete` is only defined when we have both language support and C++2a. Reviewers: ldionne, ckennelly, serge-sans-paille, EricWF Reviewed By: EricWF Subscribers: dexonsmith, riccibruno, christof, jwakely, jdoerfert, mclow.lists, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D55840 llvm-svn: 361572
* Implement midpoint for floating point types. Reviewed as ↵Marshall Clow2019-04-251-0/+2
| | | | | | https://reviews.llvm.org/D61014. llvm-svn: 359184
* Add std::is_constant_evaluated.Eric Fiselier2019-04-241-1/+1
| | | | | | | | | Clang recently added __builtin_is_constant_evaluated() and GCC 9.0 has it as well. This patch adds support for it in libc++. llvm-svn: 359119
* Remove repeated words from BuildingLibcxx.rstJonathan Metzman2019-04-101-1/+1
| | | | | | | | | | | | | | Summary: Remove repeated words from docs. Reviewers: phosek Reviewed By: phosek Subscribers: christof Differential Revision: https://reviews.llvm.org/D60530 llvm-svn: 358147
* libcxx: Add _LIBCPP_NODISCARD_EXT to 38 more functionsNico Weber2019-04-031-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This builds on the work done in r342808 and adds _LIBCPP_NODISCARD_EXT to 37 more functions, namely: adjacent_find, all_of, any_of, binary_search, clamp, count_if, count, equal_range, equal, find_end, find_first_not_of, find_first_of, find_if, find, includes, is_heap_until, is_heap, is_partitioned, is_permutation, is_sorted_until, is_sorted, lexicographical_compare, lower_bound, max_element, max, min_element, min, minmax_element, minmax, mismatch, none_of, remove_if, remove, search_n, search, unique, upper_bound The motivation here is that we noticed that find_if is nodiscard with Visual Studio's standard library, and we deemed that useful (https://crbug.com/948122). https://devblogs.microsoft.com/cppblog/c17-progress-in-vs-2017-15-5-and-15-6/ says "Our criteria for emitting the warning are: discarding the return value is a guaranteed leak [...], discarding the return value is near-guaranteed to be incorrect (e.g. remove()/remove_if()/unique()), or the function is essentially a pure observer (e.g. vector::empty() and std::is_sorted())." so I went through algorithm and tried to apply these criteria. Some of these, like vector::empty() are already nodiscard per C++ standard and didn't need changing. I didn't (yet?) go over std::string::find* methods which should probably have _LIBCPP_NODISCARD_EXT too (but not as part of this change). Differential Revision: https://reviews.llvm.org/D60145 llvm-svn: 357619
* [libc++] Re-document how to use <filesystem> with various versions of libc++Louis Dionne2019-03-211-0/+10
| | | | | | | | | This documentation was removed when we added <filesystem> to the dylib in r356518, but it really should have been updated to reflect the new state of things. Keeping documentation around doesn't hurt and users will have an easier time migrating. llvm-svn: 356681
* Allow disabling of filesystem library.Eric Fiselier2019-03-211-0/+7
| | | | | | | | | | | | | | Summary: Filesystem doesn't work on Windows, so we need a mechanism to turn it off for the time being. Reviewers: ldionne, serge-sans-paille, EricWF Reviewed By: EricWF Subscribers: mstorsjo, mgorny, christof, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D59619 llvm-svn: 356633
* [libc++][CMake] Clean up some of the libc++ re-exporting logicLouis Dionne2019-03-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: This change allows specifying the version of libc++abi's ABI to re-export when configuring CMake. It also clearly identifies which ABI version of libc++abi each export file contains. Finally, it removes hardcoded knowledge about the 10.9 SDK for MacOS, since that knowledge is not relevant anymore. Indeed, libc++ can't be built with the toolchain that came with the 10.9 SDK anyway because the version of Clang it includes is too old (for example if you want to build a working libc++.dylib, you need bugfixes to visibility attributes that are only in recent Clangs). Reviewers: dexonsmith, EricWF Subscribers: mgorny, christof, jkorous, arphaman, libcxx-commits Differential Revision: https://reviews.llvm.org/D59489 llvm-svn: 356587
* [libc++] Build <filesystem> support as part of the dylibLouis Dionne2019-03-192-32/+0
| | | | | | | | | | | | | | | | | | | Summary: This patch treats <filesystem> as a first-class citizen of the dylib, like all other sub-libraries (e.g. <chrono>). As such, it also removes all special handling for installing the filesystem library separately or disabling part of the test suite from the lit command line. Unlike the previous attempt (r356500), this doesn't remove all the filesystem tests. Reviewers: mclow.lists, EricWF, serge-sans-paille Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D59152 llvm-svn: 356518
* Revert "[libc++] Build <filesystem> support as part of the dylib"Louis Dionne2019-03-192-0/+32
| | | | | | | | When I applied r356500 (https://reviews.llvm.org/D59152), I somehow deleted all of filesystem's tests. I will revert r356500 and re-apply it properly. llvm-svn: 356505
* [libc++] Build <filesystem> support as part of the dylibLouis Dionne2019-03-192-32/+0
| | | | | | | | | | | | | | | | Summary: This patch treats <filesystem> as a first-class citizen of the dylib, like all other sub-libraries (e.g. <chrono>). As such, it also removes all special handling for installing the filesystem library separately or disabling part of the test suite from the lit command line. Reviewers: mclow.lists, EricWF, serge-sans-paille Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D59152 llvm-svn: 356500
* [libc++] Enable deprecation warnings by defaultLouis Dionne2019-03-121-5/+5
| | | | | | | | | | | | | | | | | | | Summary: In r342843, I added deprecation warnings to some facilities that were deprectated in C++14 and C++17. However, those deprecation warnings were not enabled by default. After discussing this on IRC, we had finally gotten consensus to enable those warnings by default, and I'm getting around to doing that only now. Reviewers: mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D58140 llvm-svn: 355961
* [CMake] Support compiler-rt builtins library in testsPetr Hosek2019-02-051-0/+8
| | | | | | | | | | | | | | | | | | | | 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
* [libcxx] Start defining lit features for tests depending on availabilityLouis Dionne2019-02-051-0/+6
| | | | | | | | | | | | | | | | | 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
* Support tests in freestandingJF Bastien2019-02-042-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Move the feature test macros script to the utils directory.Eric Fiselier2019-02-021-4/+5
| | | | | | | It doesn't make a lot of sense to keep it with the tests, deep into the test suite directonies. llvm-svn: 352970
* Adjust documentation for git migration.James Y Knight2019-01-292-38/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes most references to the paths: llvm.org/svn/ llvm.org/git/ llvm.org/viewvc/ github.com/llvm-mirror/ github.com/llvm-project/ reviews.llvm.org/diffusion/ to instead point to https://github.com/llvm/llvm-project. This is *not* a trivial substitution, because additionally, all the checkout instructions had to be migrated to instruct users on how to use the monorepo layout, setting LLVM_ENABLE_PROJECTS instead of checking out various projects into various subdirectories. I've attempted to not change any scripts here, only documentation. The scripts will have to be addressed separately. Additionally, I've deleted one document which appeared to be outdated and unneeded: lldb/docs/building-with-debug-llvm.txt Differential Revision: https://reviews.llvm.org/D57330 llvm-svn: 352514
* Update an example to use the new LLVM file header.Chandler Carruth2019-01-191-8/+6
| | | | llvm-svn: 351653
* Bump the trunk version to 9.0.0svnHans Wennborg2019-01-162-26/+7
| | | | llvm-svn: 351320
* Implement feature test macros using a script.Eric Fiselier2019-01-163-0/+251
| | | | | | | | | | | | | | | | | | | | Summary: This patch implements all the feature test macros libc++ currently supports, as specified by the standard or cppreference prior to C++2a. The tests and `<version>` header are generated using a script. The script contains a table of each feature test macro, the headers it should be accessible from, and its values of each dialect of C++. When a new feature test macro is added or needed, the table should be updated and the script re-run. Reviewers: mclow.lists, jfb, serge-sans-paille Reviewed By: mclow.lists Subscribers: arphaman, jfb, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D56750 llvm-svn: 351286
* [libcxx] Support building hermetic static libraryPetr Hosek2019-01-061-0/+9
| | | | | | | | | | | | This is useful when static libc++ library is being linked into shared libraries that may be used in combination with libraries. We want to avoid we exporting libc++ symbols in those cases where this option is useful. This is provided as a CMake option and can be enabled by libc++ vendors as needed. Differential Revision: https://reviews.llvm.org/D55404 llvm-svn: 350489
* [libcxx] Make sure use_system_cxx_lib does not override cxx_runtime_root for ↵Louis Dionne2018-12-141-2/+1
| | | | | | | | | | | | DYLD_LIBRARY_PATH Otherwise, even specifying a runtime root different from the library we're linking against won't work -- the library we're linking against is always used. This is undesirable if we try testing something like linking against a recent libc++.dylib but running the tests against an older version (the back-deployment use case). llvm-svn: 349171
* [libcxx] Remove the no_default_flags LIT configurationLouis Dionne2018-12-111-8/+0
| | | | | | | | | This is part of an ongoing cleanup of the LIT test suite, where I'm trying to reduce the number of configuration options. In this case, the original intent seemed to be running the test suite with libstdc++, but this is now supported by specifying cxx_stdlib_under_test=libstdc++. llvm-svn: 348868
* [libcxx] Remove the availability_markup LIT featureLouis Dionne2018-12-071-21/+8
| | | | | | | It is now equivalent to the 'availability' LIT feature, so there's no reason to keep both. llvm-svn: 348653
* [libc++] Improve diagnostics for non-const comparators and hashers in ↵Louis Dionne2018-12-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | associative containers Summary: When providing a non-const-callable comparator in a map or set, the warning diagnostic does not include the point of instantiation of the container that triggered the warning, which makes it difficult to track down the problem. This commit improves the diagnostic by placing it directly in the body of the associative container. The same change is applied to unordered associative containers, which had a similar problem. Finally, this commit cleans up the forward declarations of several map and unordered_map helpers, which are not needed anymore. <rdar://problem/41370747> Reviewers: EricWF, mclow.lists Subscribers: christof, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D48955 llvm-svn: 348529
* [libcxx] Always enable availability in the lit test suite.Louis Dionne2018-12-041-4/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: Running the tests without availability enabled doesn't really make sense: availability annotations allow catching errors at compile-time instead of link-time. Running the tests without availability enabled allows confirming that a test breaks at link-time under some configuration, but it is more useful to instead check that it should fail at compile-time. Always enabling availability in the lit test suite will greatly simplify XFAILs and troubleshooting of failing tests, which is currently a giant pain because we have these two levels of possible failure: link-time and compile-time. Reviewers: EricWF, mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D55079 llvm-svn: 348296
* [libcxx] Remove bad_array_lengthLouis Dionne2018-11-291-0/+8
| | | | | | | | | | | | | | | | Summary: std::bad_array_length was added by n3467, but this never made it into C++. This commit removes the definition of std::bad_array_length from the headers AND from the shared library. See the comments in the ABI changelog for details about the ABI implications of this change. Reviewers: mclow.lists, dexonsmith, howard.hinnant, EricWF Subscribers: christof, jkorous, libcxx-commits Differential Revision: https://reviews.llvm.org/D54804 llvm-svn: 347903
* [libcxx] Remove dynarrayLouis Dionne2018-11-281-0/+4
| | | | | | | | | | | | | | Summary: std::dynarray had been proposed for C++14, but it was pulled out from C++14 and there are no plans to standardize it anymore. Reviewers: mclow.lists, EricWF Subscribers: mgorny, christof, jkorous, dexonsmith, arphaman, libcxx-commits Differential Revision: https://reviews.llvm.org/D54801 llvm-svn: 347783
* [NFC] Fix formatting in availability documentationLouis Dionne2018-11-201-12/+12
| | | | llvm-svn: 347362
* [libcxx] Mention restriction on inline namespaces in LIBCXX_ABI_NAMESPACE docsLouis Dionne2018-11-161-1/+3
| | | | | | | | | | I also kept the original "vague" documentation that saying that users are responsible for not breaking us. This doesn't mean anything because there's no way they can actually enforce that unless we restrict ourselves to a specific naming scheme, but I left the documentation because it acts as a good warning and gives us more leeway. llvm-svn: 347052
* Rename cxx-benchmark-unittests target and convert to LIT.Eric Fiselier2018-11-141-0/+9
| | | | | | | | | | | | | | This patch renames the cxx-benchmark-unittests to check-cxx-benchmarks and converts the target to use LIT in order to make the tests run faster and provide better output. In particular this runs each benchmark in a suite one by one, allowing more parallelism while ensuring output isn't garbage with multiple threads. Additionally, it adds the CMake flag '-DLIBCXX_BENCHMARK_TEST_ARGS=<list>' to specify what options are passed when running the benchmarks. llvm-svn: 346888
* Make libc++'s versioning namespace customizableEric Fiselier2018-10-301-0/+12
| | | | | | | | | | | | | | | | | Summary: This patch makes the versioning namespace libc++ uses customizable by the user using `-DLIBCXX_ABI_NAMESPACE=__foo`. This allows users to build custom versions of libc++ which can be linked into binaries with other libc++ versions without causing symbol conflicts or ODR issues. Reviewers: mclow.lists, ldionne Reviewed By: ldionne Subscribers: kristina, smeenai, mgorny, phosek, libcxx-commits Differential Revision: https://reviews.llvm.org/D53879 llvm-svn: 345657
* [libc++] Use exclude_from_explicit_instantiation instead of always_inlineLouis Dionne2018-10-291-0/+7
| | | | | | | | | | | | | | | | | | | | | | | Summary: This commit adopts the exclude_from_explicit_instantiation attribute discussed at [1] and reviewed in [2] in libc++ to supplant the use of __always_inline__ for visibility purposes. This change means that users wanting to link together translation units built with different versions of libc++'s headers into the same final linked image MUST define the _LIBCPP_HIDE_FROM_ABI_PER_TU macro to 1 when building those TUs. Doing otherwise will lead to ODR violations and ABI issues. [1]: http://lists.llvm.org/pipermail/cfe-dev/2018-August/059024.html [2]: https://reviews.llvm.org/D51789 Reviewers: rsmith, EricWF Subscribers: dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D52405 llvm-svn: 345516
* [libc++] Make sure we can build libc++ with -fvisibility=hiddenLouis Dionne2018-10-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: When building with -fvisibility=hidden, some symbols do not get exported from libc++.dylib. This means that some entities are not explicitly given default visibility in the source code, and that we rely on the fact -fvisibility=default is the default. This commit explicitly gives default visibility to those symbols to avoid being dependent on the command line flags used. The commit also remove symbols from the dylib -- those symbols do not actually need to be exported from the dylib and this should not be an ABI break. Finally, in the future, we may want to mark the whole std:: namespace as having hidden visibility (to switch from opt-out to opt-in), in which case the changes done in this commit will be required. Reviewers: EricWF Subscribers: mgorny, christof, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D52662 llvm-svn: 345260
* [libcxx] Remove custom CMake code targeting Mac OS 10.6Louis Dionne2018-10-161-1/+1
| | | | | | | | | | | | | libc++ has dropped support for Mac OS 10.6 for a while, and we don't have any testers set up for that OS. This commit puts in an error message so that people can reach out to the libc++ maintainers in case support for 10.6 is still expected (as opposed to silently failing in weird ways). We can completely drop support for 10.6 and remove the error message some time in the future when we're sure that nobody is relying on it. llvm-svn: 344576
* [libc++] Add deprecated attributes to many deprecated componentsLouis Dionne2018-09-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: These deprecation warnings are opt-in: they are only enabled when the _LIBCXX_DEPRECATION_WARNINGS macro is defined, which is not the case by default. Note that this is a first step in the right direction, but I wasn't able to get an exhaustive list of all deprecated components per standard, so there's certainly stuff that's missing. The list of components this commit marks as deprecated is: in C++11: - auto_ptr, auto_ptr_ref - binder1st, binder2nd, bind1st(), bind2nd() - pointer_to_unary_function, pointer_to_binary_function, ptr_fun() - mem_fun_t, mem_fun1_t, const_mem_fun_t, const_mem_fun1_t, mem_fun() - mem_fun_ref_t, mem_fun1_ref_t, const_mem_fun_ref_t, const_mem_fun1_ref_t, mem_fun_ref() in C++14: - random_shuffle() in C++17: - unary_negate, binary_negate, not1(), not2() <rdar://problem/18168350> Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D48912 llvm-svn: 342843
OpenPOWER on IntegriCloud