summaryrefslogtreecommitdiffstats
path: root/libcxxabi/test/test_demangle.pass.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix incorrect demangling of call operator of lambda with explicitRichard Smith2019-09-091-1/+6
| | | | | | template parameters due to registering template parameters twice. llvm-svn: 371469
* Simplify demangler rule for lambda-expressions to match discussion onRichard Smith2019-09-091-1/+3
| | | | | | cxx-abi list. llvm-svn: 371462
* Implement demangling support for C++20 lambda expression extensions.Richard Smith2019-09-061-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | This implements demangling support for the mangling extensions specified in https://github.com/itanium-cxx-abi/cxx-abi/pull/85, much of which is implemented in Clang r359967 and r371004. Specifically, this provides demangling for: * <template-param-decl> in <lambda-sig> * <template-param> with non-zero level * lambda-expression literals (not emitted by Clang yet) * nullptr literals * string literals (The final two seem unrelated, but handling them was necessary in order to disambiguate between lambda expressions and the other forms of literal for which we have a type but no value.) When demangling a <lambda-sig>, we form template parameters with no corresponding argument, so we cannot substitute in the argument in the demangling. Instead we invent synthetic names for the template parameters (eg, '[]<typename $T>($T *x)'). llvm-svn: 371273
* libcxxabi: Rename .hpp files to .hNico Weber2019-08-121-1/+1
| | | | | | | | LLVM uses .h as its extension for header files. Differential Revision: https://reviews.llvm.org/D65981 llvm-svn: 368604
* [demangle] Support for C++2a char8_tErik Pilkington2019-06-281-0/+3
| | | | llvm-svn: 364677
* [demangle] Special case clang's creative mangling of __uuidof expressions.Erik Pilkington2019-06-181-0/+3
| | | | llvm-svn: 363752
* [demangle] Vendor extended types shouldn't be considered substitution candidatesErik Pilkington2019-06-101-1/+4
| | | | llvm-svn: 362983
* llvm-cxxfilt: Demangle gcc "old-style unified" ctors and dtorsNico Weber2019-04-031-0/+6
| | | | | | | | | | | These are variant 4, cf https://github.com/gcc-mirror/gcc/blob/master/gcc/cp/mangle.c#L1851 https://github.com/gcc-mirror/gcc/blob/master/gcc/cp/mangle.c#L1880 and gcc seems to sometimes emit them still. Differential Revision: https://reviews.llvm.org/D60229 llvm-svn: 357645
* 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
* [demangler] Support for block literals.Erik Pilkington2019-01-171-0/+2
| | | | llvm-svn: 351482
* [demangler] Ignore leading underscores if presentErik Pilkington2019-01-171-0/+4
| | | | | | | On MacOS, symbols start with a leading underscore, so just parse and ignore it if present. llvm-svn: 351481
* [itanium demangler] Support dot suffixes on block invocation functionsErik Pilkington2018-08-021-0/+2
| | | | | | rdar://32378759 llvm-svn: 338747
* [demangler] Support for reference collapsingErik Pilkington2018-07-271-0/+4
| | | | | | llvm.org/PR38323 llvm-svn: 338138
* [demangler] Support for fold expressions.Erik Pilkington2018-04-091-0/+6
| | | | llvm-svn: 329601
* [demangler] Support for <data-member-prefix>.Erik Pilkington2018-04-091-0/+3
| | | | llvm-svn: 329600
* [demangler] Support for partially substituted sizeof....Erik Pilkington2018-04-091-0/+2
| | | | llvm-svn: 329599
* [demangler] Use a back-patching scheme to resolve forward references.Erik Pilkington2018-03-251-2/+8
| | | | | | | | | | | | | | | Strictly in a conversion operator's type, a <template-param> refers to a <template-arg> that is further ahead in the mangled name. Instead of doing a second parse to resolve these, introduce a ForwardTemplateReference Node and back-patch the referenced <template-arg> when we're in the right context. This is also a correctness fix, previously we would only do a second parse if the <template-param> was out of bounds in the current set of <template-args>. This lead to misdemangles (gasp!) when the conversion operator was a member of a templated struct, for instance. llvm-svn: 328464
* [demangler] Tweak how parameter pack sizes are determined.Erik Pilkington2018-03-251-7/+10
| | | | | | | | Rather than eagerly propagating up parameter pack sizes in Node ctors, find the parameter pack size during printing. This is being done to support back-patching forward referencing <template-param>s. llvm-svn: 328463
* [demangler] Support for clang's enable_if attribute.Erik Pilkington2018-03-251-1/+5
| | | | | | Fixes PR33569. llvm-svn: 328462
* [demangler] Support for <template-param>s in generic lambdas.Erik Pilkington2018-03-161-1/+3
| | | | | | | These <template-param>s refer to "artifical" <template-arg>s that don't appear in the mangled name, so we just print them as "auto". llvm-svn: 327690
* [demangler] Simplify printing of structured bindings.Erik Pilkington2018-03-101-3/+3
| | | | | | Thanks to Richard Smith for the post-commit review! llvm-svn: 327228
* [demangler] Support for sequence numbers on lifetime extended temporaries.Erik Pilkington2018-03-101-0/+3
| | | | llvm-svn: 327227
* [demangler] Support for structured bindings.Erik Pilkington2018-03-101-1/+4
| | | | llvm-svn: 327226
* [demangler] Fix a mistake in r326797.Erik Pilkington2018-03-071-0/+2
| | | | | | Thanks to Nico Weber for pointing this out! llvm-svn: 326871
* [demangler] Modernize the rest of the demangler.Erik Pilkington2018-03-061-0/+3
| | | | llvm-svn: 326797
* [demangler] Modernize parse_name.Erik Pilkington2018-03-051-0/+3
| | | | llvm-svn: 326717
* [demangler] Support for exception specifications on function types.Erik Pilkington2018-02-141-0/+16
| | | | llvm-svn: 325093
* [demangler] Support for inheriting constructors.Erik Pilkington2018-02-131-0/+4
| | | | | | Fixes PR33223. llvm-svn: 325023
* [demangler] Support for initializer lists and designated initializers.Erik Pilkington2018-02-131-27/+27
| | | | llvm-svn: 324970
* [demangler] Support for dependent elaborate type specifiers.Erik Pilkington2018-02-131-1/+5
| | | | llvm-svn: 324969
* [demangler] All <qualifiers> on one type should share one entry in the ↵Erik Pilkington2018-02-131-0/+3
| | | | | | | | substitution table. Previously, both <extended-qualifier>s and <CV-qualifiers> got their own entries. llvm-svn: 324968
* [demangler] Clean up the expression parserErik Pilkington2018-02-021-0/+69
| | | | | | | | | | | | | | | | 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
* [demangler] Improve variadic template supportErik Pilkington2018-01-311-2/+8
| | | | | | | | | | | | | | 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
* [demangler] Support for abi_tag attributeErik Pilkington2017-11-221-0/+6
| | | | | | Differential revision: https://reviews.llvm.org/D40279 llvm-svn: 318874
* [demangler] Document some features that the demangler doesn't yet support, NFCErik Pilkington2017-11-211-2/+33
| | | | llvm-svn: 318765
* [demangler] Fix another oss-fuzz bugErik Pilkington2017-08-061-0/+1
| | | | llvm-svn: 310226
* [demangler] Fix another bug found by oss-fuzz in r309340Erik Pilkington2017-08-011-0/+1
| | | | llvm-svn: 309650
* [demangler] Fix some bugs in r309340 found by oss-fuzzErik Pilkington2017-07-301-0/+7
| | | | llvm-svn: 309520
* [demangler] Use an AST to represent demangled namesErik Pilkington2017-07-281-2/+1
| | | | | | | | | | | | The demangler now demangles by producing an AST, then traverses that AST to produce a demangled name. This is done for performance reasons, now the demangler doesn't manuiplate std::strings, which hurt performance and caused string operations to be inlined into the parser, leading to large code size and stack usage. Differential revision: https://reviews.llvm.org/D35159 llvm-svn: 309340
* [demangler] Respect try_to_parse_template_argsErik Pilkington2017-07-131-0/+1
| | | | | | Fixes an exponential parse found by oss-fuzz. llvm-svn: 307941
* [demangler] Fix a exponential string copying bugErik Pilkington2017-05-281-0/+1
| | | | | | | | | | | The problem was that if base_name() was called from a context without an actual base name, it could gulp up the entire string, which can result in recursive duplications. The fix is to be more strict as to what qualifies as a base name. Differential revision: https://reviews.llvm.org/D33637 llvm-svn: 304113
* __cxa_demangle: Fix constructor cv qualifier handlingTamas Berghammer2017-05-241-0/+1
| | | | | | | | | | | | | | | | | Summary: Previously if we parsed a constructor then we set parsed_ctor_dtor_cv to true and never reseted it. This causes issue when a template argument references a constructor (e.g. type of lambda defined inside a constructor) as we will have the parsed_ctor_dtor_cv flag set what will cause issues when parsing later arguments. Reviewers: EricWF, compnerd Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33385 llvm-svn: 303737
* [demangler] Fix a crash in the demangler during parsing of a lamdbaErik Pilkington2017-05-241-1/+3
| | | | | | | | | The problem is that multiple types could have been parsed from parse_type(), which the lamdba parameter parsing didn't handle. Differential revision: https://reviews.llvm.org/D33368 llvm-svn: 303718
* Add support for demangling C++11 thread_local variables. In clang, the ↵David Bozier2017-01-311-0/+2
| | | | | | grammar for mangling for these names are "<special-name> ::= TW <object name>" for wrapper variables or "<special-name> ::= TH <object name>" for initialization variables. llvm-svn: 293638
* Fix ASAN failure in cxa_demangleMehdi Amini2017-01-271-0/+1
| | | | | | Found with ASAN + libFuzzer by Kostya Serebryany <kcc@google.com> llvm-svn: 293330
* cxa_demangle: fix rvalue ref checkSaleem Abdulrasool2017-01-241-3/+2
| | | | | | | | | | | | 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
* cxa_demangle: avoid butchering the last parameter typeSaleem Abdulrasool2017-01-241-0/+6
| | | | | | | | | | | 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
* Revert r286788Jonathan Roelofs2017-01-181-0/+3
| | | | | | | | | | | | | | | | 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
* __cxa_demangle: allow demangling invocation blocksSaleem Abdulrasool2016-11-141-2/+4
| | | | | | | | | | | | 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
* Fix ASAN failures in the demanglerMehdi Amini2016-08-131-0/+16
| | | | | | These were found fuzzing with ASAN. llvm-svn: 278579
OpenPOWER on IntegriCloud