@@ -20,7 +20,6 @@ use middle::resolve;
20
20
use middle:: trans:: adt;
21
21
use middle:: trans:: base;
22
22
use middle:: trans:: builder:: Builder ;
23
- use middle:: trans:: common:: { C_i32 , C_null } ;
24
23
use middle:: trans:: common:: { mono_id, ExternMap , tydesc_info, BuilderRef_res , Stats } ;
25
24
use middle:: trans:: debuginfo;
26
25
use middle:: trans:: type_:: Type ;
@@ -30,7 +29,6 @@ use util::nodemap::{NodeMap, NodeSet, DefIdMap};
30
29
31
30
use std:: cell:: { Cell , RefCell } ;
32
31
use std:: c_str:: ToCStr ;
33
- use std:: libc:: c_uint;
34
32
use std:: ptr;
35
33
use collections:: { HashMap , HashSet } ;
36
34
use syntax:: ast;
@@ -232,36 +230,6 @@ impl CrateContext {
232
230
Builder :: new ( self )
233
231
}
234
232
235
- pub fn const_inbounds_gepi ( & self ,
236
- pointer : ValueRef ,
237
- indices : & [ uint ] ) -> ValueRef {
238
- debug ! ( "const_inbounds_gepi: pointer={} indices={:?}" ,
239
- self . tn. val_to_str( pointer) , indices) ;
240
- let v: Vec < ValueRef > =
241
- indices. iter ( ) . map ( |i| C_i32 ( self , * i as i32 ) ) . collect ( ) ;
242
- unsafe {
243
- llvm:: LLVMConstInBoundsGEP ( pointer,
244
- v. as_ptr ( ) ,
245
- indices. len ( ) as c_uint )
246
- }
247
- }
248
-
249
- pub fn offsetof_gep ( & self ,
250
- llptr_ty : Type ,
251
- indices : & [ uint ] ) -> ValueRef {
252
- /*!
253
- * Returns the offset of applying the given GEP indices
254
- * to an instance of `llptr_ty`. Similar to `offsetof` in C,
255
- * except that `llptr_ty` must be a pointer type.
256
- */
257
-
258
- unsafe {
259
- let null = C_null ( llptr_ty) ;
260
- llvm:: LLVMConstPtrToInt ( self . const_inbounds_gepi ( null, indices) ,
261
- self . int_type . to_ref ( ) )
262
- }
263
- }
264
-
265
233
pub fn tydesc_type ( & self ) -> Type {
266
234
self . tn . find_type ( "tydesc" ) . unwrap ( )
267
235
}
0 commit comments