gnzlbg / cargo-asm

cargo subcommand showing the assembly or llvm-ir generated for Rust code
https://github.com/gnzlbg/cargo-asm
Other
1.17k stars 36 forks source link

Add support for no_mangle functions (fix #13) #153

Closed bbqsrc closed 3 years ago

bbqsrc commented 4 years ago

Does as it says on the can.

The awkward if statement is because on Apple the non-mangled functions are only _, even though mangled are __, so it would always fail otherwise.

gnzlbg commented 4 years ago

LGTM! Could we add a test that uses #[no_mangle] ?

bbqsrc commented 4 years ago

Mm, all the current tests are failing without my changes as the asm output is not what it expects or line numbers in libcore have changed, so I'm not even sure where I'd begin with that.

gnzlbg commented 4 years ago

hmm, yes the test only pass with a specific rustc version :/