@@ -77,13 +77,11 @@ use std::cell::{Cell, RefCell};
77
77
use std:: libc:: c_uint;
78
78
use std:: local_data;
79
79
use syntax:: abi:: { X86 , X86_64 , Arm , Mips , Rust , RustIntrinsic } ;
80
- use syntax:: ast_map:: PathName ;
81
80
use syntax:: ast_util:: { local_def, is_local} ;
82
81
use syntax:: attr:: AttrMetaMethods ;
83
82
use syntax:: attr;
84
83
use syntax:: codemap:: Span ;
85
84
use syntax:: parse:: token:: InternedString ;
86
- use syntax:: parse:: token;
87
85
use syntax:: visit:: Visitor ;
88
86
use syntax:: visit;
89
87
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)
447
445
448
446
// Type descriptor and type glue stuff
449
447
450
- pub fn get_tydesc_simple ( ccx : & CrateContext , t : ty:: t ) -> ValueRef {
451
- get_tydesc ( ccx, t) . tydesc
452
- }
453
-
454
448
pub fn get_tydesc ( ccx : & CrateContext , t : ty:: t ) -> @tydesc_info {
455
449
match ccx. tydescs . borrow ( ) . find ( & t) {
456
450
Some ( & inf) => return inf,
@@ -464,6 +458,7 @@ pub fn get_tydesc(ccx: &CrateContext, t: ty::t) -> @tydesc_info {
464
458
return inf;
465
459
}
466
460
461
+ #[ allow( dead_code) ] // useful
467
462
pub fn set_optimize_for_size ( f : ValueRef ) {
468
463
lib:: llvm:: SetFunctionAttribute ( f, lib:: llvm:: OptimizeForSizeAttribute )
469
464
}
@@ -472,6 +467,7 @@ pub fn set_no_inline(f: ValueRef) {
472
467
lib:: llvm:: SetFunctionAttribute ( f, lib:: llvm:: NoInlineAttribute )
473
468
}
474
469
470
+ #[ allow( dead_code) ] // useful
475
471
pub fn set_no_unwind ( f : ValueRef ) {
476
472
lib:: llvm:: SetFunctionAttribute ( f, lib:: llvm:: NoUnwindAttribute )
477
473
}
@@ -667,19 +663,6 @@ pub fn compare_scalar_values<'a>(
667
663
pub type val_and_ty_fn < ' r , ' b > =
668
664
' r |& ' b Block < ' b > , ValueRef , ty:: t | -> & ' b Block < ' b > ;
669
665
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
-
683
666
// Iterates through the elements of a structural type.
684
667
pub fn iter_structural_ty < ' r ,
685
668
' b > (
@@ -975,29 +958,6 @@ pub fn need_invoke(bcx: &Block) -> bool {
975
958
bcx. fcx . needs_invoke ( )
976
959
}
977
960
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
-
1001
961
pub fn load_if_immediate ( cx : & Block , v : ValueRef , t : ty:: t ) -> ValueRef {
1002
962
let _icx = push_ctxt ( "load_if_immediate" ) ;
1003
963
if type_is_immediate ( cx. ccx ( ) , t) { return Load ( cx, v) ; }
@@ -1040,20 +1000,6 @@ pub fn raw_block<'a>(
1040
1000
Block :: new ( llbb, is_lpad, None , fcx)
1041
1001
}
1042
1002
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
-
1057
1003
pub fn with_cond < ' a > (
1058
1004
bcx : & ' a Block < ' a > ,
1059
1005
val : ValueRef ,
@@ -1173,10 +1119,6 @@ pub fn arrayalloca(cx: &Block, ty: Type, v: ValueRef) -> ValueRef {
1173
1119
return ArrayAlloca ( cx, ty, v) ;
1174
1120
}
1175
1121
1176
- pub struct BasicBlocks {
1177
- sa : BasicBlockRef ,
1178
- }
1179
-
1180
1122
// Creates and returns space for, or returns the argument representing, the
1181
1123
// slot where the return value of the function must go.
1182
1124
pub fn make_return_pointer ( fcx : & FunctionContext , output_type : ty:: t )
@@ -2142,11 +2084,6 @@ fn register_method(ccx: &CrateContext, id: ast::NodeId,
2142
2084
llfn
2143
2085
}
2144
2086
2145
- pub fn vp2i( cx: & Block , v: ValueRef ) -> ValueRef {
2146
- let ccx = cx. ccx( ) ;
2147
- return PtrToInt ( cx, v, ccx. int_type) ;
2148
- }
2149
-
2150
2087
pub fn p2i( ccx: & CrateContext , v: ValueRef ) -> ValueRef {
2151
2088
unsafe {
2152
2089
return llvm:: LLVMConstPtrToInt ( v, ccx. int_type. to_ref( ) ) ;
@@ -2315,18 +2252,6 @@ pub fn declare_intrinsics(ccx: &mut CrateContext) {
2315
2252
}
2316
2253
}
2317
2254
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
-
2330
2255
pub fn crate_ctxt_to_encode_parms<' r>( cx: & ' r CrateContext , ie: encoder:: EncodeInlinedItem <' r>)
2331
2256
-> encoder:: EncodeParams <' r> {
2332
2257
0 commit comments