Skip to content

Commit 12517e9

Browse files
committed
---
yaml --- r: 150506 b: refs/heads/try2 c: 49dc019 h: refs/heads/master v: v3
1 parent 633ea6f commit 12517e9

File tree

2 files changed

+3
-78
lines changed

2 files changed

+3
-78
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: a9bf0990003d5d27bc30a9018bb5cdc0666be916
8+
refs/heads/try2: 49dc0193bd664da733113f0baa43bfc7c094bf8b
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/trans/base.rs

Lines changed: 2 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,11 @@ use std::cell::{Cell, RefCell};
7777
use std::libc::c_uint;
7878
use std::local_data;
7979
use syntax::abi::{X86, X86_64, Arm, Mips, Rust, RustIntrinsic};
80-
use syntax::ast_map::PathName;
8180
use syntax::ast_util::{local_def, is_local};
8281
use syntax::attr::AttrMetaMethods;
8382
use syntax::attr;
8483
use syntax::codemap::Span;
8584
use syntax::parse::token::InternedString;
86-
use syntax::parse::token;
8785
use syntax::visit::Visitor;
8886
use syntax::visit;
8987
use syntax::{ast, ast_util, ast_map};
@@ -447,10 +445,6 @@ pub fn malloc_general<'a>(bcx: &'a Block<'a>, t: ty::t, heap: heap)
447445

448446
// Type descriptor and type glue stuff
449447

450-
pub fn get_tydesc_simple(ccx: &CrateContext, t: ty::t) -> ValueRef {
451-
get_tydesc(ccx, t).tydesc
452-
}
453-
454448
pub fn get_tydesc(ccx: &CrateContext, t: ty::t) -> @tydesc_info {
455449
match ccx.tydescs.borrow().find(&t) {
456450
Some(&inf) => return inf,
@@ -464,6 +458,7 @@ pub fn get_tydesc(ccx: &CrateContext, t: ty::t) -> @tydesc_info {
464458
return inf;
465459
}
466460

461+
#[allow(dead_code)] // useful
467462
pub fn set_optimize_for_size(f: ValueRef) {
468463
lib::llvm::SetFunctionAttribute(f, lib::llvm::OptimizeForSizeAttribute)
469464
}
@@ -472,6 +467,7 @@ pub fn set_no_inline(f: ValueRef) {
472467
lib::llvm::SetFunctionAttribute(f, lib::llvm::NoInlineAttribute)
473468
}
474469

470+
#[allow(dead_code)] // useful
475471
pub fn set_no_unwind(f: ValueRef) {
476472
lib::llvm::SetFunctionAttribute(f, lib::llvm::NoUnwindAttribute)
477473
}
@@ -667,19 +663,6 @@ pub fn compare_scalar_values<'a>(
667663
pub type val_and_ty_fn<'r,'b> =
668664
'r |&'b Block<'b>, ValueRef, ty::t| -> &'b Block<'b>;
669665

670-
pub fn load_inbounds<'a>(cx: &'a Block<'a>, p: ValueRef, idxs: &[uint])
671-
-> ValueRef {
672-
return Load(cx, GEPi(cx, p, idxs));
673-
}
674-
675-
pub fn store_inbounds<'a>(
676-
cx: &'a Block<'a>,
677-
v: ValueRef,
678-
p: ValueRef,
679-
idxs: &[uint]) {
680-
Store(cx, v, GEPi(cx, p, idxs));
681-
}
682-
683666
// Iterates through the elements of a structural type.
684667
pub fn iter_structural_ty<'r,
685668
'b>(
@@ -975,29 +958,6 @@ pub fn need_invoke(bcx: &Block) -> bool {
975958
bcx.fcx.needs_invoke()
976959
}
977960

978-
pub fn do_spill(bcx: &Block, v: ValueRef, t: ty::t) -> ValueRef {
979-
if ty::type_is_bot(t) {
980-
return C_null(Type::i8p(bcx.ccx()));
981-
}
982-
let llptr = alloc_ty(bcx, t, "");
983-
Store(bcx, v, llptr);
984-
return llptr;
985-
}
986-
987-
// Since this function does *not* root, it is the caller's responsibility to
988-
// ensure that the referent is pointed to by a root.
989-
pub fn do_spill_noroot(cx: &Block, v: ValueRef) -> ValueRef {
990-
let llptr = alloca(cx, val_ty(v), "");
991-
Store(cx, v, llptr);
992-
return llptr;
993-
}
994-
995-
pub fn spill_if_immediate(cx: &Block, v: ValueRef, t: ty::t) -> ValueRef {
996-
let _icx = push_ctxt("spill_if_immediate");
997-
if type_is_immediate(cx.ccx(), t) { return do_spill(cx, v, t); }
998-
return v;
999-
}
1000-
1001961
pub fn load_if_immediate(cx: &Block, v: ValueRef, t: ty::t) -> ValueRef {
1002962
let _icx = push_ctxt("load_if_immediate");
1003963
if type_is_immediate(cx.ccx(), t) { return Load(cx, v); }
@@ -1040,20 +1000,6 @@ pub fn raw_block<'a>(
10401000
Block::new(llbb, is_lpad, None, fcx)
10411001
}
10421002

1043-
pub fn block_locals(b: &ast::Block, it: |@ast::Local|) {
1044-
for s in b.stmts.iter() {
1045-
match s.node {
1046-
ast::StmtDecl(d, _) => {
1047-
match d.node {
1048-
ast::DeclLocal(ref local) => it(*local),
1049-
_ => {} /* fall through */
1050-
}
1051-
}
1052-
_ => {} /* fall through */
1053-
}
1054-
}
1055-
}
1056-
10571003
pub fn with_cond<'a>(
10581004
bcx: &'a Block<'a>,
10591005
val: ValueRef,
@@ -1173,10 +1119,6 @@ pub fn arrayalloca(cx: &Block, ty: Type, v: ValueRef) -> ValueRef {
11731119
return ArrayAlloca(cx, ty, v);
11741120
}
11751121

1176-
pub struct BasicBlocks {
1177-
sa: BasicBlockRef,
1178-
}
1179-
11801122
// Creates and returns space for, or returns the argument representing, the
11811123
// slot where the return value of the function must go.
11821124
pub fn make_return_pointer(fcx: &FunctionContext, output_type: ty::t)
@@ -2142,11 +2084,6 @@ fn register_method(ccx: &CrateContext, id: ast::NodeId,
21422084
llfn
21432085
}
21442086

2145-
pub fn vp2i(cx: &Block, v: ValueRef) -> ValueRef {
2146-
let ccx = cx.ccx();
2147-
return PtrToInt(cx, v, ccx.int_type);
2148-
}
2149-
21502087
pub fn p2i(ccx: &CrateContext, v: ValueRef) -> ValueRef {
21512088
unsafe {
21522089
return llvm::LLVMConstPtrToInt(v, ccx.int_type.to_ref());
@@ -2315,18 +2252,6 @@ pub fn declare_intrinsics(ccx: &mut CrateContext) {
23152252
}
23162253
}
23172254

2318-
pub fn trap(bcx: &Block) {
2319-
match bcx.ccx().intrinsics.find_equiv(& &"llvm.trap") {
2320-
Some(&x) => { Call(bcx, x, [], []); },
2321-
_ => bcx.sess().bug("unbound llvm.trap in trap")
2322-
}
2323-
}
2324-
2325-
pub fn symname(name: &str, hash: &str, vers: &str) -> ~str {
2326-
let path = [PathName(token::intern(name))];
2327-
link::exported_name(ast_map::Values(path.iter()).chain(None), hash, vers)
2328-
}
2329-
23302255
pub fn crate_ctxt_to_encode_parms<'r>(cx: &'r CrateContext, ie: encoder::EncodeInlinedItem<'r>)
23312256
-> encoder::EncodeParams<'r> {
23322257

0 commit comments

Comments
 (0)