Remove native "llvm" ABI

This commit is contained in:
Brian Anderson 2011-11-07 15:29:05 -08:00
parent 1103fe8ca0
commit fcd39b1191
8 changed files with 16 additions and 44 deletions

View file

@ -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; }

View file

@ -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'); }

View file

@ -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 =

View file

@ -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;

View file

@ -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") {

View file

@ -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\"");

View file

@ -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

View file

@ -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;
}