-
Notifications
You must be signed in to change notification settings - Fork 63
Remind LLVM about alloc function names in Rust #80
Conversation
Port and expansion of 4daef48
Includes rust-lang/llvm#80 Includes rust-lang/llvm#79 Also adds tests and thus fixes rust-lang#24194
Can you propose these additions to upstream LLVM? I want to patch our distro LLVM packages, but our maintainer would like some upstream review first. I guess that depends in part on our own stability -- are these signatures ever expected to change? |
@cuviper I would rather propose LLVM a patch that makes it possible to mark an arbitrary function as malloc-like, from the IR, rather than having to patch LLVM itself, but it would need time. |
{LibFunc::rust_allocate, {MallocLike, 2, 0, -1}}, | ||
{LibFunc::rust_allocate_zeroed, {MallocLike, 2, 0, -1}}, | ||
{LibFunc::rust_reallocate, {ReallocLike, 4, 2, -1}}, | ||
{LibFunc::rust_reallocate_inplace, {ReallocLike, 4, 2, -1}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is rust_reallocate_inplace
really ReallocLike
? realloc
invalidates the old pointer on success (even if the block does not move), and rust_reallocate_inplace
explicitly does not do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point. reallocate_inplace
does not return a pointer. I’ll remove it just to be safe.
This may exist today, although I'm not sure if that actually works. |
Upgrade LLVM Includes rust-lang/llvm#80
Remind LLVM about alloc function names in Rust
Remind LLVM about alloc function names in Rust
Remind LLVM about alloc function names in Rust
Port and expansion of 4daef48