Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Rust-generated LLVM IR fails to demangle #6558

Closed
Alcaro opened this issue Jun 6, 2024 · 1 comment
Closed

[BUG]: Rust-generated LLVM IR fails to demangle #6558

Alcaro opened this issue Jun 6, 2024 · 1 comment
Labels

Comments

@Alcaro
Copy link
Contributor

Alcaro commented Jun 6, 2024

Describe the bug

[BUG]: LLVM IR viewer on rustc uses C++ demangling

Steps to reproduce

#[inline(never)]
#[no_mangle]
pub fn _Z1ai() {}

#[inline(never)]
pub fn common_chars() -> Vec<String> {
    vec!["a".into(),"b".into()]
}

Expected behavior

_Z1ai

<alloc::vec::Vec<T,A> as core::ops::drop::Drop>::drop::h20f42961a44ccece

Actual behavior

define void @a(int)() unnamed_addr {

define void @"_ZN70_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h20f42961a44cceceE"(ptr noalias nocapture noundef readnone align 8 dereferenceable(24) %self) unnamed_addr {

Reproduction link

https://godbolt.org/z/h7PP4GTzn

Screenshots

Not applicable

Operating System

No response

Browser version

No response

@Alcaro Alcaro added the bug label Jun 6, 2024
@OfekShilon OfekShilon changed the title [BUG]: LLVM IR viewer on rustc uses C++ demangling [BUG]: Rust-generated LLVM IR fails to demangle Jun 6, 2024
@narpfel
Copy link
Contributor

narpfel commented Jun 6, 2024

#6560 addresses the second case of quoted identifiers not being demangled.

The fix for the first case (non-Rust identifiers) is a bit more complicated; I’ve written some thoughts here: #6265 (comment)

mattgodbolt pushed a commit that referenced this issue Jun 8, 2024
This fixes one of the two problems reported in #6558.
mattgodbolt pushed a commit that referenced this issue Jun 11, 2024
This fixes one of the two problems reported in #6558.
OfekShilon added a commit that referenced this issue Jun 19, 2024
Fixes at least #6554.

Modified to not clash with @narpfel 's earlier fix to #6558
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants