Closed zheland closed 1 month ago
Please check on more "real" examples if possible.
To be honest I'm not using LLVM output often enough and no_mangle
- at all, at least in projects I'm usually working on. Let's merge this in as is since it improves the behavior and I'll deal with any remaining issues if somebody reports them or I encounter them myself.
Thank you for your great contributions. Please let me know if you have more planned - I can wait with the release for some time.
Thank you, nothing more planned yet :-)
In LLVM-IR output mode
cargo asm
don't parse non-mangled function definitions properly and return function names likeFunction Attrs: mustprogress nofree noinline norecurse nosync nounwind nonlazybind willreturn memory(none) uwtable
instead. In ASM output mode everything is okay.Checked with example about on linux x86_64 and with cargo test.
Changes
#[no_mangle]
functions don't always start with_
: requirement for_
prefix removed,no_mangle
function will not contain a comment with its name beforehand, and as a result:Function Attrs:
should not be parsed as an item: added an exception,define
directive should be used to detect a new function start: done,demangle::demangled
returnsNone
forno_mangle
functions: use original name in that case.Example
For the following code:
Current output (without this PR)
Expected (with this PR)