summaryrefslogtreecommitdiff
path: root/src/demangle
AgeCommit message (Collapse)Author
2020-10-26libcxxabi: ld128 demangle: allow space for 'L' suffix.Elliott Hughes
Summary: Caught by HWASAN on arm64 Android (which uses ld128 for long double). This was running the existing fuzzer. The specific minimized fuzz input to reproduce this is: __cxa_demangle("1\006ILeeeEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE", 0, 0, 0); Reviewers: eugenis, srhines, #libc_abi! Subscribers: kristof.beyls, danielkiss, libcxx-commits Tags: #libc_abi Differential Revision: https://reviews.llvm.org/D77924 Bug: http://b/152588929 Test: treehugger Change-Id: I393dbfc9a57543f2c9e53be71f5f56d5f13d931e
2018-11-27[Demangle] remove itaniumFindTypesInMangledNamePavel Labath
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@347670 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-11Port LLVM r346606 to libcxxabi.Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@346607 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-01Use C++11 fallthrough attribute syntax when available and add a breakReid Kleckner
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@345870 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-16cxa_demangle: make demangler's parsing functions overridablePavel Labath
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@344607 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-11Override libcxxabi's .clang-format in the demangle directoryErik Pilkington
This directory uses LLVM style. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@344316 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-10Port llvm r342166 to libcxxabi demanglerPavel Labath
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@344121 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-15Merge Demangle change in r342330 to libcxxabi.Nico Weber
Differential Revision: https://reviews.llvm.org/D52104 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@342331 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-24Port my recent changes from LLVM copy of the demangler:Richard Smith
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. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@340671 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-20Port LLVM r340203 (and r340205) to libcxxabi.Richard Smith
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@340207 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-23[demangler] call terminate() if allocation failedErik Pilkington
We really should set *status to memory_alloc_failure, but we need to refactor the demangler a bit to properly propagate the failure up the stack. Until then, its better to explicitly terminate then rely on a null dereference crash. rdar://31240372 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@337759 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20Merge changes to ItaniumDemangle over to libcxxabi.Zachary Turner
ItaniumDemangle had a small NFC refactor to make some of its code reusable by the newly added Microsoft demangler. To keep the libcxxabi demangler as close as possible to the master copy this refactor is being merged over. Differential Revision: https://reviews.llvm.org/D49575 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@337582 91177308-0d34-0410-b5e6-96231b3b80d8