diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2014-05-04 12:11:20 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2014-05-04 12:41:14 -0400 |
| commit | f62c753b8f7879607204bcf77491cc81baf9c2dc (patch) | |
| tree | 2753ef1ac6dd653655dd970f4ab36f58aab09012 /src/rustllvm/RustWrapper.cpp | |
| parent | 1c9b77643c281a4f7055bc760ffba846744f2b4b (diff) | |
| download | rust-f62c753b8f7879607204bcf77491cc81baf9c2dc.tar.gz rust-f62c753b8f7879607204bcf77491cc81baf9c2dc.zip | |
add back `noalias` to `&mut T` pointer parameters
This was removed because these could alias with `&const T` or `@mut T`
and those are now gone from the language. There are still aliasing
issues within local scopes, but this is correct for function parameters.
This also removes the no-op `noalias` marker on proc (not a pointer) and
leaves out the mention of #6750 because real type-based alias analysis
is not within the scope of best effort usage of the `noalias` attribute.
Test case:
pub fn foo(x: &mut &mut u32) {
**x = 5;
**x = 5;
}
Before:
define void @_ZN3foo20h0ce94c9671b0150bdaa4v0.0E(i32** nocapture readonly) unnamed_addr #0 {
entry-block:
%1 = load i32** %0, align 8
store i32 5, i32* %1, align 4
%2 = load i32** %0, align 8
store i32 5, i32* %2, align 4
ret void
}
After:
define void @_ZN3foo20h0ce94c9671b0150bdaa4v0.0E(i32** noalias nocapture readonly) unnamed_addr #0 {
entry-block:
%1 = load i32** %0, align 8
store i32 5, i32* %1, align 4
ret void
}
Closes #12436
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
