summaryrefslogtreecommitdiffstats
path: root/libcxx/include/typeinfo
Commit message (Collapse)AuthorAgeFilesLines
* Fix build breakage on 32-bit machinesEric Fiselier2019-05-291-1/+4
| | | | llvm-svn: 361917
* Rework std::type_info definition to support systems without fullyEric Fiselier2019-05-291-78/+146
| | | | | | | | | | | | | | | | | | 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
* 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
* [libc++] Disentangle the 3 implementations of type_infoLouis Dionne2019-02-011-31/+75
| | | | | | | | | | | | | | | | | | | | | | | | Summary: We currently have effectively 3 implementations of type_info: one for the Microsoft ABI, one that does not assume that there's a unique copy of each RTTI in a progran, and one that assumes a unique copy. Those 3 implementations are entangled into the same class with nested ifdefs, which makes it very difficult to understand. Furthermore, the benefit of doing this is rather small since the code that is duplicated across implementations is just a couple of trivial lines. This patch stamps out the 3 versions of type_info explicitly to increase readability. It also explains what's going on with short comments, because it's far from obvious. Reviewers: EricWF, mclow.lists Subscribers: christof, jkorous, dexonsmith Differential Revision: https://reviews.llvm.org/D57606 llvm-svn: 352905
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | | 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 unused macro _LIBCPP_HAS_UNIQUE_TYPEINFOLouis Dionne2018-12-211-6/+2
| | | | | | | | | | | | | | Summary: We already have the negation of that as _LIBCPP_HAS_NONUNIQUE_TYPEINFO. Having both defined is confusing, since only one of them is used. Reviewers: EricWF, mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D54537 llvm-svn: 349947
* [NFC][libc++] Consistently use spaces to indentLouis Dionne2018-08-031-1/+1
| | | | | | rdar://problem/19988944 llvm-svn: 338933
* [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by ↵Louis Dionne2018-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | _LIBCPP_INLINE_VISIBILITY Summary: We never actually mean to always inline a function -- all the uses of the macro I could find are actually attempts to control the visibility of symbols. This is better described by _LIBCPP_INLINE_VISIBILITY, which is actually always defined the same. This change is orthogonal to the decision of what we're actually going to do with _LIBCPP_INLINE_VISIBILITY -- it just simplifies things by having one canonical way of doing things. Note that this commit had originally been applied in r336369 and then reverted in r336382 because of unforeseen problems. Both of these problems have now been fixed. Reviewers: EricWF, mclow.lists Subscribers: christof, dexonsmith, erikvanderpoel Differential Revision: https://reviews.llvm.org/D48892 llvm-svn: 336866
* Revert "[libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by ↵Louis Dionne2018-07-051-1/+1
| | | | | | | | | | | | | | | _LIBCPP_INLINE_VISIBILITY" This reverts commit r336369. The commit had two problems: 1. __pbump was marked as _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY instead of _LIBCPP_INLINE_VISIBILITY, which lead to two symbols being added in the dylib and the check-cxx-abilist failing. 2. The LLDB tests started failing because they undefine `_LIBCPP_INLINE_VISIBILITY`. I need to figure out why they do that and fix the tests before we can go forward with this change. llvm-svn: 336382
* [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITYLouis Dionne2018-07-051-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: We never actually mean to always inline a function -- all the uses of the macro I could find are actually attempts to control the visibility of symbols. This is better described by _LIBCPP_INLINE_VISIBILITY, which is actually always defined the same. This change is orthogonal to the decision of what we're actually going to do with _LIBCPP_INLINE_VISIBILITY -- it just simplifies things by having one canonical way of doing things. Reviewers: EricWF Subscribers: christof, llvm-commits, dexonsmith, erikvanderpoel, mclow.lists Differential Revision: https://reviews.llvm.org/D48892 llvm-svn: 336369
* libcxx: Use vcruntime declarations for typeinfo on Windows.Peter Collingbourne2018-01-261-0/+6
| | | | | | | | | | | 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
* [libc++] Remove unnecessary struct tagShoaib Meenai2017-09-151-1/+1
| | | | | | It causes warnings about mismatched tags, and it's not needed. llvm-svn: 313345
* typeinfo: provide a partial implementation for Win32Saleem Abdulrasool2017-09-151-6/+30
| | | | | | | | | | | | | | | | | 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
* Add markup for libc++ dylib availabilityMehdi Amini2017-05-041-0/+1
| | | | | | | | | | | | | | | Libc++ is used as a system library on macOS and iOS (amongst others). In order for users to be able to compile a binary that is intended to be deployed to an older version of the platform, clang provides the availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>_ that can be placed on declarations to describe the lifecycle of a symbol in the library. See docs/DesignDocs/AvailabilityMarkup.rst for more information. Differential Revision: https://reviews.llvm.org/D31739 llvm-svn: 302172
* Recommit "Split exception.cpp and new.cpp implementation into different ↵Eric Fiselier2017-02-101-1/+6
| | | | | | | | | | | | | | | | | | | | | | 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-101-6/+1
| | | | | | | | 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-101-1/+6
| | | | | | | | | | | | | | | | | | | 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
* Fix type_info's constructor by making it explicit again.Eric Fiselier2017-01-171-2/+3
| | | | | | | In recent changes type_info's private constructor was accidentally made implicit. This patch fixes that. llvm-svn: 292294
* typeinfo: style adjustments for adding MS ABI RTTISaleem Abdulrasool2017-01-051-43/+62
| | | | | | | | This is motivated by adding a third RTTI scheme to libc++. Split out the two forms of the itanium RTTI representation. This is based on suggestions from Eric Fiselier. NFC llvm-svn: 291174
* Fix strict-aliasing violation in typeinfo::hash_code()Eric Fiselier2016-10-051-3/+1
| | | | | | | | | | | | | | | | Summary: The current implementation of `hash_code()` for uniqued RTTI strings violates strict aliasing by dereferencing a type-punned pointer. Specifically it generates a `const char**` pointer from the address of the `__name` member before casting it to `const size_t*` and dereferencing it to get the hash. This is really just a complex and incorrect way of writing `reinterpret_cast<size_t>(__name)`. This patch changes the conversion sequence so that it no longer contains UB. Reviewers: howard.hinnant, mclow.lists Subscribers: rjmccall, cfe-commits Differential Revision: https://reviews.llvm.org/D24012 llvm-svn: 283408
* Try 2 - Remove <cstdlib> include from `<exception>`Eric Fiselier2016-09-061-0/+3
| | | | | | | | | | | This patch removes the `<cstdlib>` include from exception where it is no longer needed. Unlike my previous attempt this patch also adds <cstdlib> where needed in other headers like <new> and <typeinfo>. This won't fix the Firefox build issues discussed on IRC but it is more correct for libc++. llvm-svn: 280754
* Revert r280743 and r280745. Remove <cstdlib> include from `<exception>`Eric Fiselier2016-09-061-1/+0
| | | | | | | Apparently I missed a number of additional include which need to be added. Reverting so I can recommit as a single patch with all of the required includes. llvm-svn: 280752
* Add missing <cstdlib> include. Sorry about the bot breakageEric Fiselier2016-09-061-0/+1
| | | | llvm-svn: 280745
* Fix or suppress GCC warnings during build.Eric Fiselier2016-08-291-1/+4
| | | | | | | | | | | | | | | | | | | | Summary: Currently a number of GCC warnings are emitted when building libc++. This patch fixes or ignores all of them. The primary changes are: * Work around strict aliasing issues in `typeinfo::hash_code()` by using __attribute__((may_alias)). However I think a non-aliasing `hash_code()` implementation is possible. Further investigation needed. * Add `_LIBCPP_UNREACHABLE()` to switch in `strstream.cpp` to avoid -Wpotentially-uninitialized. * Fix -Wunused-value warning in `__all` by adding a void cast. * Ignore -Wattributes for now. There are a number of real attribute issues when using GCC but enabling the warning is too noisy. * Ignore -Wliteral-suffix since it warns about the use of reserved identifiers. Note Only GCC 7.0 supports disabling this warning. * Ignore -Wc++14-compat since it warns about the sized new/delete overloads. Reviewers: EricWF Differential Revision: https://reviews.llvm.org/D24003 llvm-svn: 280007
* Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception ↵Marshall Clow2016-08-251-0/+12
| | | | | | type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855. llvm-svn: 279744
* RTTI Uniqueness: remove __name_for_load function.Tim Northover2014-04-031-10/+2
| | | | | | | | It's identical to name() these days. (At one point it avoided masking of the RTTI uniqueness bit because ARM64 ignored it architecturally, but no longer). llvm-svn: 205518
* ARM64: compare RTTI names as stringsTim Northover2014-03-301-1/+53
| | | | | | | | ARM64 generates RTTI with hidden visibility, which means that typeinfo must be compared char-by-char since it's not guaranteed to be uniqued across the whole program. llvm-svn: 205139
* Windows support by Ruben Van Boxem.Howard Hinnant2011-10-171-0/+2
| | | | llvm-svn: 142235
* Applied noexcept to everything in [language.support] (Chapter 18)Howard Hinnant2011-05-261-24/+24
| | | | llvm-svn: 132129
* license changeHoward Hinnant2010-11-161-2/+2
| | | | llvm-svn: 119395
* visibility-decoration sweep completed.Howard Hinnant2010-09-231-0/+6
| | | | llvm-svn: 114685
* Fixing whitespace problemsHoward Hinnant2010-08-221-10/+6
| | | | llvm-svn: 111750
* add headers and implementation for <new>, <exception>, and <typeinfo>Nick Kledzik2010-05-141-16/+7
| | | | llvm-svn: 103795
* Wiped out some non-ascii characters that snuck into the copyright.Howard Hinnant2010-05-111-1/+1
| | | | llvm-svn: 103516
* libcxx initial importHoward Hinnant2010-05-111-0/+129
llvm-svn: 103490
OpenPOWER on IntegriCloud