diff --git a/src/comp/metadata/tydecode.rs b/src/comp/metadata/tydecode.rs index d6aa9e5d25a6..5ee4fd88cc0c 100644 --- a/src/comp/metadata/tydecode.rs +++ b/src/comp/metadata/tydecode.rs @@ -261,7 +261,6 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t { alt next(st) as char { 'i' { abi = ast::native_abi_rust_intrinsic; } 'c' { abi = ast::native_abi_cdecl; } - 'l' { abi = ast::native_abi_llvm; } 's' { abi = ast::native_abi_x86stdcall; } 'C' { abi = ast::native_abi_c_stack_cdecl; } 'S' { abi = ast::native_abi_c_stack_stdcall; } diff --git a/src/comp/metadata/tyencode.rs b/src/comp/metadata/tyencode.rs index b074b878876e..26bce6f802bd 100644 --- a/src/comp/metadata/tyencode.rs +++ b/src/comp/metadata/tyencode.rs @@ -144,7 +144,6 @@ fn enc_sty(w: io::writer, cx: @ctxt, st: ty::sty) { alt abi { native_abi_rust_intrinsic. { w.write_char('i'); } native_abi_cdecl. { w.write_char('c'); } - native_abi_llvm. { w.write_char('l'); } native_abi_x86stdcall. { w.write_char('s'); } native_abi_c_stack_cdecl. { w.write_char('C'); } native_abi_c_stack_stdcall. { w.write_char('S'); } diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 779ea48672c6..ff67fb37257f 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -5532,7 +5532,7 @@ fn native_fn_ty_param_count(cx: @crate_ctxt, id: ast::node_id) -> uint { pure fn native_abi_requires_pair(abi: ast::native_abi) -> bool { alt abi { ast::native_abi_cdecl. | - ast::native_abi_llvm. | ast::native_abi_rust_intrinsic. | + ast::native_abi_rust_intrinsic. | ast::native_abi_x86stdcall. { ret true; } ast::native_abi_c_stack_cdecl. | ast::native_abi_c_stack_stdcall. { ret false; } @@ -5581,11 +5581,6 @@ fn register_native_fn(ccx: @crate_ctxt, sp: span, path: [str], name: str, uses_retptr = false; cast_to_i32 = true; } - ast::native_abi_llvm. { - pass_task = false; - uses_retptr = false; - cast_to_i32 = false; - } ast::native_abi_x86stdcall. { pass_task = false; uses_retptr = false; @@ -5713,13 +5708,6 @@ fn register_native_fn(ccx: @crate_ctxt, sp: span, path: [str], name: str, let r; let rptr; alt abi { - ast::native_abi_llvm. { - let result = - trans_simple_native_abi(bcx, name, call_args, fn_type, - uses_retptr, lib::llvm::LLVMCCallConv); - r = result.val; - rptr = result.rptr; - } ast::native_abi_rust_intrinsic. { let external_name = "rust_intrinsic_" + name; let result = diff --git a/src/comp/syntax/ast.rs b/src/comp/syntax/ast.rs index 03b8872adc7e..f1b1d16dd6fc 100644 --- a/src/comp/syntax/ast.rs +++ b/src/comp/syntax/ast.rs @@ -427,7 +427,6 @@ type _mod = {view_items: [@view_item], items: [@item]}; tag native_abi { native_abi_cdecl; - native_abi_llvm; native_abi_rust_intrinsic; native_abi_x86stdcall; native_abi_c_stack_cdecl; diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 3fff03addfd4..9db7c8ae5f0a 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -2007,8 +2007,6 @@ fn parse_item_native_mod(p: parser, attrs: [ast::attribute]) -> @ast::item { if !is_word(p, "mod") { let t = parse_str(p); if str::eq(t, "cdecl") { - } else if str::eq(t, "llvm") { - abi = ast::native_abi_llvm; } else if str::eq(t, "rust-intrinsic") { abi = ast::native_abi_rust_intrinsic; } else if str::eq(t, "x86stdcall") { diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index 9e447b5c4bfd..b52c6dfe450d 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -401,7 +401,6 @@ fn print_item(s: ps, &&item: @ast::item) { ast::item_native_mod(nmod) { head(s, "native"); alt nmod.abi { - ast::native_abi_llvm. { word_nbsp(s, "\"llvm\""); } ast::native_abi_cdecl. { word_nbsp(s, "\"cdecl\""); } ast::native_abi_rust_intrinsic. { word_nbsp(s, "\"rust-intrinsic\""); diff --git a/src/lib/math.rs b/src/lib/math.rs index 5f35d0d06d78..cc2d14ef1f21 100644 --- a/src/lib/math.rs +++ b/src/lib/math.rs @@ -1,13 +1,13 @@ /* Module: math */ -native "llvm" mod llvm { - fn sqrt(n: float) -> float = "sqrt.f64"; - fn sin(n: float) -> float = "sin.f64"; - fn asin(n: float) -> float = "asin.f64"; - fn cos(n: float) -> float = "cos.f64"; - fn acos(n: float) -> float = "acos.f64"; - fn tan(n: float) -> float = "tan.f64"; - fn atan(n: float) -> float = "atan.f64"; +native "c-stack-cdecl" mod libc = "" { + fn sqrt(n: float) -> float; + fn sin(n: float) -> float; + fn asin(n: float) -> float; + fn cos(n: float) -> float; + fn acos(n: float) -> float; + fn tan(n: float) -> float; + fn atan(n: float) -> float; } /* @@ -15,49 +15,49 @@ Function: sqrt Returns the square root */ -fn sqrt(x: float) -> float { llvm::sqrt(x) } +fn sqrt(x: float) -> float { libc::sqrt(x) } /* Function: sin Returns the sine of an angle */ -fn sin(x: float) -> float { llvm::sin(x) } +fn sin(x: float) -> float { libc::sin(x) } /* Function: cos Returns the cosine of an angle */ -fn cos(x: float) -> float { llvm::cos(x) } +fn cos(x: float) -> float { libc::cos(x) } /* Function: tan Returns the tangent of an angle */ -fn tan(x: float) -> float { llvm::tan(x) } +fn tan(x: float) -> float { libc::tan(x) } /* Function: asin Returns the arcsine of an angle */ -fn asin(x: float) -> float { llvm::asin(x) } +fn asin(x: float) -> float { libc::asin(x) } /* Function: acos Returns the arccosine of an angle */ -fn acos(x: float) -> float { llvm::acos(x) } +fn acos(x: float) -> float { libc::acos(x) } /* Function: atan Returns the arctangent of an angle */ -fn atan(x: float) -> float { llvm::atan(x) } +fn atan(x: float) -> float { libc::atan(x) } /* Const: pi diff --git a/src/test/run-pass/native-llvm.rs b/src/test/run-pass/native-llvm.rs deleted file mode 100644 index 450f052bc626..000000000000 --- a/src/test/run-pass/native-llvm.rs +++ /dev/null @@ -1,10 +0,0 @@ -// xfail-test - -native "llvm" mod llvm { - fn thesqrt(n: float) -> float = "sqrt.f64"; -} - -fn main() { - let s = llvm::thesqrt(4.0); - assert 1.9 < s && s < 2.1; -} \ No newline at end of file