rustc: Remove sret attributes from functions
Something about the way we're using it is causing incorrect code generation. Closes #1343
This commit is contained in:
parent
d4a4b82973
commit
af086aa8ef
@ -4475,11 +4475,6 @@ fn create_llargs_for_fn_args(cx: @fn_ctxt, ty_self: self_arg,
|
||||
|
||||
fn copy_args_to_allocas(fcx: @fn_ctxt, bcx: @block_ctxt, args: [ast::arg],
|
||||
arg_tys: [ty::arg]) -> @block_ctxt {
|
||||
if fcx_ccx(fcx).sess.get_opts().extra_debuginfo {
|
||||
llvm::LLVMAddAttribute(llvm::LLVMGetFirstParam(fcx.llfn),
|
||||
lib::llvm::LLVMStructRetAttribute as
|
||||
lib::llvm::llvm::Attribute);
|
||||
}
|
||||
let arg_n: uint = 0u, bcx = bcx;
|
||||
for arg in arg_tys {
|
||||
let id = args[arg_n].id;
|
||||
|
@ -93,14 +93,9 @@ fn Invoke(cx: @block_ctxt, Fn: ValueRef, Args: [ValueRef],
|
||||
assert (!cx.terminated);
|
||||
cx.terminated = true;
|
||||
unsafe {
|
||||
let instr = llvm::LLVMBuildInvoke(B(cx), Fn, vec::to_ptr(Args),
|
||||
vec::len(Args), Then, Catch,
|
||||
noname());
|
||||
if bcx_ccx(cx).sess.get_opts().debuginfo {
|
||||
llvm::LLVMAddInstrAttribute(instr, 1u,
|
||||
lib::llvm::LLVMStructRetAttribute as
|
||||
lib::llvm::llvm::Attribute);
|
||||
}
|
||||
llvm::LLVMBuildInvoke(B(cx), Fn, vec::to_ptr(Args),
|
||||
vec::len(Args), Then, Catch,
|
||||
noname());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user