mirror of
https://github.com/intel/llvm.git
synced 2026-02-07 16:11:27 +08:00
[Demangle][Rust] Parse dot suffix
Allow mangled names to include an arbitrary dot suffix, akin to vendor specific suffix in Itanium mangling. Primary motivation is a support for symbols renamed during ThinLTO import / promotion (ThinLTO is the default configuration for optimized builds in rustc). Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D104358
This commit is contained in:
@@ -109,7 +109,9 @@ bool Demangler::demangle(StringView Mangled) {
|
||||
Error = true;
|
||||
return false;
|
||||
}
|
||||
Input = Mangled;
|
||||
size_t Dot = Mangled.find('.');
|
||||
Input = Mangled.substr(0, Dot);
|
||||
StringView Suffix = Mangled.dropFront(Dot);
|
||||
|
||||
demanglePath(rust_demangle::InType::No);
|
||||
|
||||
@@ -121,6 +123,12 @@ bool Demangler::demangle(StringView Mangled) {
|
||||
if (Position != Input.size())
|
||||
Error = true;
|
||||
|
||||
if (!Suffix.empty()) {
|
||||
print(" (");
|
||||
print(Suffix);
|
||||
print(")");
|
||||
}
|
||||
|
||||
return !Error;
|
||||
}
|
||||
|
||||
|
||||
@@ -448,6 +448,14 @@ CHECK: _RIC7backrefSB9_E
|
||||
CHECK: _RIC7backrefKBa_E
|
||||
_RIC7backrefKBa_E
|
||||
|
||||
; Dot suffix
|
||||
|
||||
CHECK: dot (.llvm.1234)
|
||||
_RC3dot.llvm.1234
|
||||
|
||||
CHECK: dot (.llvm.6789)
|
||||
_RC3dotC5crate.llvm.6789
|
||||
|
||||
; Invalid mangled characters
|
||||
|
||||
CHECK: _RNvC2a.1c
|
||||
|
||||
Reference in New Issue
Block a user