diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-23 21:38:49 +0100 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-28 10:19:44 +0100 |
| commit | 092643a2665f807ab045a533c04785f4f37d2d7d (patch) | |
| tree | 5a0d93234fda81fb01c30f86292828b6d5676cf7 | |
| parent | 55f345f32505c2095966a5dc46c4ae3290dbf7a1 (diff) | |
| download | rust-092643a2665f807ab045a533c04785f4f37d2d7d.tar.gz rust-092643a2665f807ab045a533c04785f4f37d2d7d.zip | |
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: https://github.com/llvm/llvm-project/commit/2e0e03c6a089da39039ec3f464f7cee5df86646b
| -rw-r--r-- | compiler/rustc_target/src/abi/call/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs index 9c49922c286..0deb1186b0f 100644 --- a/compiler/rustc_target/src/abi/call/mod.rs +++ b/compiler/rustc_target/src/abi/call/mod.rs @@ -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 { |
