Skip to content

Commit c1dbb9f

Browse files
committed
---
yaml --- r: 79847 b: refs/heads/try c: 71bebeb h: refs/heads/master i: 79845: 4f8c193 79843: 0d49e86 79839: 1181895 v: v3
1 parent 144c80d commit c1dbb9f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: ba9fa89bfb4aae53db93e9ecac31807af96356fc
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 54ae2800ffb30513f89ce13d27ac3c8d095d98ac
5-
refs/heads/try: 3f99540e9e1b32f042989ffde6d40f76477098c1
5+
refs/heads/try: 71bebebc37fbb229877da88dde13c2f35913bd77
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/trans/base.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,17 @@ pub fn decl_rust_fn(ccx: &mut CrateContext, inputs: &[ty::t], output: ty::t,
244244
}
245245
}
246246

247+
// The out pointer will never alias with any other pointers, as the object only exists at a
248+
// language level after the call. It can also be tagged with SRet to indicate that it is
249+
// guaranteed to point to a usable block of memory for the type.
250+
if uses_outptr {
251+
unsafe {
252+
let outptr = llvm::LLVMGetParam(llfn, 0);
253+
llvm::LLVMAddAttribute(outptr, lib::llvm::StructRetAttribute as c_uint);
254+
llvm::LLVMAddAttribute(outptr, lib::llvm::NoAliasAttribute as c_uint);
255+
}
256+
}
257+
247258
llfn
248259
}
249260

0 commit comments

Comments
 (0)