Skip to content

Commit 562afef

Browse files
committed
Rename builtin back to intrinsic
As per Graydon's request Issue #1981
1 parent f502469 commit 562afef

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

src/rustc/front/attr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ fn native_abi(attrs: [ast::attribute]) -> either<str, ast::native_abi> {
237237
option::none {
238238
either::right(ast::native_abi_cdecl)
239239
}
240-
option::some("rust-builtin") {
241-
either::right(ast::native_abi_rust_builtin)
240+
option::some("rust-builtin") | option::some("rust-intrinsic") {
241+
either::right(ast::native_abi_rust_intrinsic)
242242
}
243243
option::some("cdecl") {
244244
either::right(ast::native_abi_cdecl)

src/rustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ fn encode_info_for_native_item(ecx: @encode_ctxt, ebml_w: ebml::writer,
677677
encode_family(ebml_w, purity_fn_family(fn_decl.purity));
678678
encode_type_param_bounds(ebml_w, ecx, tps);
679679
encode_type(ecx, ebml_w, node_id_to_type(ecx.ccx.tcx, nitem.id));
680-
if abi == native_abi_rust_builtin {
680+
if abi == native_abi_rust_intrinsic {
681681
astencode::encode_inlined_item(ecx, ebml_w, path,
682682
ii_native(nitem));
683683
} else {

src/rustc/middle/ast_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn map_decoded_item(sess: session, map: map, path: path, ii: inlined_item) {
9292
alt ii {
9393
ii_item(i) { /* fallthrough */ }
9494
ii_native(i) {
95-
cx.map.insert(i.id, node_native_item(i, native_abi_rust_builtin,
95+
cx.map.insert(i.id, node_native_item(i, native_abi_rust_intrinsic,
9696
@path));
9797
}
9898
ii_method(impl_did, m) {

src/rustc/middle/lint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ fn check_ctypes(tcx: ty::ctxt, crate: @ast::crate) {
124124
fn check_item(tcx: ty::ctxt, it: @ast::item) {
125125
alt it.node {
126126
ast::item_native_mod(nmod) if attr::native_abi(it.attrs) !=
127-
either::right(ast::native_abi_rust_builtin) {
127+
either::right(ast::native_abi_rust_intrinsic) {
128128
for ni in nmod.items {
129129
alt ni.node {
130130
ast::native_item_fn(decl, tps) {

src/rustc/middle/trans/base.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,7 +1947,7 @@ fn monomorphic_fn(ccx: @crate_ctxt, fn_id: ast::def_id, real_substs: [ty::t],
19471947
}
19481948
ast_map::node_variant(v, _, pt) { (pt, v.node.name) }
19491949
ast_map::node_method(m, _, pt) { (pt, m.ident) }
1950-
ast_map::node_native_item(i, ast::native_abi_rust_builtin, pt)
1950+
ast_map::node_native_item(i, ast::native_abi_rust_intrinsic, pt)
19511951
{ (pt, i.ident) }
19521952
ast_map::node_native_item(_, abi, _) {
19531953
// Natives don't have to be monomorphized.
@@ -1981,8 +1981,8 @@ fn monomorphic_fn(ccx: @crate_ctxt, fn_id: ast::def_id, real_substs: [ty::t],
19811981
trans_fn(ccx, pt, d, body, lldecl, no_self, psubsts, d_id, none);
19821982
}
19831983
ast_map::node_native_item(i, _, _) {
1984-
native::trans_builtin(ccx, lldecl, i, pt, option::get(psubsts),
1985-
ref_id);
1984+
native::trans_intrinsic(ccx, lldecl, i, pt, option::get(psubsts),
1985+
ref_id);
19861986
}
19871987
ast_map::node_variant(v, enum_item, _) {
19881988
let tvs = ty::enum_variants(ccx.tcx, local_def(enum_item.id));

src/rustc/middle/trans/native.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import std::map::hashmap;
1616
import util::ppaux::ty_to_str;
1717

1818
export link_name, trans_native_mod, register_crust_fn, trans_crust_fn,
19-
decl_native_fn, trans_builtin;
19+
decl_native_fn, trans_intrinsic;
2020

2121
enum x86_64_reg_class {
2222
no_class,
@@ -730,7 +730,7 @@ fn trans_native_mod(ccx: @crate_ctxt,
730730
}
731731

732732
let mut cc = alt abi {
733-
ast::native_abi_rust_builtin { ret; }
733+
ast::native_abi_rust_intrinsic { ret; }
734734
ast::native_abi_cdecl { lib::llvm::CCallConv }
735735
ast::native_abi_stdcall { lib::llvm::X86StdcallCallConv }
736736
};
@@ -752,9 +752,9 @@ fn trans_native_mod(ccx: @crate_ctxt,
752752
}
753753
}
754754

755-
fn trans_builtin(ccx: @crate_ctxt, decl: ValueRef, item: @ast::native_item,
756-
path: ast_map::path, substs: param_substs,
757-
ref_id: option<ast::node_id>) {
755+
fn trans_intrinsic(ccx: @crate_ctxt, decl: ValueRef, item: @ast::native_item,
756+
path: ast_map::path, substs: param_substs,
757+
ref_id: option<ast::node_id>) {
758758
let fcx = new_fn_ctxt_w_id(ccx, path, decl, item.id, none,
759759
some(substs), some(item.span));
760760
let bcx = top_scope_block(fcx, none), lltop = bcx.llbb;

src/rustc/middle/trans/type_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fn type_uses_for(ccx: @crate_ctxt, fn_id: def_id, n_tps: uint)
6868
uint::range(0u, n_tps) {|n| cx.uses[n] |= use_repr;}
6969
}
7070
ast_map::node_native_item(i@@{node: native_item_fn(_, _), _}, abi, _) {
71-
if abi == native_abi_rust_builtin {
71+
if abi == native_abi_rust_intrinsic {
7272
let flags = alt check i.ident {
7373
"size_of" | "align_of" | "init" |
7474
"reinterpret_cast" { use_repr }

src/rustc/middle/typeck.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -948,8 +948,8 @@ mod collect {
948948
ast::item_mod(_) {}
949949
ast::item_native_mod(m) {
950950
if front::attr::native_abi(it.attrs) ==
951-
either::right(ast::native_abi_rust_builtin) {
952-
for item in m.items { check_builtin_type(tcx, item); }
951+
either::right(ast::native_abi_rust_intrinsic) {
952+
for item in m.items { check_intrinsic_type(tcx, item); }
953953
}
954954
}
955955
ast::item_enum(variants, ty_params) {
@@ -1414,7 +1414,7 @@ mod writeback {
14141414
}
14151415
}
14161416

1417-
fn check_builtin_type(tcx: ty::ctxt, it: @ast::native_item) {
1417+
fn check_intrinsic_type(tcx: ty::ctxt, it: @ast::native_item) {
14181418
fn param(tcx: ty::ctxt, n: uint) -> ty::t {
14191419
ty::mk_param(tcx, n, local_def(0))
14201420
}
@@ -1432,7 +1432,7 @@ fn check_builtin_type(tcx: ty::ctxt, it: @ast::native_item) {
14321432
"addr_of" { (1u, [arg(ast::by_ref, param(tcx, 0u))],
14331433
ty::mk_imm_ptr(tcx, param(tcx, 0u))) }
14341434
other {
1435-
tcx.sess.span_err(it.span, "unrecognized builtin function: `" +
1435+
tcx.sess.span_err(it.span, "unrecognized intrinsic function: `" +
14361436
other + "`");
14371437
ret;
14381438
}
@@ -1444,11 +1444,11 @@ fn check_builtin_type(tcx: ty::ctxt, it: @ast::native_item) {
14441444
let i_ty = ty_of_native_item(tcx, m_collect, it);
14451445
let i_n_tps = (*i_ty.bounds).len();
14461446
if i_n_tps != n_tps {
1447-
tcx.sess.span_err(it.span, #fmt("builtin function has wrong number \
1447+
tcx.sess.span_err(it.span, #fmt("intrinsic has wrong number \
14481448
of type parameters. found %u, \
14491449
expected %u", i_n_tps, n_tps));
14501450
} else if !ty::same_type(tcx, i_ty.ty, fty) {
1451-
tcx.sess.span_err(it.span, #fmt("builtin function has wrong type. \
1451+
tcx.sess.span_err(it.span, #fmt("intrinsic has wrong type. \
14521452
expected %s", ty_to_str(tcx, fty)));
14531453
}
14541454
}

src/rustc/syntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ type _mod = {view_items: [@view_item], items: [@item]};
556556

557557
#[auto_serialize]
558558
enum native_abi {
559-
native_abi_rust_builtin,
559+
native_abi_rust_intrinsic,
560560
native_abi_cdecl,
561561
native_abi_stdcall,
562562
}

0 commit comments

Comments
 (0)