about summary refs log tree commit diff
path: root/src/comp/syntax
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2011-09-28 12:58:03 -0700
committerPatrick Walton <pcwalton@mimiga.net>2011-09-28 12:58:33 -0700
commitf7d0c1cec3d65131cf4da273e6909ee97682dc42 (patch)
tree434b8de64fd4194aa80455c14fce7badf6fc9c7f /src/comp/syntax
parent657e3ffaf528c9ca9406a7ce89b6d949bce416cf (diff)
downloadrust-f7d0c1cec3d65131cf4da273e6909ee97682dc42.tar.gz
rust-f7d0c1cec3d65131cf4da273e6909ee97682dc42.zip
rustc: Add a new "C stack cdecl" native ABI
Diffstat (limited to 'src/comp/syntax')
-rw-r--r--src/comp/syntax/ast.rs1
-rw-r--r--src/comp/syntax/parse/parser.rs6
-rw-r--r--src/comp/syntax/print/pprust.rs3
3 files changed, 9 insertions, 1 deletions
diff --git a/src/comp/syntax/ast.rs b/src/comp/syntax/ast.rs
index 6dced2bf32a..87d417d5701 100644
--- a/src/comp/syntax/ast.rs
+++ b/src/comp/syntax/ast.rs
@@ -419,6 +419,7 @@ tag native_abi {
     native_abi_llvm;
     native_abi_rust_intrinsic;
     native_abi_x86stdcall;
+    native_abi_c_stack_cdecl;
 }
 
 type native_mod =
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index b2a89a43ec5..8fa705d6418 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -2012,7 +2012,11 @@ fn parse_item_native_mod(p: parser, attrs: [ast::attribute]) -> @ast::item {
             abi = ast::native_abi_rust_intrinsic;
         } else if str::eq(t, "x86stdcall") {
             abi = ast::native_abi_x86stdcall;
-        } else { p.fatal("unsupported abi: " + t); }
+        } else if str::eq(t, "c-stack-cdecl") {
+            abi = ast::native_abi_c_stack_cdecl;
+        } else {
+            p.fatal("unsupported abi: " + t);
+        }
     }
     expect_word(p, "mod");
     let id = parse_ident(p);
diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs
index 458af7e9b12..2b0bff104cd 100644
--- a/src/comp/syntax/print/pprust.rs
+++ b/src/comp/syntax/print/pprust.rs
@@ -408,6 +408,9 @@ fn print_item(s: ps, item: @ast::item) {
             word_nbsp(s, "\"rust-intrinsic\"");
           }
           ast::native_abi_x86stdcall. { word_nbsp(s, "\"x86stdcall\""); }
+          ast::native_abi_c_stack_cdecl. {
+            word_nbsp(s, "\"c-stack-cdecl\"");
+          }
         }
         word_nbsp(s, "mod");
         word_nbsp(s, item.ident);