Commit Graph

720 Commits

Author SHA1 Message Date
Erik Pilkington 4fb6f8189f [demangler] Simplify printing of structured bindings.
Thanks to Richard Smith for the post-commit review!

llvm-svn: 327228
2018-03-10 22:33:49 +00:00
Erik Pilkington fcc9a80241 [demangler] Support for sequence numbers on lifetime extended temporaries.
llvm-svn: 327227
2018-03-10 21:31:22 +00:00
Erik Pilkington b1a7f3c741 [demangler] Support for structured bindings.
llvm-svn: 327226
2018-03-10 21:31:15 +00:00
Erik Pilkington bec42c848d [demangler] Fix a mistake in r326797.
Thanks to Nico Weber for pointing this out!

llvm-svn: 326871
2018-03-07 04:29:33 +00:00
Erik Pilkington 98e7036587 [demangler] Modernize the rest of the demangler.
llvm-svn: 326797
2018-03-06 14:21:10 +00:00
Erik Pilkington 4352d7221c [demangler] Modernize parse_unresolved_name.
llvm-svn: 326796
2018-03-06 14:21:08 +00:00
Erik Pilkington 3402e876ef [demangler] Modernize parse_name.
llvm-svn: 326717
2018-03-05 16:35:06 +00:00
Erik Pilkington 0bae6d8c14 [demangler] Support for exception specifications on function types.
llvm-svn: 325093
2018-02-14 01:08:20 +00:00
Erik Pilkington bb0e34558f [demangler] Simplify the AST for function types, NFC.
llvm-svn: 325092
2018-02-14 01:08:17 +00:00
Erik Pilkington b39094e39e [demangler] Support for inheriting constructors.
Fixes PR33223.

llvm-svn: 325023
2018-02-13 17:09:07 +00:00
Erik Pilkington aec1e58c99 [demangler] Rewrite parse_nested_name in the new style.
llvm-svn: 325022
2018-02-13 17:09:03 +00:00
Erik Pilkington 8b15f1f272 [demangler] Support for initializer lists and designated initializers.
llvm-svn: 324970
2018-02-13 00:15:56 +00:00
Erik Pilkington 8d2aca0697 [demangler] Support for dependent elaborate type specifiers.
llvm-svn: 324969
2018-02-13 00:15:53 +00:00
Erik Pilkington 94bd832518 [demangler] All <qualifiers> on one type should share one entry in the substitution table.
Previously, both <extended-qualifier>s and <CV-qualifiers> got their own entries.

llvm-svn: 324968
2018-02-13 00:15:46 +00:00
Richard Smith 8e6107a0e4 Fix compilation in C++17 mode.
C++17 removes `std::unexpected_handler`, but libc++abi needs it to define
`__cxa_exception`. When building against libc++, this is easily rectified by
telling libc++ we're building the library. We already do this in the other
places where we need these symbols.

Differential Revision: https://reviews.llvm.org/D42987

llvm-svn: 324542
2018-02-07 23:23:23 +00:00
Erik Pilkington 9cbd9bfaa5 [demangler] Refactor the type parser
Differential revision: https://reviews.llvm.org/D41889

llvm-svn: 324282
2018-02-05 22:41:20 +00:00
Erik Pilkington 0923542c61 [demangler] return early if conditional expr parsing failed
This should fix some bugs found by oss-fuzz.

llvm-svn: 324203
2018-02-05 02:34:41 +00:00
Erik Pilkington 4f052d075c [demangler] Clean up the expression parser
This commit cleans up the expression parser, using a new style:
  - parse* functions now return Node pointers.
  - The mangled name is now held in Db and accessed with look() and consume()
  - LLVM coding style

This style is meant to avoid the 2 most common types of bugs in the
old demanger, namely misusing the Names stack (ie, calling back() on
empty) and going out of bounds on the mangled name. I also think it
makes the demangler a lot cleaner.

Differential revision: https://reviews.llvm.org/D41887

llvm-svn: 324111
2018-02-02 18:04:32 +00:00
Erik Pilkington 862987abe7 [demangler] Improve variadic template support
This commit changes how variadic templates are represented in the
demangler, in order to fix some longstanding bugs. Now instead of
expanding variadic templates during parsing, the expansion is done
during printing by reusing the unexpanded AST. This allows the
demangler to handle cases where multiple packs contribute to a single
production, and correctly handle "Dp" and "sp" productions, which
corrispond to pack expansions in type and expression contexts.

Differential revision: https://reviews.llvm.org/D41885

llvm-svn: 323906
2018-01-31 20:17:06 +00:00
Don Hinton 4877063e19 [cmake] [libcxxabi] LLVM_FOUND isn't always set, so just test if
llvm_setup_rpath() is available instead.

llvm-svn: 323600
2018-01-27 19:18:04 +00:00
Don Hinton e3b3b8094d Reland:
[cmake] [libcxxabi] Call llvm_setup_rpath() when adding shared libraries.

Clang and llvm already use llvm_setup_rpath(), so this change will
help standarize rpath usage across all projects.

Differential Revision: https://reviews.llvm.org/D42460

llvm-svn: 323495
2018-01-26 03:41:58 +00:00
Don Hinton bc595f5702 Revert [libcxxabi] r323455 - [cmake] [libcxxabi] Call llvm_setup_rpath() when adding shared libraries.
Shoaib Meenai pointed out this will break standalone builds can be built without llvm.

Differential Revision: https://reviews.llvm.org/D42460

llvm-svn: 323458
2018-01-25 19:18:51 +00:00
Don Hinton 0106b4305f [cmake] [libcxxabi] Call llvm_setup_rpath() when adding shared libraries.
Clang and llvm already use llvm_setup_rpath(), so this change will
help standarize rpath usage across all projects.

Differential Revision: https://reviews.llvm.org/D42460

llvm-svn: 323455
2018-01-25 18:43:18 +00:00
Peter Collingbourne a674a8fd1e [libc++abi] Fix unused function when building with LIBCXXABI_SILENT_TERMINATE
This fixes:
src/cxa_default_handlers.cpp:25:13: error: unused function 'demangling_terminate_handler' [-Werror,-Wunused-function]

Patch by Thomas Anderson!

Differential Revision: https://reviews.llvm.org/D42399

llvm-svn: 323397
2018-01-25 01:38:43 +00:00
Don Hinton ae858bf65f [cmake] [libcxxabi] Fix find_path() problems when cross compiling
When CMAKE_SYSROOT or CMAKE_FIND_ROOT_PATH is set, cmake
recommends setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
globally which means find_path() always prepends CMAKE_SYSROOT or
CMAKE_FIND_ROOT_PATH to all paths used in the search.

However, these find_path() invocations are looking for paths in
the libcxx and libunwind projects on the host system, not the
target system, which can be done by passing
NO_CMAKE_FIND_ROOT_PATH.

Differential Revision: https://reviews.llvm.org/D41623

llvm-svn: 323145
2018-01-22 19:41:05 +00:00
Don Hinton 964ea50ff8 [cmake] [libcxxabi] Don't print warning when tests are disabled.
Summary:
Don't print, possibly erroneous, warning if
LIBCXXABI_INCLUDE_TESTS is false.

This patch fixes a problem introduced in r291367.

Differential Revision: https://reviews.llvm.org/D42229

llvm-svn: 322870
2018-01-18 18:29:36 +00:00
Eric Fiselier 6ae8abf241 Fix standalone test-suite run.
This patch updates libc++abi's HandleOutOfTreeLLVM.cmake to match
libc++'s -- and more importantly, to fix a bug where llvm-lit wasn't
found/created when libc++abi was built out-of-tree. This prevented
the test suite from running.

llvm-svn: 322768
2018-01-17 22:07:09 +00:00
Hans Wennborg 4ebc5ab7a5 Update version to 7.0.0svn
llvm-svn: 321726
2018-01-03 15:42:34 +00:00
Jonathan Roelofs 01b938279c Try again, this time with the correct address
llvm-svn: 321569
2017-12-29 19:26:28 +00:00
Jonathan Roelofs 8e8378ba77 Update CREDITS.txt with personal email address
llvm-svn: 321564
2017-12-29 19:16:12 +00:00
Petr Hosek 2ffea93c57 [libcxxabi] Pass LIBCXXABI_SYSROOT and LIBCXXABI_GCC_TOOLCHAIN to lit
These are expected to be set by the shared lit scripts used from libc++.

Differential Revision: https://reviews.llvm.org/D40818

llvm-svn: 320445
2017-12-12 01:20:37 +00:00
Ben Hamilton 4bf869c87e [libcxxabi] Set up .arcconfig to point to new Diffusion CXXA repository
Summary:
We want to automatically copy the appropriate mailing list
for review requests to the libc++abi repository.

For context, see the proposal and discussion here:

http://lists.llvm.org/pipermail/cfe-dev/2017-November/056032.html

Similar to D40500, I set up a new Diffusion repository with callsign
"CXXA" for libc++abi:

https://reviews.llvm.org/source/libcxxabi/

This explicitly updates libcxxabi's .arcconfig to point to the new
CXX repository in Diffusion, which will let us use Herald rule H268.

Reviewers: phosek, beanz, EricWF, compnerd

Reviewed By: phosek

Subscribers: cfe-commits, klimek, sammccall, dlj, bkramer

Differential Revision: https://reviews.llvm.org/D40501

llvm-svn: 319713
2017-12-04 23:14:03 +00:00
Shoaib Meenai acee992852 [libc++abi] Add install-cxxabi-stripped target
LLVM is gaining install-*-stripped targets to perform stripped installs,
and in order for this to be useful for install-distribution, all
potential distribution components should have stripped installation
targets. LLVM has a function to create these install targets, but since
we can't use LLVM CMake functions in libc++abi, let's do it manually.

Differential Revision: https://reviews.llvm.org/D40681

llvm-svn: 319499
2017-11-30 23:25:51 +00:00
Akira Hatanaka 9ef1daa46e Insert padding before the __cxa_exception header to ensure the thrown
object is sufficiently aligned.

r303175 annotated field unwindHeader of __cxa_exception with attribute
'aligned' to ensure the thrown object following the __cxa_exception
header was sufficiently aligned. This caused changes in the field
offsets of __cxa_exception relative to the start of the thrown object,
which was an ABI breaking change for some clients.

Instead of annotating field unwindHeader, this commit inserts extra
space before the header. This ensures the thrown object following the
header is sufficiently aligned without changing the field offsets, thus
avoiding any ABI breakages.

rdar://problem/25364625
rdar://problem/35556163

llvm-svn: 319123
2017-11-28 00:36:29 +00:00
Erik Pilkington 24d6534038 [demangler] Support for abi_tag attribute
Differential revision: https://reviews.llvm.org/D40279

llvm-svn: 318874
2017-11-22 20:38:22 +00:00
Erik Pilkington 1b7f8d5b04 [demangler] Document some features that the demangler doesn't yet support, NFC
llvm-svn: 318765
2017-11-21 15:04:08 +00:00
Petr Hosek aa96d2ebbc [libcxxabi][CMake] Provide option to disable installing of the library
This is useful in cases where we only build static library and
libc++abi.a is combined with libc++.a into a single archive in which
case we don't want to have libc++abi.a installed separately. The same
option is already provided by libcxx CMake build.

Differential Revision: https://reviews.llvm.org/D40194

llvm-svn: 318568
2017-11-17 23:25:09 +00:00
Petr Hosek 56a1f07156 [CMake][libcxxabi] Support merging objects when statically linking unwinder
When using LLVM unwinder and static unwinder option is set, merge
libunwind and libc++abi objects into a single archive. libc++ already
supports merging libc++abi.a and libc++.a into a single archive; with
this change, it is possible to also include libunwind.a in the same
archive which is useful when doing static link and using libc++ as
a default C++ library and compiler-rt as a default runtime library.

Differential Revision: https://reviews.llvm.org/D39949

llvm-svn: 318563
2017-11-17 22:49:39 +00:00
Stephan Bergmann 511c284b82 Remove excess whitespace from syslog message; NFC
llvm-svn: 318043
2017-11-13 15:40:31 +00:00
Eric Fiselier c4600ccf89 Fix ASAN build with older compiler-rt versions.
compiler-rt recently added the __asan_handle_no_return() function that libc++abi
needs to use, however older versions of compiler-rt don't declare this interface
publicly and that breaks the libc++abi build.

This patch attempts to fix the issues by declaring the asan function explicitly,
so we don't depend on compiler-rt to provide the declaration.

llvm-svn: 313308
2017-09-14 22:37:34 +00:00
Eric Fiselier 8635f7d2c6 [libc++abi] Fix ASAN build with older compiler-rt versions.
Summary:
compiler-rt recently added the `__asan_handle_no_return()` function that libc++abi needs to use, however older versions of compiler-rt don't provide this interface and that breaks the libc++abi build.

This patch attempts to fix the issues by using a macro to detect if `asan_interface.h` is new enough to provide the function.

See D37871

Reviewers: phosek, vitalybuka

Reviewed By: phosek, vitalybuka

Subscribers: dberris, cfe-commits

Differential Revision: https://reviews.llvm.org/D37872

llvm-svn: 313304
2017-09-14 22:19:28 +00:00
Petr Hosek 229e0854ed Reland "When built with ASan, __cxa_throw calls __asan_handle_no_return"
The ASan runtime on many systems intercepts cxa_throw just so it
can call asan_handle_no_return first. Some newer systems such as
Fuchsia don't use interceptors on standard library functions at all,
but instead use sanitizer-instrumented versions of the standard
libraries. When libc++abi is built with ASan, cxa_throw can just
call asan_handle_no_return itself so no interceptor is required.

Patch by Roland McGrath

Differential Revision: https://reviews.llvm.org/D37229

llvm-svn: 313215
2017-09-13 23:35:07 +00:00
Petr Hosek a69a3a3f62 Revert "[libcxxabi] When built with ASan, __cxa_throw calls __asan_handle_no_return"
This reverts commit r312606 because it's causing an error on
libcxx-libcxxabi-x86_64-linux-ubuntu-asan bot.

llvm-svn: 312609
2017-09-06 03:00:42 +00:00
Petr Hosek 53335d6d86 [libcxxabi] When built with ASan, __cxa_throw calls __asan_handle_no_return
The ASan runtime on many systems intercepts cxa_throw just so it
can call asan_handle_no_return first. Some newer systems such as
Fuchsia don't use interceptors on standard library functions at all,
but instead use sanitizer-instrumented versions of the standard
libraries. When libc++abi is built with ASan, cxa_throw can just
call asan_handle_no_return itself so no interceptor is required.

This is a re-land of r311045, which has become safe after r311869
changed compiler-rt to declare __asan_handle_no_return.

Patch by Roland McGrath

Differential Revision: https://reviews.llvm.org/D37229

llvm-svn: 312606
2017-09-06 02:43:54 +00:00
Petr Hosek ce7aa6f2bd Revert "[libcxxabi] When built with ASan, __cxa_throw calls __asan_handle_no_return"
This reverts commit r311045 because it's causing an error on
libcxx-libcxxabi-x86_64-linux-ubuntu-asan bot.

llvm-svn: 311047
2017-08-16 22:05:54 +00:00
Petr Hosek 00135562e5 [libcxxabi] When built with ASan, __cxa_throw calls __asan_handle_no_return
The ASan runtime on many systems intercepts cxa_throw just so it
can call asan_handle_no_return first. Some newer systems such as
Fuchsia don't use interceptors on standard library functions at all,
but instead use sanitizer-instrumented versions of the standard
libraries. When libc++abi is built with ASan, cxa_throw can just
call asan_handle_no_return itself so no interceptor is required.

Patch by Roland McGrath

Differential Revision: https://reviews.llvm.org/D36599

llvm-svn: 311045
2017-08-16 21:58:09 +00:00
Erik Pilkington a95eae2d4b [demangler] Fix some more -Wshadow warnings I missed in r310535
llvm-svn: 310546
2017-08-10 02:48:13 +00:00
Erik Pilkington f514ccadbd [demangler] Fix a bunch of -Wshadow warnings
These were causing failures in -Werror builds.

llvm-svn: 310535
2017-08-09 22:45:35 +00:00
Erik Pilkington 7377525fce Mark test as unsupported c++98/03 to fix buildbots
llvm-svn: 310530
2017-08-09 21:51:56 +00:00
Erik Pilkington ab04a08c49 [demangler] Improve representation of substitutions/templates
Differential revision: https://reviews.llvm.org/D36427

llvm-svn: 310525
2017-08-09 21:30:57 +00:00