mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-29 11:51:31 +03:00
Remove StructRet arg attr
It is applied exactly when the return value has an indirect pass mode. Except for InReg on x86 fastcall, arg attrs are now only used for optimization purposes and thus are fine to ignore.
This commit is contained in:
@@ -36,7 +36,7 @@ fn for_each_kind<F>(&self, mut f: F)
|
||||
where
|
||||
F: FnMut(llvm::Attribute),
|
||||
{
|
||||
for_each_kind!(self, f, NoAlias, NoCapture, NonNull, ReadOnly, StructRet, InReg)
|
||||
for_each_kind!(self, f, NoAlias, NoCapture, NonNull, ReadOnly, InReg)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,7 +429,8 @@ fn apply_attrs_llfn(&self, cx: &CodegenCx<'ll, 'tcx>, llfn: &'ll Value) {
|
||||
}
|
||||
PassMode::Indirect { ref attrs, extra_attrs: _, on_stack } => {
|
||||
assert!(!on_stack);
|
||||
apply(attrs);
|
||||
let i = apply(attrs);
|
||||
llvm::Attribute::StructRet.apply_llfn(llvm::AttributePlace::Argument(i), llfn);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
@@ -484,7 +485,9 @@ fn apply_attrs_callsite(&self, bx: &mut Builder<'a, 'll, 'tcx>, callsite: &'ll V
|
||||
}
|
||||
PassMode::Indirect { ref attrs, extra_attrs: _, on_stack } => {
|
||||
assert!(!on_stack);
|
||||
apply(attrs);
|
||||
let i = apply(attrs);
|
||||
llvm::Attribute::StructRet
|
||||
.apply_callsite(llvm::AttributePlace::Argument(i), callsite);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
@@ -2801,10 +2801,6 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) {
|
||||
for arg in &mut self.args {
|
||||
fixup(arg, false);
|
||||
}
|
||||
if let PassMode::Indirect { ref mut attrs, extra_attrs: _, on_stack: _ } = self.ret.mode
|
||||
{
|
||||
attrs.set(ArgAttribute::StructRet);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ pub struct ArgAttribute: u16 {
|
||||
const NoCapture = 1 << 2;
|
||||
const NonNull = 1 << 3;
|
||||
const ReadOnly = 1 << 4;
|
||||
const StructRet = 1 << 6;
|
||||
const InReg = 1 << 8;
|
||||
}
|
||||
}
|
||||
@@ -619,10 +618,6 @@ pub fn adjust_for_cabi<C>(&mut self, cx: &C, abi: spec::abi::Abi) -> Result<(),
|
||||
a => return Err(format!("unrecognized arch \"{}\" in target specification", a)),
|
||||
}
|
||||
|
||||
if let PassMode::Indirect { ref mut attrs, extra_attrs: _, on_stack: _ } = self.ret.mode {
|
||||
attrs.set(ArgAttribute::StructRet);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user