make_direct_deprecated: dont overwrite already set attributes
This commit is contained in:
parent
cfb47ca5df
commit
c7b8dd4e93
@ -584,20 +584,26 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
|
|||||||
/// Only exists because of past ABI mistakes that will take time to fix
|
/// Only exists because of past ABI mistakes that will take time to fix
|
||||||
/// (see <https://github.com/rust-lang/rust/issues/115666>).
|
/// (see <https://github.com/rust-lang/rust/issues/115666>).
|
||||||
pub fn make_direct_deprecated(&mut self) {
|
pub fn make_direct_deprecated(&mut self) {
|
||||||
|
match self.mode {
|
||||||
|
PassMode::Indirect { .. } => {
|
||||||
self.mode = PassMode::Direct(ArgAttributes::new());
|
self.mode = PassMode::Direct(ArgAttributes::new());
|
||||||
}
|
}
|
||||||
|
PassMode::Ignore | PassMode::Direct(_) | PassMode::Pair(_, _) => return, // already direct
|
||||||
|
_ => panic!("Tried to make {:?} direct", self.mode),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn make_indirect(&mut self) {
|
pub fn make_indirect(&mut self) {
|
||||||
match self.mode {
|
match self.mode {
|
||||||
PassMode::Direct(_) | PassMode::Pair(_, _) => {}
|
PassMode::Direct(_) | PassMode::Pair(_, _) => {
|
||||||
|
self.mode = Self::indirect_pass_mode(&self.layout);
|
||||||
|
}
|
||||||
PassMode::Indirect { attrs: _, meta_attrs: _, on_stack: false } => {
|
PassMode::Indirect { attrs: _, meta_attrs: _, on_stack: false } => {
|
||||||
// already indirect
|
// already indirect
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_ => panic!("Tried to make {:?} indirect", self.mode),
|
_ => panic!("Tried to make {:?} indirect", self.mode),
|
||||||
}
|
}
|
||||||
|
|
||||||
self.mode = Self::indirect_pass_mode(&self.layout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn make_indirect_byval(&mut self, byval_align: Option<Align>) {
|
pub fn make_indirect_byval(&mut self, byval_align: Option<Align>) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user