File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/librustc/middle/trans Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1618,6 +1618,18 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext,
1618
1618
}
1619
1619
} ;
1620
1620
let uses_outptr = type_of:: return_uses_outptr ( ccx. tcx , substd_output_type) ;
1621
+
1622
+ // The out pointer will never alias with any other pointers, as the object only exists at a
1623
+ // language level after the call. It can also be tagged with SRet to indicate that it is
1624
+ // guaranteed to point to a usable block of memory for the type.
1625
+ if uses_outptr {
1626
+ unsafe {
1627
+ let outptr = llvm:: LLVMGetParam ( llfndecl, 0 ) ;
1628
+ llvm:: LLVMAddAttribute ( outptr, lib:: llvm:: StructRetAttribute as c_uint ) ;
1629
+ llvm:: LLVMAddAttribute ( outptr, lib:: llvm:: NoAliasAttribute as c_uint ) ;
1630
+ }
1631
+ }
1632
+
1621
1633
let debug_context = debuginfo:: create_function_debug_context ( ccx, id, param_substs, llfndecl) ;
1622
1634
1623
1635
let fcx = @mut FunctionContext {
You can’t perform that action at this time.
0 commit comments