llvm-project/libcxxabi/test
Nathan Sidwell 6184e565ad [demangler][NFC] Refactor some parsing
There's some unnecessary code duplication in the parser.  This
refactors that and deploys boolean variables to avoid the duplication.
These also happen to help adding module demangling (with an updated
mangling scheme).

1a) The grammar requires some lookahead concerning <template-args>. We
may discover an <unscoped-name> is actually <unscoped-template-name>
<template-args>.  (When <unscoped-name> was a substitution, there must
be a following <template-args>.)  Refactor parseName to only have one
code path looking for the 'I' indicating <template-args>.

1b) While there I altered the control flow to hold the result in a
variable, rather than tail call.  Made it easier to debug (and of
course an optimizer will DTRT here anyway).

2a) An <unscoped-name> can have an St or StL prefix.  No need for
completely separate code paths handling the following unqualified-name
though.

2b) Also no need to look for both 'St' and 'StL' separately.  Look for
'St' and then conditionally swallow an 'L'.

3) We get a similar issue as #1a when parsing a typeName.  Here I just
change the control flow slightly to bring the 'break' out to the end
of the 'S' block and embed the early return inside an if.  That's more
in keeping with the code style.

4) Although NFC, there's a new testcase as that's not covered by the
existing demangler tests and is significant in the #1a case above.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D117879
2022-01-24 05:28:38 -08:00
..
configs [libcxx] Use LIBCXX_EXECUTOR in new test configs 2021-12-22 00:43:28 +02:00
libcxxabi [libc++abi] Change LIBCXXABI_NO_TIMER to LIBCXXABI_USE_TIMER 2021-10-13 08:02:31 -04:00
native/arm-linux-eabi [libc++] Move handling of the target triple to the DSL 2021-05-08 11:10:53 -04:00
support [libc++abi] Change LIBCXXABI_NO_TIMER to LIBCXXABI_USE_TIMER 2021-10-13 08:02:31 -04:00
vendor [libc++abi][AIX] Add 2 LIT tests for the AIX unwinder 2021-12-09 16:43:32 -05:00
CMakeLists.txt [runtimes] Remove support for GCC-style 32 bit multilib builds 2021-12-01 12:57:01 -05:00
backtrace_test.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_array_01.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_array_02.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_class_01.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_class_02.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_class_03.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_class_04.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_const_pointer_nullptr.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_function_01.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_function_02.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_function_03.pass.cpp [libc++] [test] Eliminate libcpp-no-noexcept-function-type and libcpp-no-structured-bindings. 2021-11-20 11:44:57 -05:00
catch_in_noexcept.pass.cpp [runtimes] Use int main(int, char**) consistently in tests 2020-10-08 14:28:13 -04:00
catch_member_data_pointer_01.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_member_function_pointer_01.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_member_function_pointer_02.pass.cpp [libc++] [test] Eliminate libcpp-no-noexcept-function-type and libcpp-no-structured-bindings. 2021-11-20 11:44:57 -05:00
catch_member_pointer_nullptr.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_multi_level_pointer.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_pointer_nullptr.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_pointer_reference.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_ptr.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_ptr_02.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
catch_reference_nullptr.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cxa_bad_cast.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cxa_bad_typeid.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cxa_thread_atexit_test.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cxa_vec_new_overflow_PR41395.pass.cpp [runtimes] Simplify how we specify XFAIL & friends based on the triple 2021-07-01 14:03:30 -04:00
dynamic_cast.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
dynamic_cast3.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
dynamic_cast5.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
dynamic_cast14.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
dynamic_cast_stress.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
exception_object_alignment.2.pass.cpp [runtimes] Use int main(int, char**) consistently in tests 2020-10-08 14:28:13 -04:00
exception_object_alignment.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
forced_unwind1.pass.cpp [Unwind] Harmonise exception class for EHABI spec. 2021-09-02 11:31:03 +02:00
forced_unwind2.pass.cpp [Unwind] Harmonise exception class for EHABI spec. 2021-09-02 11:31:03 +02:00
forced_unwind3.pass.cpp [libunwind][ARM] Handle end of stack during unwind 2021-11-26 13:26:49 +01:00
guard_test_basic.pass.cpp [libcxxabi] Added convenience classes to cxa_guard 2022-01-12 17:31:36 -05:00
guard_threaded_test.pass.cpp [NFC][libcxxabi] Rename GlobalLock to GlobalMutex 2022-01-12 17:29:17 -05:00
incomplete_type.sh.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
inherited_exception.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
lit.cfg.py [libc++abi] Allow specifying custom Lit config files 2020-06-25 12:15:15 -04:00
lit.site.cfg.in [runtimes] Add tests for vendor-specific properties 2021-10-07 15:46:20 -04:00
noexception1.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
noexception2.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
noexception3.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
noexception4.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
test_aux_runtime.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
test_aux_runtime_op_array_new.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
test_demangle.pass.cpp [demangler][NFC] Refactor some parsing 2022-01-24 05:28:38 -08:00
test_exception_address_alignment.pass.cpp [libc++] Remove test-suite annotations for unsupported Clang versions 2021-08-20 15:05:13 -04:00
test_exception_storage.pass.cpp [runtimes] Remove support for GCC-style 32 bit multilib builds 2021-12-01 12:57:01 -05:00
test_fallback_malloc.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
test_guard.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
test_vector1.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
test_vector2.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
test_vector3.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
thread_local_destruction_order.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
uncaught_exception.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
uncaught_exceptions.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
unittest_demangle.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
unwind_01.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
unwind_02.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
unwind_03.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
unwind_04.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
unwind_05.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
unwind_06.pass.cpp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00