Explicitly mark x86-interrupt ABI argument as byval

The first argument to an x86-interrupt ABI function was implicitly
treated as byval prior to LLVM 12. Since LLVM 12, it has to be
marked as such explicitly: 2e0e03c6a0
This commit is contained in:
Nikita Popov 2021-02-23 21:38:49 +01:00
parent 55f345f325
commit 092643a266
1 changed files with 7 additions and 0 deletions

View File

@ -603,6 +603,13 @@ impl<'a, Ty> FnAbi<'a, Ty> {
Ty: TyAndLayoutMethods<'a, C> + Copy,
C: LayoutOf<Ty = Ty, TyAndLayout = TyAndLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
{
if abi == spec::abi::Abi::X86Interrupt {
if let Some(arg) = self.args.first_mut() {
arg.make_indirect_byval();
}
return Ok(());
}
match &cx.target_spec().arch[..] {
"x86" => {
let flavor = if abi == spec::abi::Abi::Fastcall {