Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-03-01[libc++] Revert "Protect users from relying on detail headers" & related changesLouis Dionne
This commit reverts 5aaefa51 (and also partly 7f285f48e77 and b6d75682f9, which were related to the original commit). As landed, 5aaefa51 had unintended consequences on some downstream bots and didn't have proper coverage upstream due to a few subtle things. Implementing this is something we should do in libc++, however we'll first need to address a few issues listed in https://reviews.llvm.org/D106124#3349710. Differential Revision: https://reviews.llvm.org/D120683
2022-02-26[libcxx][modules] protects users from relying on detail headersChristopher Di Bella
libc++ has started splicing standard library headers into much more fine-grained content for maintainability. It's very likely that outdated and naive tooling (some of which is outside of LLVM's scope) will suggest users include things such as <__ranges/access.h> instead of <ranges>, and Hyrum's law suggests that users will eventually begin to rely on this without the help of tooling. As such, this commit intends to protect users from themselves, by making it a hard error for anyone outside of the standard library to include libc++ detail headers. Differential Revision: https://reviews.llvm.org/D106124
2022-02-15[libc++] Rename *SAFE_STATIC to *CONSTINIT, and normalize its uses.Arthur O'Dwyer
In src/, most files can use `constinit` directly because they're always compiled with C++20. But some files, like "libcxxabi/src/fallback_malloc.cpp", can't, because they're `#include`d directly from test cases in libcxxabi/test/ and therefore must (currently) compile as C++03. We might consider refactoring those offending tests, or at least marking them `UNSUPPORTED: c++03`. Differential Revision: https://reviews.llvm.org/D119264
2021-11-18[runtimes][NFC] Remove filenames at the top of the license noticeLouis Dionne
We've stopped doing it in libc++ for a while now because these names would end up rotting as we move things around and copy/paste stuff. This cleans up all the existing files so as to stop the spreading as people copy-paste headers around.
2020-12-02[libc++abi] Don't try calling __libcpp_aligned_free when aligned allocation ↵Louis Dionne
is disabled See https://reviews.llvm.org/rGa78aaa1ad512#962077 for details.
2020-11-25[libc++] Factor out common logic for calling aligned allocationLouis Dionne
There were a couple of places where we needed to call the underlying platform's aligned allocation/deallocation function. Instead of having the same logic all over the place, extract the logic into a pair of helper functions __libcpp_aligned_alloc and __libcpp_aligned_free. The code in libcxxabi/src/fallback_malloc.cpp looks like it could be simplified after this change -- I purposefully did not simplify it further to keep this change as straightforward as possible, since it is touching very important parts of the library. Also, the changes in libcxx/src/new.cpp and libcxxabi/src/stdlib_new_delete.cpp are basically the same -- I just kept both source files in sync. The underlying reason for this refactoring is to make it easier to support platforms that provide aligned allocation through C11's aligned_alloc function instead of posix_memalign. After this change, we'll only have to add support for that in a single place. Differential Revision: https://reviews.llvm.org/D91379
2020-11-03[libcxxabi] Build all of libcxxabi with _LIBCPP_BUILDING_LIBRARY definedMartin Storsjö
Various definitions from libcxx need to be set in the same way as if building libcxx itself. Differential Revision: https://reviews.llvm.org/D90476
2020-10-14[libc++/abi] Clean up uses of <iostream> in the test suiteLouis Dionne
We used <iostream> in several places where we don't actually need the full power of <iostream>, and where using basic `std::printf` is enough. This is better, since `std::printf` can be supported on systems that don't have a notion of locales, while <iostream> can't.
2019-12-03[libcxx{,abi}] Emit deplibs only when detected by CMakeMichał Górny
This is a followup to 35bc5276ca3. It fixes the dependent libs usage in libcxx and libcxxabi to link pthread and rt libraries only if CMake detects them, rather than based on explicit platform blacklist. Differential Revision: https://reviews.llvm.org/D70888
2019-10-01[libc++abi] Remove uses of C++ headers when possibleLouis Dionne
This reduces the (circular) dependency of libc++abi on a C++ standard library. Outside of the demangler which uses fancier C++ features, the only C++ headers now required by libc++abi are pretty much <new> and <exception>, and that's because libc++abi defines some types that are declared in those headers. llvm-svn: 373381
2019-07-22[runtimes] Don't depend on libpthread on AndroidYi Kong
r362048 added support for ELF dependent libraries, but broke Android build since Android does not have libpthread. Remove the dependency on the Android build. Differential Revision: https://reviews.llvm.org/D65098 llvm-svn: 366734
2019-05-30[runtimes] Check if pragma comment(lib, ...) is supported firstPetr Hosek
This fixes the issue introduced by r362048 where we always use pragma comment(lib, ...) for dependent libraries when the compiler is Clang, but older Clang versions don't support this pragma so we need to check first if it's supported before using it. llvm-svn: 362055
2019-05-30[runtimes] Support ELF dependent libraries featurePetr Hosek
As of r360984, LLD supports dependent libraries feature for ELF. libunwind, libc++abi and libc++ have library dependencies: libdl librt and libpthread, which means that when libunwind and libc++ are being statically linked (using -static-libstdc++ flag), user has to manually specify -ldl -lpthread which is onerous. This change includes the lib pragma to specify the library dependencies directly in the source that uses those libraries. This doesn't make any difference when using linkers that don't support dependent libraries. However, when using LLD that has dependent libraries feature, users no longer have to manually specifying library dependencies when using static linking, linker will pick the library automatically. Differential Revision: https://reviews.llvm.org/D62090 llvm-svn: 362048
2019-01-19Update more file headers across all of the LLVM projects in the monorepoChandler Carruth
to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
2018-10-11Use C++03 friendly version of alignofEric Fiselier
llvm-svn: 344215
2018-10-11Update libc++abi's detection of aligned allocation after r344207.Eric Fiselier
llvm-svn: 344208
2018-09-22Fix incorrectly aligned exceptions in 32 bit builds.Eric Fiselier
This patch fixes a bug where exceptions in 32 bit builds would be incorrectly aligned because malloc only provides 8 byte aligned memory where 16 byte alignment is needed. This patch makes libc++abi correctly use posix_memalign when it's available. This requires defining _LIBCPP_BUILDING_LIBRARY so that libc++ only defines _LIBCPP_HAS_NO_ALIGNED_ALLOCATION when libc doesn't support it and not when aligned new/delete are disable for other reasons. This bug somehow made it into the 7.0 release, making it a regression. Therefore this patch should be included in the next dot release. llvm-svn: 342815
2017-03-31[libc++abi] Delete config.hShoaib Meenai
Summary: It's now completely empty, so we can remove it entirely. Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31502 llvm-svn: 299129
2017-03-04Fully Reformat fallback_malloc.cppEric Fiselier
This patch fully reformats fallback_malloc.cpp. Previously the test was a mess of different styles and indentations. This made it very hard to work in and read. Therefore I felt it was best to re-format the whole thing. Unfortuantly this means some history will be lost, but hopefully much of it will still be accessible after ignoring whitespace changes. llvm-svn: 296960
2017-03-04[libcxxabi] Fix alignment of allocated exceptions in 32 bit buildsEric Fiselier
Summary: In 32 bit builds on a 64 bit system `std::malloc` does not return correctly aligned memory. This leads to undefined behavior. This patch switches to using `posix_memalign` to allocate correctly aligned memory instead. Reviewers: mclow.lists, danalbert, jroelofs, compnerd Reviewed By: compnerd Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25417 llvm-svn: 296952
2017-03-01[libc++abi] Clean up visibilityShoaib Meenai
Use the libc++abi visibility macros instead of pragmas or using visibility attributes directly. Clean up redundant attributes on definitions (where the declarations already have visibility attributes applied, from either libc++ or libc++abi headers). Introduce _LIBCXXABI_WEAK as a drive-by cleanup, which matches the semantics of _LIBCPP_WEAK. No functional change. Tested by building on Linux before and after this change and verifying that the list of exported symbols is identical. Differential Revision: https://reviews.llvm.org/D26949 llvm-svn: 296576
2017-01-03[libcxxabi] Introduce an externally threaded libc++abi variant.Asiri Rathnayake
r281179 Introduced an externally threaded variant of the libc++ library. This patch adds support for a similar library variant for libc++abi. Differential revision: https://reviews.llvm.org/D27575 Reviewers: EricWF llvm-svn: 290888
2016-10-13[libcxxabi] Refactor pthread usage into a separate APIAsiri Rathnayake
This patch refactors all pthread uses of libc++abi into a separate API. This is the first step towards supporting an externlly-threaded libc++abi library. I've followed the conventions already used in the libc++ library for the same purpose. Patch from: Saleem Abdulrasool and Asiri Rathnayake Reviewed by: compnerd, EricWF Differential revisions: https://reviews.llvm.org/D18482 (original) https://reviews.llvm.org/D24864 (final) llvm-svn: 284128
2016-10-07Recommit r282692: [libc++abi] Use fallback_malloc to allocate ↵Igor Kudrin
__cxa_eh_globals in case of dynamic memory exhaustion. Throwing an exception for the first time may lead to call calloc to allocate memory for __cxa_eh_globals. If the memory pool is exhausted at that moment, it results in abnormal termination of the program. This patch addresses the issue by using fallback_malloc in that case. In this revision, some restrictions were added into the test to not run it in unsuitable environments. Differential Revision: https://reviews.llvm.org/D17815 llvm-svn: 283531
2016-09-29Revert r282692: Use fallback_malloc to allocate __cxa_eh_globals in case of ↵Igor Kudrin
dynamic memory exhaustion. The test breaks build bots. llvm-svn: 282703
2016-09-29[libc++abi] Use fallback_malloc to allocate __cxa_eh_globals in case of ↵Igor Kudrin
dynamic memory exhaustion. Throwing an exception for the first time may lead to call calloc to allocate memory for __cxa_eh_globals. If the memory pool is exhausted at that moment, it results in abnormal termination of the program. This patch addresses the issue by using fallback_malloc in that case. Differential Revision: https://reviews.llvm.org/D17815 llvm-svn: 282692
2012-01-25Got fooled by fallback_malloc.cpp source file: it is really a private ↵Howard Hinnant
header. I've manually included it into the only place it is used: cxa_exception.cpp. llvm-svn: 148854
2012-01-24Added missing #includeHoward Hinnant
llvm-svn: 148749
2011-07-25Updated commentsMarshall Clow
llvm-svn: 135909
2011-07-20Added copyright headerMarshall Clow
llvm-svn: 135601
2011-07-20Memory manangement routines for exception objectsMarshall Clow
llvm-svn: 135587