[libcxx-commits] [PATCH] D104366: [Demangle][Rust] Parse non-ASCII identifiers

Tomasz Miąsko via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 16 03:28:40 PDT 2021


tmiasko created this revision.
tmiasko added a reviewer: dblaikie.
Herald added subscribers: JDevlieghere, hiraditya.
tmiasko requested review of this revision.
Herald added projects: libc++abi, LLVM.
Herald added subscribers: llvm-commits, libcxx-commits.
Herald added a reviewer: libc++abi.

Rust allows use of non-ASCII identifiers, which in Rust mangling scheme
are encoded using Punycode.

The encoding deviates from the standard by using an underscore as the
separator between ASCII part and a base-36 encoding of non-ASCII
characters (avoiding hypen-minus in the symbol name). Other than that,
the encoding follows the standard, and the decoder implemented here in
turn follows the one given in RFC 3492.

To avoid an extra intermediate memory allocation while decoding
Punycode, the interface of OutputStream is extended with an insert
method.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104366

Files:
  libcxxabi/src/demangle/Utility.h
  llvm/include/llvm/Demangle/RustDemangle.h
  llvm/include/llvm/Demangle/Utility.h
  llvm/lib/Demangle/RustDemangle.cpp
  llvm/test/Demangle/rust.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104366.352382.patch
Type: text/x-patch
Size: 8764 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210616/62970c6b/attachment.bin>


More information about the libcxx-commits mailing list