[all-commits] [llvm/llvm-project] c8c2b4: [Demangle][Rust] Parse non-ASCII identifiers

tmiasko via All-commits all-commits at lists.llvm.org
Fri Oct 1 13:14:09 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c8c2b4629f7597ac16102dab6150da14d68167de
      https://github.com/llvm/llvm-project/commit/c8c2b4629f7597ac16102dab6150da14d68167de
  Author: Tomasz Miąsko <tomasz.miasko at gmail.com>
  Date:   2021-10-01 (Fri, 01 Oct 2021)

  Changed paths:
    M libcxxabi/src/demangle/Utility.h
    M llvm/include/llvm/Demangle/Utility.h
    M llvm/lib/Demangle/RustDemangle.cpp
    M llvm/test/Demangle/rust.test
    M llvm/unittests/Demangle/CMakeLists.txt
    A llvm/unittests/Demangle/OutputStreamTest.cpp

  Log Message:
  -----------
  [Demangle][Rust] Parse non-ASCII identifiers

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.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D104366




More information about the All-commits mailing list