@@ -54,7 +54,7 @@ use trans::cleanup;
54
54
use trans:: closure;
55
55
use trans:: common:: { Block , C_bool , C_bytes_in_context , C_i32 , C_int , C_integral } ;
56
56
use trans:: common:: { C_null , C_struct_in_context , C_u64 , C_u8 , C_undef } ;
57
- use trans:: common:: { CrateContext , ExternMap , FunctionContext } ;
57
+ use trans:: common:: { CrateContext , FunctionContext } ;
58
58
use trans:: common:: { Result , NodeIdAndSpan } ;
59
59
use trans:: common:: { node_id_type, return_type_is_void} ;
60
60
use trans:: common:: { type_is_immediate, type_is_zero_size, val_ty} ;
@@ -67,7 +67,6 @@ use trans::debuginfo::{self, DebugLoc, ToDebugLoc};
67
67
use trans:: expr;
68
68
use trans:: foreign;
69
69
use trans:: glue;
70
- use trans:: inline;
71
70
use trans:: intrinsic;
72
71
use trans:: machine;
73
72
use trans:: machine:: { llsize_of, llsize_of_real} ;
@@ -84,7 +83,7 @@ use util::sha2::Sha256;
84
83
use util:: nodemap:: NodeMap ;
85
84
86
85
use arena:: TypedArena ;
87
- use libc:: { c_uint, uint64_t } ;
86
+ use libc:: c_uint;
88
87
use std:: ffi:: { CStr , CString } ;
89
88
use std:: cell:: { Cell , RefCell } ;
90
89
use std:: collections:: HashSet ;
@@ -218,23 +217,6 @@ pub fn decl_cdecl_fn(ccx: &CrateContext,
218
217
decl_fn ( ccx, name, llvm:: CCallConv , ty, ty:: FnConverging ( output) )
219
218
}
220
219
221
- // only use this for foreign function ABIs and glue, use `get_extern_rust_fn` for Rust functions
222
- pub fn get_extern_fn ( ccx : & CrateContext ,
223
- externs : & mut ExternMap ,
224
- name : & str ,
225
- cc : llvm:: CallConv ,
226
- ty : Type ,
227
- output : Ty )
228
- -> ValueRef {
229
- match externs. get ( name) {
230
- Some ( n) => return * n,
231
- None => { }
232
- }
233
- let f = decl_fn ( ccx, name, cc, ty, ty:: FnConverging ( output) ) ;
234
- externs. insert ( name. to_string ( ) , f) ;
235
- f
236
- }
237
-
238
220
fn get_extern_rust_fn < ' a , ' tcx > ( ccx : & CrateContext < ' a , ' tcx > , fn_ty : Ty < ' tcx > ,
239
221
name : & str , did : ast:: DefId ) -> ValueRef {
240
222
match ccx. externs ( ) . borrow ( ) . get ( name) {
@@ -400,45 +382,6 @@ pub fn note_unique_llvm_symbol(ccx: &CrateContext, sym: String) {
400
382
ccx. all_llvm_symbols ( ) . borrow_mut ( ) . insert ( sym) ;
401
383
}
402
384
403
-
404
- pub fn get_res_dtor < ' a , ' tcx > ( ccx : & CrateContext < ' a , ' tcx > ,
405
- did : ast:: DefId ,
406
- t : Ty < ' tcx > ,
407
- parent_id : ast:: DefId ,
408
- substs : & Substs < ' tcx > )
409
- -> ValueRef {
410
- let _icx = push_ctxt ( "trans_res_dtor" ) ;
411
- let did = inline:: maybe_instantiate_inline ( ccx, did) ;
412
-
413
- if !substs. types . is_empty ( ) {
414
- assert_eq ! ( did. krate, ast:: LOCAL_CRATE ) ;
415
-
416
- // Since we're in trans we don't care for any region parameters
417
- let substs = ccx. tcx ( ) . mk_substs ( Substs :: erased ( substs. types . clone ( ) ) ) ;
418
-
419
- let ( val, _, _) = monomorphize:: monomorphic_fn ( ccx, did, substs, None ) ;
420
-
421
- val
422
- } else if did. krate == ast:: LOCAL_CRATE {
423
- get_item_val ( ccx, did. node )
424
- } else {
425
- let tcx = ccx. tcx ( ) ;
426
- let name = csearch:: get_symbol ( & ccx. sess ( ) . cstore , did) ;
427
- let class_ty = ty:: lookup_item_type ( tcx, parent_id) . ty . subst ( tcx, substs) ;
428
- let llty = type_of_dtor ( ccx, class_ty) ;
429
- let dtor_ty = ty:: mk_ctor_fn ( ccx. tcx ( ) ,
430
- did,
431
- & [ glue:: get_drop_glue_type ( ccx, t) ] ,
432
- ty:: mk_nil ( ccx. tcx ( ) ) ) ;
433
- get_extern_fn ( ccx,
434
- & mut * ccx. externs ( ) . borrow_mut ( ) ,
435
- & name[ ..] ,
436
- llvm:: CCallConv ,
437
- llty,
438
- dtor_ty)
439
- }
440
- }
441
-
442
385
pub fn bin_op_to_icmp_predicate ( ccx : & CrateContext , op : ast:: BinOp_ , signed : bool )
443
386
-> llvm:: IntPredicate {
444
387
match op {
0 commit comments