Skip to content

Commit 2705a35

Browse files
committed
---
yaml --- r: 95643 b: refs/heads/dist-snap c: 327878e h: refs/heads/master i: 95641: 9d3a85b 95639: 6ed0413 v: v3
1 parent 2373eed commit 2705a35

File tree

4 files changed

+8
-41
lines changed

4 files changed

+8
-41
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: c16a95c587bb5ff5f06894657a1d7aafc69a2084
9+
refs/heads/dist-snap: 327878e628036320e79c9621ac827086986fab9d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libextra/arc.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,10 @@ pub struct Arc<T> { priv x: UnsafeArc<T> }
117117
*/
118118
impl<T:Freeze+Send> Arc<T> {
119119
/// Create an atomically reference counted wrapper.
120-
#[inline]
121120
pub fn new(data: T) -> Arc<T> {
122121
Arc { x: UnsafeArc::new(data) }
123122
}
124123

125-
#[inline]
126124
pub fn get<'a>(&'a self) -> &'a T {
127125
unsafe { &*self.x.get_immut() }
128126
}
@@ -150,7 +148,6 @@ impl<T:Freeze + Send> Clone for Arc<T> {
150148
* object. However, one of the `arc` objects can be sent to another task,
151149
* allowing them to share the underlying data.
152150
*/
153-
#[inline]
154151
fn clone(&self) -> Arc<T> {
155152
Arc { x: self.x.clone() }
156153
}
@@ -170,7 +167,6 @@ pub struct MutexArc<T> { priv x: UnsafeArc<MutexArcInner<T>> }
170167

171168
impl<T:Send> Clone for MutexArc<T> {
172169
/// Duplicate a mutex-protected Arc. See arc::clone for more details.
173-
#[inline]
174170
fn clone(&self) -> MutexArc<T> {
175171
// NB: Cloning the underlying mutex is not necessary. Its reference
176172
// count would be exactly the same as the shared state's.
@@ -353,7 +349,6 @@ pub struct RWArc<T> {
353349

354350
impl<T:Freeze + Send> Clone for RWArc<T> {
355351
/// Duplicate a rwlock-protected Arc. See arc::clone for more details.
356-
#[inline]
357352
fn clone(&self) -> RWArc<T> {
358353
RWArc { x: self.x.clone() }
359354
}

branches/dist-snap/src/librustc/middle/trans/base.rs

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -288,37 +288,6 @@ pub fn get_extern_const(externs: &mut ExternMap, llmod: ModuleRef,
288288
return c;
289289
}
290290
}
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-
}
322291

323292
// Returns a pointer to the body for the box. The box may be an opaque
324293
// 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 {
434403
assert!(heap != heap_exchange);
435404
malloc_general_dyn(bcx, t, heap, llsize_of(bcx.ccx(), ty))
436405
}
437-
pub fn malloc_boxed(bcx: @mut Block, t: ty::t)
438-
-> MallocResult {
439-
malloc_general(bcx, t, heap_managed)
440-
}
441406

442407
pub fn heap_for_unique(bcx: @mut Block, t: ty::t) -> heap {
443408
if ty::type_contents(bcx.tcx(), t).contains_managed() {
@@ -534,6 +499,12 @@ pub fn set_no_split_stack(f: ValueRef) {
534499
}
535500
}
536501

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+
537508
// Double-check that we never ask LLVM to declare the same symbol twice. It
538509
// silently mangles such symbols, breaking our linkage model.
539510
pub fn note_unique_llvm_symbol(ccx: &mut CrateContext, sym: @str) {

branches/dist-snap/src/librustc/middle/trans/glue.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ pub fn declare_generic_glue(ccx: &mut CrateContext, t: ty::t, llfnty: Type,
674674
debug!("{} is for type {}", fn_nm, ppaux::ty_to_str(ccx.tcx, t));
675675
note_unique_llvm_symbol(ccx, fn_nm);
676676
let llfn = decl_cdecl_fn(ccx.llmod, fn_nm, llfnty);
677+
set_glue_inlining(llfn, t);
677678
return llfn;
678679
}
679680

0 commit comments

Comments
 (0)