-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Labels
Description
Describe the bug
When setting flags in the "compiler" tab that should affect the LLVM IR view, those flag seem to be ignored.
Steps to reproduce
- Choose nightly rustc as the compiler
- add the
-Zfewer-names=trueflag - add an LLVM IR window
I used this code:
const C: (&u32, &u32) = {
let x = &(0xaaaaaaaa, 0xbbbbbbbb);
(&x.0, &x.1)
};
#[unsafe(no_mangle)]
pub fn get1() -> &'static u32 {
C.0
}
#[unsafe(no_mangle)]
pub fn get2() -> &'static u32 {
C.1
}Expected behavior
The flag should affect the name of the global in LLVM IR. By default, it's alloc_c9bf22225d4343a4b04cfb9efe779ab0, but with the flag it should become something like anon.bb9f785fef94f15b27153a454d937760.0. I confirmed this locally by building that code with --emit=llvm-ir -Zfewer-names=true --crate-type=lib.
However, on godbolt the name in the LLVM IR view is always `alloc_c9bf22225d4343a4b04cfb9efe779ab0.
Reproduction link
https://rust.godbolt.org/z/bfbY73jsa
Screenshots
Not applicable
Operating System
No response
Browser version
No response
Reactions are currently unavailable