aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-03-28 08:24:11 -0700
committerPatrick Walton <[email protected]>2011-03-28 08:24:58 -0700
commit81695a19f876d6f5d75f18c05b2ae9c40a3221b3 (patch)
treedad8d0fc0026e1d8c99a73c64a5538ccf8db1cd7 /src/comp/front
parentAdd support for break and cont to rustc (diff)
downloadrust-81695a19f876d6f5d75f18c05b2ae9c40a3221b3.tar.xz
rust-81695a19f876d6f5d75f18c05b2ae9c40a3221b3.zip
rustc: Add support for calling LLVM intrinsics as native functions
Diffstat (limited to 'src/comp/front')
-rw-r--r--src/comp/front/ast.rs1
-rw-r--r--src/comp/front/creader.rs1
-rw-r--r--src/comp/front/parser.rs2
3 files changed, 4 insertions, 0 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs
index b1dbd80e..c4c1a56b 100644
--- a/src/comp/front/ast.rs
+++ b/src/comp/front/ast.rs
@@ -346,6 +346,7 @@ type _mod = rec(vec[@view_item] view_items,
tag native_abi {
native_abi_rust;
native_abi_cdecl;
+ native_abi_llvm;
}
type native_mod = rec(str native_name,
diff --git a/src/comp/front/creader.rs b/src/comp/front/creader.rs
index 6a864053..f1003cb6 100644
--- a/src/comp/front/creader.rs
+++ b/src/comp/front/creader.rs
@@ -162,6 +162,7 @@ impure fn parse_sty(@pstate st, str_def sd) -> ty.sty {
alt (next(st) as char) {
case ('r') {abi = ast.native_abi_rust;}
case ('c') {abi = ast.native_abi_cdecl;}
+ case ('l') {abi = ast.native_abi_llvm;}
}
auto func = parse_ty_fn(st, sd);
ret ty.ty_native_fn(abi,func._0,func._1);
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index c8130b0b..4a9f37f0 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -1964,6 +1964,8 @@ impure fn parse_item_native_mod(parser p) -> @ast.item {
if (_str.eq(t, "cdecl")) {
} else if (_str.eq(t, "rust")) {
abi = ast.native_abi_rust;
+ } else if (_str.eq(t, "llvm")) {
+ abi = ast.native_abi_llvm;
} else {
p.err("unsupported abi: " + t);
fail;