[Demangle] Extract nonMicrosoftDemangle from llvm::demangle
authorTomasz Miąsko <tomasz.miasko@gmail.com>
Fri, 15 Oct 2021 18:41:35 +0000 (20:41 +0200)
committerTomasz Miąsko <tomasz.miasko@gmail.com>
Sat, 16 Oct 2021 11:32:16 +0000 (13:32 +0200)
commit41a6fc8438f306aa562908027de64061353778ce
tree920a0d0e5c1babe414780c5f89f989017e2db769
parent4d7c7d87e46e3589594aa789c543e2a8b667d3f2
[Demangle] Extract nonMicrosoftDemangle from llvm::demangle

Introduce a new demangling function that supports symbols using Itanium
mangling and Rust v0 mangling, and is expected in the near future to
include support for D mangling as well.

Unlike llvm::demangle, the function does not accept extra underscore
decoration. The callers generally know exactly when symbols should
include the extra decoration and so they should be responsible for
stripping it.

Functionally the only intended change is to allow demangling Rust
symbols with an extra underscore decoration through llvm::demangle,
which matches the existing behaviour for Itanium symbols.

Reviewed By: dblaikie, jhenderson

Part of https://reviews.llvm.org/D110664
llvm/include/llvm/Demangle/Demangle.h
llvm/lib/Demangle/Demangle.cpp
llvm/unittests/Demangle/DemangleTest.cpp