summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src/demangle/ItaniumDemangle.h
Commit message (Collapse)AuthorAgeFilesLines
* [demangle] Copy back some NFC commits from LLVMErik Pilkington2020-01-091-4/+4
|
* [demangle] NFC: get rid of NodeOrStringErik Pilkington2019-11-041-55/+19
| | | | | | This class was a bit overengineered, and was triggering some PVS warnings. Instead, put strings into a NameType and let clients unconditionally treat it as a Node.
* Fix incorrect demangling of call operator of lambda with explicitRichard Smith2019-09-091-4/+0
| | | | | | template parameters due to registering template parameters twice. llvm-svn: 371469
* Simplify demangler rule for lambda-expressions to match discussion onRichard Smith2019-09-091-44/+16
| | | | | | cxx-abi list. llvm-svn: 371462
* Synchronize LLVM's copy of libc++abi's demangler with the libc++abiRichard Smith2019-09-071-1/+2
| | | | | | | | | version after r371273. Also fix a minor issue in r371273 that only surfaced after template instantiation from LLVM's use of the demangler. llvm-svn: 371274
* Implement demangling support for C++20 lambda expression extensions.Richard Smith2019-09-061-29/+407
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* [demangle] Support for C++2a char8_tErik Pilkington2019-06-281-0/+4
| | | | llvm-svn: 364677
* [demangle] Special case clang's creative mangling of __uuidof expressions.Erik Pilkington2019-06-181-0/+31
| | | | llvm-svn: 363752
* [demangle] Vendor extended types shouldn't be considered substitution candidatesErik Pilkington2019-06-101-1/+5
| | | | llvm-svn: 362983
* llvm-cxxfilt: Demangle gcc "old-style unified" ctors and dtorsNico Weber2019-04-031-7/+10
| | | | | | | | | | | 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/+6
| | | | llvm-svn: 351482
* [demangler] Ignore leading underscores if presentErik Pilkington2019-01-171-2/+2
| | | | | | | On MacOS, symbols start with a leading underscore, so just parse and ignore it if present. llvm-svn: 351481
* NFC: Make the copies of the demangler byte-for-byte identicalErik Pilkington2019-01-171-16/+14
| | | | | | | | | | | | | | With this patch, the copies of the files ItaniumDemangle.h, StringView.h, and Utility.h are kept byte-for-byte in sync between libcxxabi and llvm. All differences (namespaces, fallthrough, and unreachable macros) are defined in each copies' DemanglerConfig.h. This patch also adds a script to copy changes from libcxxabi (cp-to-llvm.sh), and a README.txt explaining the situation. Differential revision: https://reviews.llvm.org/D53538 llvm-svn: 351474
* [Demangle] remove itaniumFindTypesInMangledNamePavel Labath2018-11-271-6/+0
| | | | | | | | | | | | | | | | Summary: This (very specialized) function was added to enable an LLDB use case. Now that a more generic interface (overriding of parser functions - D52992) is available, and LLDB has been converted to use that (D54074), the function is unused and can be removed. Reviewers: erik.pilkington, sgraenitz, rsmith Subscribers: mgorny, hiraditya, christof, libcxx-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D54893 llvm-svn: 347670
* Use C++11 fallthrough attribute syntax when available and add a breakReid Kleckner2018-11-011-0/+1
| | | | | | | | | | | | | | | | | | | Summary: This silences the two -Wimplicit-fallthrough warnings clang finds in ItaniumDemangle.h in libc++abi. Clang does not have a GNU attribute spelling for this attribute, so this is necessary. I will commit the same change to the LLVM demangler soon. Reviewers: EricWF, ldionne Subscribers: christof, erik.pilkington, cfe-commits Differential Revision: https://reviews.llvm.org/D53985 llvm-svn: 345870
* cxa_demangle: make demangler's parsing functions overridablePavel Labath2018-10-161-302/+362
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This uses CRTP (for performance reasons) to allow a user the override demangler functions to implement custom parsing logic. The motivation for this is LLDB, which needs to occasionaly modify the mangled names. One such instance is already implemented via the TypeCallback member, but this is very specific functionality which does not help with any other use case. Currently we have a use case for modifying the constructor flavours, which would require adding another callback. This approach does not scale. With CRTP, the user (LLDB) can override any function it needs without any special support from the demangler library. After LLDB is ported to use this instead of the TypeCallback mechanism, the callback can be removed. More context can be found in D50599. Reviewers: erik.pilkington, rsmith Subscribers: christof, ldionne, llvm-commits, libcxx-commits Differential Revision: https://reviews.llvm.org/D52992 llvm-svn: 344607
* Port llvm r342166 to libcxxabi demanglerPavel Labath2018-10-101-19/+16
| | | | | | | | | | | | | | | | | | | | Summary: This was committed back in september (D51463), but it seems it never made it into the libcxxabi copy. The original commit message was: The hash computed for an ArrayType was different when first constructed versus when later profiled due to the constructor default argument, and we were not tracking constructor / destructor variant as part of the mangled name AST, leading to incorrect equivalences. Reviewers: erik.pilkington, rsmith, EricWF Subscribers: christof, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D53063 llvm-svn: 344121
* Port my recent changes from LLVM copy of the demangler:Richard Smith2018-08-241-24/+74
| | | | | | | | | | | r340663 - Allow Allocator::make to make a node of a different type than that requested. r340664 - Add documentation comment to ForwardTemplateReference. r340665 - Fix ExpandedSpecialSubstitution demangling for Sa and Sb. r340670 - Allow demangler's node allocator to fail, and bail out of the entire demangling process when it does. llvm-svn: 340671
* Port LLVM r340203 (and r340205) to libcxxabi.Richard Smith2018-08-201-0/+5087
Move Itanium demangler implementation into a header file and add visitation support. Summary: This transforms the Itanium demangler into a generic reusable library that can be used to build, traverse, and transform Itanium mangled name trees. This is in preparation for adding a canonicalizing demangler, which cannot live in the Demangle library for layering reasons. In order to keep the diffs simpler, this patch moves more code to the new header than is strictly necessary: in particular, all of the printLeft / printRight implementations can be moved to the implementation file. (And indeed we could make them non-virtual now if we wished, and remove the vptr from Node.) All nodes are now included in the Kind enumeration, rather than omitting some of the Expr nodes, and the three different floating-point literal node types now have distinct Kind values. As a proof of concept for the visitation / matching mechanism, this patch implements a Node dumping facility on top of it, replacing the prior mechanism that produced the pretty-printed output rather than a tree dump. Sample dump output: FunctionEncoding( NameType("int"), NameWithTemplateArgs( NestedName( NameWithTemplateArgs( NameType("A"), TemplateArgs( {NameType("B")})), NameType("f")), TemplateArgs( {NameType("int")})), {}, <null>, QualConst, FunctionRefQual::FrefQualLValue) As a next step, it would make sense to move the LLVM high-level interface to the demangler (the itaniumDemangler function and ItaniumPartialDemangler class) into the Support library, and implement them in terms of the Demangle library. This would allow the libc++abi demangler implementation to be an identical copy of the llvm Demangle library, and would allow the LLVM implementation to reuse LLVM components such as llvm::BumpPtrAllocator, but we'll need to decide how to coordinate that with the MS ABI demangler, so I'm not doing that in this patch. No functionality change intended other than the behavior of dump(). Reviewers: erik.pilkington, zturner, chandlerc, dlj Subscribers: aheejin, llvm-commits Differential Revision: https://reviews.llvm.org/D50930 llvm-svn: 340207
OpenPOWER on IntegriCloud