Skip to content

Commit af086aa

Browse files
committed
rustc: Remove sret attributes from functions
Something about the way we're using it is causing incorrect code generation. Closes #1343
1 parent d4a4b82 commit af086aa

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/comp/middle/trans.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4475,11 +4475,6 @@ fn create_llargs_for_fn_args(cx: @fn_ctxt, ty_self: self_arg,
44754475

44764476
fn copy_args_to_allocas(fcx: @fn_ctxt, bcx: @block_ctxt, args: [ast::arg],
44774477
arg_tys: [ty::arg]) -> @block_ctxt {
4478-
if fcx_ccx(fcx).sess.get_opts().extra_debuginfo {
4479-
llvm::LLVMAddAttribute(llvm::LLVMGetFirstParam(fcx.llfn),
4480-
lib::llvm::LLVMStructRetAttribute as
4481-
lib::llvm::llvm::Attribute);
4482-
}
44834478
let arg_n: uint = 0u, bcx = bcx;
44844479
for arg in arg_tys {
44854480
let id = args[arg_n].id;

src/comp/middle/trans_build.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,9 @@ fn Invoke(cx: @block_ctxt, Fn: ValueRef, Args: [ValueRef],
9393
assert (!cx.terminated);
9494
cx.terminated = true;
9595
unsafe {
96-
let instr = llvm::LLVMBuildInvoke(B(cx), Fn, vec::to_ptr(Args),
97-
vec::len(Args), Then, Catch,
98-
noname());
99-
if bcx_ccx(cx).sess.get_opts().debuginfo {
100-
llvm::LLVMAddInstrAttribute(instr, 1u,
101-
lib::llvm::LLVMStructRetAttribute as
102-
lib::llvm::llvm::Attribute);
103-
}
96+
llvm::LLVMBuildInvoke(B(cx), Fn, vec::to_ptr(Args),
97+
vec::len(Args), Then, Catch,
98+
noname());
10499
}
105100
}
106101

0 commit comments

Comments
 (0)