about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@gmail.com>2017-05-17 09:40:46 -0400
committerNathan Froyd <froydnj@gmail.com>2017-05-24 16:40:03 -0400
commit9a2e2450f968f60877f595d0609c15ad5ee821fa (patch)
treee816b47281fb7f6bde01847b0c1beb814dc59355 /src/libsyntax
parent5b13bff5203c1bdc6ac6dc87f69b5359a9503078 (diff)
downloadrust-9a2e2450f968f60877f595d0609c15ad5ee821fa.tar.gz
rust-9a2e2450f968f60877f595d0609c15ad5ee821fa.zip
add thiscall calling convention support
This support is needed for bindgen to work well on 32-bit Windows, and
also enables people to begin experimenting with C++ FFI support on that
platform.

Fixes #42044.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/abi.rs2
-rw-r--r--src/libsyntax/feature_gate.rs7
2 files changed, 9 insertions, 0 deletions
diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs
index 30641515a41..ed2eb209906 100644
--- a/src/libsyntax/abi.rs
+++ b/src/libsyntax/abi.rs
@@ -20,6 +20,7 @@ pub enum Abi {
     Stdcall,
     Fastcall,
     Vectorcall,
+    Thiscall,
     Aapcs,
     Win64,
     SysV64,
@@ -55,6 +56,7 @@ const AbiDatas: &'static [AbiData] = &[
     AbiData {abi: Abi::Stdcall, name: "stdcall", generic: false },
     AbiData {abi: Abi::Fastcall, name: "fastcall", generic: false },
     AbiData {abi: Abi::Vectorcall, name: "vectorcall", generic: false},
+    AbiData {abi: Abi::Thiscall, name: "thiscall", generic: false},
     AbiData {abi: Abi::Aapcs, name: "aapcs", generic: false },
     AbiData {abi: Abi::Win64, name: "win64", generic: false },
     AbiData {abi: Abi::SysV64, name: "sysv64", generic: false },
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index e1b7d4681ad..f9fe072ef87 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -352,6 +352,9 @@ declare_features! (
 
     // Allows use of the :vis macro fragment specifier
     (active, macro_vis_matcher, "1.18.0", Some(41022)),
+
+    // rustc internal
+    (active, abi_thiscall, "1.19.0", None),
 );
 
 declare_features! (
@@ -1051,6 +1054,10 @@ impl<'a> PostExpansionVisitor<'a> {
                 gate_feature_post!(&self, abi_vectorcall, span,
                                    "vectorcall is experimental and subject to change");
             },
+            Abi::Thiscall => {
+                gate_feature_post!(&self, abi_thiscall, span,
+                                   "thiscall is experimental and subject to change");
+            },
             Abi::RustCall => {
                 gate_feature_post!(&self, unboxed_closures, span,
                                    "rust-call ABI is subject to change");