summaryrefslogtreecommitdiffstats
path: root/libcxx/src/support/runtime
Commit message (Collapse)AuthorAgeFilesLines
* [libc++] Remove redundant conditionals for Apple platformsLouis Dionne2019-04-231-2/+1
| | | | | | | | | | | | | | | | | | | Summary: In a bunch of places, we used to check whether LIBCXX_BUILDING_LIBCXXABI is defined OR we're building for an Apple platform. This used to be necessary in a time when Apple's build script did NOT define LIBCXX_BUILDING_LIBCXXABI. However this is not relevant anymore since Apple's build does define LIBCXX_BUILDING_LIBCXXABI. Reviewers: EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D60842 llvm-svn: 358988
* Fix ABI compatibility of `<stdexcept>` with VCRuntime.Eric Fiselier2019-03-062-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently, libc++'s `<stdexcept>` doesn't play nice with `vcruntime`. Specifically: * `logic_error` and `runtime_error` have a different layout. * libc++'s `logic_error` and `runtime_error` override `what()` but `vcruntime` does not. * `vcruntime` uses weak vtables for `<stdexcept>` types. * libc++'s `<stdexcept>` constructors and assignment operators may have different manglings than `vcruntimes`. This patch makes libc++'s declarations in `<stdexcept>` match those provided by MSVC's STL as closely as possible. If MSVC doesn't declare a special member, then neither do we. This ensures that the implicit definitions have the same linkage, visibility, triviality, and noexcept-ness. Reviewers: thomasanderson, ldionne, smeenai Reviewed By: thomasanderson Subscribers: jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D58945 llvm-svn: 355546
* Make VCRuntime ABI configuration a first-class option.Eric Fiselier2019-03-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Summary: On Windows we currently provide two separate ABI configurations. One which defers to `vcruntime` to provide the C++ runtime and another which doesn't. Using `vcruntime` allows interoperability which programs compiled against the MSVC STL, and should be preferred whenever possible. When deferring to `vcruntime` much of the ABI we provide changes. Including the layout of `<stdexcept>` types, their vtables, and how the linkage of their members. This patch introduces the `_LIBCPP_ABI_VCRUNTIME` macro to denote this configuration. It also cleans up the existing configuration for using `vcruntime`. This cleanup lays the groundwork for fixing a number of ABI and interoperability bugs in `<stdexcept>`. Reviewers: thomasanderson, ldionne, smeenai Reviewed By: smeenai Subscribers: jdoerfert, libcxx-commits, #libc Differential Revision: https://reviews.llvm.org/D58942 llvm-svn: 355366
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1910-40/+30
| | | | | | | | | | | | | | | | | | 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
* [libcxx] Remove bad_array_lengthLouis Dionne2018-11-294-50/+0
| | | | | | | | | | | | | | | | 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
* Fix embarrasing typo in uncaught_exceptions. Update tests to really test ↵Marshall Clow2018-05-291-1/+1
| | | | | | this. Thanks to Peter Klotz for calling my attention to this. llvm-svn: 333467
* libcxx: Use vcruntime declarations for typeinfo on Windows.Peter Collingbourne2018-01-261-1/+1
| | | | | | | | | | | We need to use the vcruntime declarations on Windows to avoid an ODR violation involving rtti.obj, which provides the definition of the runtime function implementing dynamic_cast and depends on the vcruntime implementations of bad_cast and bad_typeid. Differential Revision: https://reviews.llvm.org/D42220 llvm-svn: 323491
* libcxx: Define set_unexpected, _get_unexpected and __uncaught_exceptions ↵Peter Collingbourne2018-01-181-3/+3
| | | | | | | | | | | | without dllimport. It turns out that the MSVC headers define these functions without dllimport even when compiling with /MD. This change fixes the resulting compile-time error. Differential Revision: https://reviews.llvm.org/D42207 llvm-svn: 322794
* libcxx: Stop using private MSVC macros in the exception implementation.Peter Collingbourne2018-01-172-43/+17
| | | | | | | | | | | Inline the provided "fallback" definitions (which seem to always be taken) that expand to __cdecl into users. The fallback definitions for the *CRTIMP* macros were wrong in the case where the CRT is being linked statically, so define our own macro as a replacement. Differential Revision: https://reviews.llvm.org/D42158 llvm-svn: 322617
* [libc++] Support Microsoft ABI without vcruntime headersShoaib Meenai2017-10-092-16/+95
| | | | | | | | | | | | | | | | | The vcruntime headers are hairy and clash with both libc++ headers themselves and other libraries. libc++ normally deals with the clashes by deferring to the vcruntime headers and silencing its own definitions, but for clients which don't want to depend on vcruntime headers, it's desirable to support the opposite, i.e. have libc++ provide its own definitions. Certain operator new/delete replacement scenarios are not currently supported in this mode, which requires some tests to be marked XFAIL. The added documentation has more details. Differential Revision: https://reviews.llvm.org/D38522 llvm-svn: 315234
* [libc++] Replace __sync_* functions with __libcpp_atomic_* functionsWeiming Zhao2017-09-192-7/+6
| | | | | | | | | | | | | | | | Summary: This patch replaces __sync_* with __libcpp_atomic_* and adds a wrapper function for __atomic_exchange to support _LIBCPP_HAS_NO_THREADS. Reviewers: EricWF, jroelofs, mclow.lists, compnerd Reviewed By: EricWF, compnerd Subscribers: compnerd, efriedma, cfe-commits, joerg, llvm-commits Differential Revision: https://reviews.llvm.org/D35235 llvm-svn: 313694
* typeinfo: provide a partial implementation for Win32Saleem Abdulrasool2017-09-151-0/+28
| | | | | | | | | | | | | | | | | The RTTI structure is different on Windows when building under MS ABI. Update the definition to reflect this. The structure itself contains an area for caching the undecorated name (which is 0-initialized). The decorated name has a bitfield followed by the linkage name. When std::type_info::name is invoked for the first time, the runtime should undecorate the name, cache it, and return the undecorated name. This requires access to an implementation of __unDName. For now, return the raw name. This uses the fnv-1a hash to hash the name of the RTTI. We could use an alternate hash (murmur? city?), but, this was the quickest to throw together. llvm-svn: 313344
* Revert "[libc++] Refactoring __sync_* builtins; NFC (Reland)"Eric Fiselier2017-07-122-9/+7
| | | | | | | This reverts commit r307595. The commit had some issues that needed to first be addressed in review. llvm-svn: 307746
* [libc++] Refactoring __sync_* builtins; NFC (Reland)Weiming Zhao2017-07-102-7/+9
| | | | | | | | | | | | Summary: Wrap __sync_* builtins with __libcpp_ functions to facility future customizations as atomic operations are unavailable on some targets. Reviewers: danalbert, EricWF, jroelofs Subscribers: joerg, llvm-commits Differential Revision: https://reviews.llvm.org/D34918 llvm-svn: 307595
* Revert "[libc++] Refactoring __sync_* builtins; NFC"Weiming Zhao2017-07-102-9/+7
| | | | | | This reverts commit 72ff8866bca49ee7d24c87673293b4ce88a039ec. llvm-svn: 307593
* [libc++] Refactoring __sync_* builtins; NFCWeiming Zhao2017-07-102-7/+9
| | | | | | | | | | | | Summary: Wrap __sync_* builtins with __libcpp_ functions to facility future customizations as atomic operations are unavailable on some targets. Reviewers: danalbert, EricWF, jroelofs Subscribers: joerg, llvm-commits Differential Revision: https://reviews.llvm.org/D34918 llvm-svn: 307591
* [libc++] Refactor Windows support headers.Eric Fiselier2017-05-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch refactors and tries to remove as much of the Windows support headers as possible. This is needed because they currently introduce super weird include cycles and dependencies between STL and libc headers. The changes in this patch are: * remove `support/win32/support.h` completely. The required parts have either been moved into `support/win32/msvc_support.h` (for `MSVC` only helpers not needed by Clang), or directly into their respective `foo.h` headers. * Combine `locale_win32.h` and `locale_mgmt_win32.h` into a single headers, this header should only be included within `__locale` or `locale` to avoid include cycles. * Remove the unneeded parts of `limits_win32.h` and re-name it to `limits_msvc_win32.h` since it's only needed by Clang. I've tested this patch using Clang on Windows, but I suspect it might technically regress our non-existent support for MSVC. Is somebody able to double check? This refactor is needed to support upcoming fixes to `<locale>` on Windows. Reviewers: bcraig, rmaprath, compnerd, EricWF Reviewed By: EricWF Subscribers: majnemer, cfe-commits Differential Revision: https://reviews.llvm.org/D32988 llvm-svn: 302727
* [libc++] Implement exception_ptr on WindowsEric Fiselier2017-05-081-0/+94
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements exception_ptr on Windows using the `__ExceptionPtrFoo` functions provided by MSVC. The `__ExceptionPtrFoo` functions are defined inside the C++ standard library, `msvcprt`, which is unfortunate because it requires libc++ to link to the MSVC STL. However this doesn't seem to cause any immediate problems. However to be safe I kept all usages within the libc++ dylib so that user programs wouldn't have to link to MSVCPRT as well. Note there are still 2 outstanding exception_ptr/nested_exception test failures. * `current_exception.pass.cpp` needs to be rewritten for the Windows exception_ptr semantics which copy the exception every time. * `rethrow_if_nested.pass.cpp` need investigation. It hits a stack overflow, likely from recursion. This patch also gets most of the `<future>` tests passing as well. Reviewers: mclow.lists, compnerd, bcraig, rmaprath, majnemer, BillyONeal, STL_MSFT Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D32927 llvm-svn: 302393
* Fix PR32183 - Wrap GCC exception implementation in missing namespace stdEric Fiselier2017-03-082-1/+5
| | | | llvm-svn: 297306
* Recommit "Split exception.cpp and new.cpp implementation into different ↵Eric Fiselier2017-02-109-0/+633
| | | | | | | | | | | | | | | | | | | | | | files for different runtimes." This recommits r294707 with additional fixes. The main difference is libc++ now correctly builds without any ABI library. exception.cpp is a bloody mess. It's full of confusing #ifdef branches for each different ABI library we support, and it's getting unmaintainable. This patch breaks down exception.cpp into multiple different header files, roughly one per implementation. Additionally it moves the definitions of exceptions in new.cpp into the correct implementation header. This patch also removes an unmaintained libc++abi configuration. This configuration may still be used by Apple internally but there are no other possible users. If it turns out that Apple still uses this configuration internally I will re-add it in a later commit. See http://llvm.org/PR31904. llvm-svn: 294730
* Revert "Split exception.cpp and new.cpp implementation into different files ↵Eric Fiselier2017-02-109-633/+0
| | | | | | | | for different runtimes." The compiler-rt CMake configuration needs some tweaking before this can land. llvm-svn: 294727
* Split exception.cpp and new.cpp implementation into different files for ↵Eric Fiselier2017-02-109-0/+633
different runtimes. exception.cpp is a bloody mess. It's full of confusing #ifdef branches for each different ABI library we support, and it's getting unmaintainable. This patch breaks down exception.cpp into multiple different header files, roughly one per implementation. Additionally it moves the definitions of exceptions in new.cpp into the correct implementation header. This patch also removes an unmaintained libc++abi configuration. This configuration may still be used by Apple internally but there are no other possible users. If it turns out that Apple still uses this configuration internally I will re-add it in a later commit. See http://llvm.org/PR31904. llvm-svn: 294707
OpenPOWER on IntegriCloud