llvm-project/llvm/lib/Demangle
Nathan Sidwell 201c4b9cc4 [demangler] Rust demangler buffer return
The rust demangler has some odd buffer handling code, which will copy
the demangled string into the provided buffer, if it will fit.
Otherwise it uses the allocated buffer it made.  But the length of the
incoming buffer will have come from a previous call, which was the
length of the demangled string -- not the buffer size.  And of course,
we're unconditionally allocating a temporary buffer in the first
place.  So we don't actually get buffer reuse, and we get a memcpy in
somecases.

However, nothing in LLVM ever passes in a non-null pointer.  Neither
does anything pass in a status pointer that is then made use of.  The
only exercise these have is in the test suite.

So let's just make the rust demangler have the same API as the dlang
demangler.

Reviewed By: tmiasko

Differential Revision: https://reviews.llvm.org/D123420
2022-04-13 08:50:04 -07:00
..
CMakeLists.txt [Demangle] Add minimal support for D programming language 2021-11-09 09:29:13 -08:00
DLangDemangle.cpp [Demangle] Pass Ret parameter from decodeNumber by reference 2022-01-12 21:57:31 +00:00
Demangle.cpp [demangler] Rust demangler buffer return 2022-04-13 08:50:04 -07:00
ItaniumDemangle.cpp [demangler] Node precision dumper 2022-04-06 14:04:15 -07:00
MicrosoftDemangle.cpp [demangler] Add StringView conversion operator 2022-03-28 11:19:55 -07:00
MicrosoftDemangleNodes.cpp [demangler] Add StringView conversion operator 2022-03-28 11:19:55 -07:00
RustDemangle.cpp [demangler] Rust demangler buffer return 2022-04-13 08:50:04 -07:00