Skip to content

Commit

Permalink
Allow specification of the system V AMD64 ABI constraint.
Browse files Browse the repository at this point in the history
This can be specified using `extern sysV64 fn` on all platforms
  • Loading branch information
CensoredUsername committed Aug 30, 2016
1 parent 71ee82a commit 516519e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/doc/book/ffi.md
Expand Up @@ -539,6 +539,7 @@ This is currently hidden behind the `abi_vectorcall` gate and is subject to chan
* `system`
* `C`
* `win64`
* `sysV64`

Most of the abis in this list are self-explanatory, but the `system` abi may
seem a little odd. This constraint selects whatever the appropriate ABI is for
Expand Down
1 change: 1 addition & 0 deletions src/librustc_llvm/ffi.rs
Expand Up @@ -42,6 +42,7 @@ pub enum CallConv {
ColdCallConv = 9,
X86StdcallCallConv = 64,
X86FastcallCallConv = 65,
X86_64_SysV = 78,
X86_64_Win64 = 79,
X86_VectorCall = 80
}
Expand Down
1 change: 1 addition & 0 deletions src/librustc_trans/abi.rs
Expand Up @@ -269,6 +269,7 @@ impl FnType {
Vectorcall => llvm::X86_VectorCall,
C => llvm::CCallConv,
Win64 => llvm::X86_64_Win64,
SysV64 => llvm::X86_64_SysV,

// These API constants ought to be more specific...
Cdecl => llvm::CCallConv,
Expand Down
2 changes: 2 additions & 0 deletions src/libsyntax/abi.rs
Expand Up @@ -39,6 +39,7 @@ pub enum Abi {
Vectorcall,
Aapcs,
Win64,
SysV64,

// Multiplatform ABIs second
Rust,
Expand Down Expand Up @@ -86,6 +87,7 @@ const AbiDatas: &'static [AbiData] = &[
AbiData {abi: Abi::Vectorcall, name: "vectorcall"},
AbiData {abi: Abi::Aapcs, name: "aapcs" },
AbiData {abi: Abi::Win64, name: "win64" },
AbiData {abi: Abi::SysV64, name: "sysV64" },

// Cross-platform ABIs
//
Expand Down

0 comments on commit 516519e

Please sign in to comment.