@@ -288,37 +288,6 @@ pub fn get_extern_const(externs: &mut ExternMap, llmod: ModuleRef,
288
288
return c;
289
289
}
290
290
}
291
- pub fn umax ( cx : @mut Block , a : ValueRef , b : ValueRef ) -> ValueRef {
292
- let _icx = push_ctxt ( "umax" ) ;
293
- let cond = ICmp ( cx, lib:: llvm:: IntULT , a, b) ;
294
- return Select ( cx, cond, b, a) ;
295
- }
296
-
297
- pub fn umin ( cx : @mut Block , a : ValueRef , b : ValueRef ) -> ValueRef {
298
- let _icx = push_ctxt ( "umin" ) ;
299
- let cond = ICmp ( cx, lib:: llvm:: IntULT , a, b) ;
300
- return Select ( cx, cond, a, b) ;
301
- }
302
-
303
- // Given a pointer p, returns a pointer sz(p) (i.e., inc'd by sz bytes).
304
- // The type of the returned pointer is always i8*. If you care about the
305
- // return type, use bump_ptr().
306
- pub fn ptr_offs ( bcx : @mut Block , base : ValueRef , sz : ValueRef ) -> ValueRef {
307
- let _icx = push_ctxt ( "ptr_offs" ) ;
308
- let raw = PointerCast ( bcx, base, Type :: i8p ( ) ) ;
309
- InBoundsGEP ( bcx, raw, [ sz] )
310
- }
311
-
312
- // Increment a pointer by a given amount and then cast it to be a pointer
313
- // to a given type.
314
- pub fn bump_ptr ( bcx : @mut Block , t : ty:: t , base : ValueRef , sz : ValueRef ) ->
315
- ValueRef {
316
- let _icx = push_ctxt ( "bump_ptr" ) ;
317
- let ccx = bcx. ccx ( ) ;
318
- let bumped = ptr_offs ( bcx, base, sz) ;
319
- let typ = type_of ( ccx, t) . ptr_to ( ) ;
320
- PointerCast ( bcx, bumped, typ)
321
- }
322
291
323
292
// Returns a pointer to the body for the box. The box may be an opaque
324
293
// box. The result will be casted to the type of body_t, if it is statically
@@ -434,10 +403,6 @@ pub fn malloc_general(bcx: @mut Block, t: ty::t, heap: heap) -> MallocResult {
434
403
assert ! ( heap != heap_exchange) ;
435
404
malloc_general_dyn ( bcx, t, heap, llsize_of ( bcx. ccx ( ) , ty) )
436
405
}
437
- pub fn malloc_boxed ( bcx : @mut Block , t : ty:: t )
438
- -> MallocResult {
439
- malloc_general ( bcx, t, heap_managed)
440
- }
441
406
442
407
pub fn heap_for_unique ( bcx : @mut Block , t : ty:: t ) -> heap {
443
408
if ty:: type_contents ( bcx. tcx ( ) , t) . contains_managed ( ) {
@@ -534,6 +499,12 @@ pub fn set_no_split_stack(f: ValueRef) {
534
499
}
535
500
}
536
501
502
+ pub fn set_glue_inlining ( f : ValueRef , t : ty:: t ) {
503
+ if ty:: type_is_structural ( t) {
504
+ set_optimize_for_size ( f) ;
505
+ } else { set_always_inline ( f) ; }
506
+ }
507
+
537
508
// Double-check that we never ask LLVM to declare the same symbol twice. It
538
509
// silently mangles such symbols, breaking our linkage model.
539
510
pub fn note_unique_llvm_symbol( ccx : & mut CrateContext , sym : @str ) {
0 commit comments