When libcxxabi is built in LIBCXXABI_SILENT_TERMINATE mode, libcxx test suite reports
two failures:
std/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp
std/depr/exception.unexpected/set.unexpected/set_unexpected.pass.cpp
This is because the default unexpected handler is set to std::abort instead of
std::terminate which these tests expect.
llvm-svn: 295175
When building as part of runtimes, there is no predefined order in
which the runtimes are loaded, so the targets from other projects
might not be available. We need to rely on HAVE_<name> variables
instead in that case.
Differential Revision: https://reviews.llvm.org/D29574
llvm-svn: 294552
When checking if the type is a r-value ref, we would not do a complete
check. This would result in us treating a trailing parameter reference
`&)` as a r-value ref, and improperly inject the cv qualifier on the
type. We now correctly demangle the type `KFvRmE` as a constant
function rather than a constant reference.
Fixes PR31741!
llvm-svn: 292973
Fix an off-by-one case which would destroy the final parameter in a
CV-qualified function type with a reference. We still get the CV
qualification incorrect, but at least we do not clobber the type name
any longer.
Partially fixes PR31741.
llvm-svn: 292963
Pending LIT changes are about to remove the REQUIRES-ANY keyword
in place of supporting boolean && and || within "REQUIRES". This
patch prepares libc++ for that change so that when applied
the bots don't lose their mind.
llvm-svn: 292906
This test contained an implicit conversion from nullptr to bool.
Clang warns about this but the test had supressed that warning.
However GCC diagnoses the same code as an error and requires
-fpermissive to accept it.
This patch fixes both the warning and the error by explicitly
converting the pointer to bool.
llvm-svn: 292638
The Itanium ABI [1] specifies that __cxa_demangle accept either:
1) symbol names, which start with "_Z"
2) type manglings, which do not start with "_Z"
r286788 erroneously assumes that it should only handle symbols, so this patch
reverts it and adds a counterexample to the testcase.
1: https://mentorembedded.github.io/cxx-abi/abi.html#demangler
Reviewers: zygoloid, EricWF
llvm-svn: 292418
Add LIBUNWIND_* directories to include path only if they were actually
found, in order to fix the CMake error. Both of the directories are
usually unnecessary since libcxxabi uses only the common part of
unwind.h that is supplied both by GCC and Clang.
Differential Revision: https://reviews.llvm.org/D25314
llvm-svn: 292018
This patch adjusts the out-of-tree CMake configuration so that
the stderr output is ignored when an old llvm-config is found
that doesn't support --cmakedir.
llvm-svn: 291993
The current std::terminate_handler pulls in some string code, some I/O
code, and more. Since it is automatically setup as the default, this
means that any trivial binary linking against libcxxabi will get this
extra bloat.
This patch allows disabling it as a build-time option, if you want to
avoid the extra bloat.
Patch by Tom Rybka!
Reviewers: EricWF
Subscribers: danalbert, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D28497
llvm-svn: 291946
Use the new --cmakedir option to obtain LLVM_CMAKE_PATH straight from
llvm-config. Fallback to local reconstruction if llvm-config does not
support this option.
llvm-svn: 291506
+ Now that libcxxabi shares the same threading API as libcxx, a whole
chunk of code in src/config.h is made redundant (I missed this earlier).
+ r291275 split off the externalized-thread-api libcxx configuration from the
external-thread-library libcxx configuration. libcxxabi should follow the
same approach.
llvm-svn: 291440
Tests targets will now be enabled by default when building libcxxabi out of tree
(unless turned off with LIBCXXABI_INCLUDE_TESTS=OFF).
Differential Revision: https://reviews.llvm.org/D28450
llvm-svn: 291378
Use an `extern "C" { }` block around the definition rather than doing
the inline definition. This avoids a GCC warning about a declaration
being extern and having a definition. NFC.
llvm-svn: 290937
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
The macOS thread-local variable finalizer routines do not handle the
case where a termination function registers another termination function
correctly, causing this test to fail. I've filed a radar for this;
mark the test XFAIL in the meantime. See [1] for more details.
[1] http://lists.llvm.org/pipermail/cfe-dev/2016-November/051376.html
Differential Revision: https://reviews.llvm.org/D27434
llvm-svn: 289513
It's useful to be able to disable visibility annotations entirely; for
example, if we're building libc++abi static to include in another library,
and we don't want any libc++abi functions getting exported out of that
library. This is a generalization of _LIBCXXABI_DISABLE_DLL_IMPORT_EXPORT.
Differential Revision: https://reviews.llvm.org/D26950
llvm-svn: 288692
Sink the Db initialization into the structure rather than out-of-line at the
declaration size. This just makes it easier to see what initialization is being
performed. NFC.
llvm-svn: 287364
The block invocation function uses an extension where the prefix is ___Z
as opposed to _Z. This should make the tests pass again.
Disable a negative test which was testing a crasher. The symbol being
demangled is not a valid mangled symbol and will return a nullptr.
Adjust the type info decoding test to be a valid symbol name.
llvm-svn: 286793
Ensure that we have a mangled symbol before attempting to demangle it. We would
previously treat any input as a mangled symbol rather than checking that the
symbol has the initial C++ Itanium v3 mangling prefix of `_Z`. This changes the
behaviour from the previous case which would undecorate `f` to `float` rather
than nullptr as it should.
Unfortunately, we do not have any negative testing for the demangler.
llvm-svn: 286788
GCC 4.7 or newer emits 0x90 (indirect | pcrel) as the ttype encoding.
This would hit an assertion in cxa_personality.cpp. This commit fixes
the problem by relaxing the assertion.
llvm-svn: 286760
This commit fixes libc++abi build when LLVM unwinder (libunwind_llvm) is
not enabled.
This commit fixes the problem by removing "LLVM_NATIVE_ARCH MATCHES ARM"
from CMakeLists.txt so that LIBCXXABI_USE_LLVM_UNWINDER will only be
defined when LLVM unwinder is enabled.
We need LIBCXXABI_USE_LLVM_UNWINDER becase there is a subtle difference
between the unwinder from libgcc and the one from libunwind_llvm. For
the unwinder from libgcc, we have to initialize register r12 with the
address of _Unwind_Control_Block; otherwise,
_Unwind_GetLanguageSpecificData() and _Unwind_GetRegionStart() won't
work properly. Consequently, there is an extra _Unwind_SetGR() when
LLVM unwinder is disabled. Check cxa_personality.cpp for details.
llvm-svn: 286759
The runtimes subdir is the new location for runtimes, we should
include it when looking for libcxx and libunwind headers.
Differential Revision: https://reviews.llvm.org/D26362
llvm-svn: 286614
The runtimes subdir is the new location for runtimes, we should
include it when looking for libcxx and libunwind headers.
Differential Revision: https://reviews.llvm.org/D26362
llvm-svn: 286332