Skip to content

Commit c8e596a

Browse files
committed
---
yaml --- r: 55737 b: refs/heads/master c: 70452e5 h: refs/heads/master i: 55735: f3f5ef5 v: v3
1 parent 2bfe83e commit c8e596a

File tree

10 files changed

+43
-23
lines changed

10 files changed

+43
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 0de3e7a23c0cd677a3f369ea1b65cd71f41dcda2
2+
refs/heads/master: 70452e5231d4101811b2ea6a2c4be4adc2b5460b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
55
refs/heads/try: 8eb2bab100b42f0ba751552d8eff00eb2134c55a

trunk/src/libcore/gc.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ pub mod rustrt {
7373
pub unsafe fn rust_gc_metadata() -> *Word;
7474

7575
pub unsafe fn rust_get_stack_segment() -> *StackSegment;
76-
pub unsafe fn rust_get_c_stack() -> *StackSegment;
7776
}
7877
}
7978

trunk/src/librustc/middle/trans/base.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,6 +2007,11 @@ pub fn trans_enum_variant(ccx: @CrateContext,
20072007
// XXX is there a better way to reconstruct the ty::t?
20082008
let repr = adt::represent_type(ccx, enum_ty);
20092009

2010+
debug!("trans_enum_variant: name=%s tps=%s repr=%? enum_ty=%s",
2011+
unsafe { str::raw::from_c_str(llvm::LLVMGetValueName(llfndecl)) },
2012+
~"[" + str::connect(ty_param_substs.map(|&t| ty_to_str(ccx.tcx, t)), ", ") + ~"]",
2013+
repr, ty_to_str(ccx.tcx, enum_ty));
2014+
20102015
adt::trans_start_init(bcx, repr, fcx.llretptr.get(), disr);
20112016
for vec::eachi(args) |i, va| {
20122017
let lldestptr = adt::trans_field_ptr(bcx,

trunk/src/librustc/middle/trans/common.rs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,10 +1311,35 @@ pub enum mono_param_id {
13111311
mono_any,
13121312
mono_repr(uint /* size */,
13131313
uint /* align */,
1314-
bool /* is_float */,
1314+
MonoDataClass,
13151315
datum::DatumMode),
13161316
}
13171317
1318+
#[deriving(Eq)]
1319+
pub enum MonoDataClass {
1320+
MonoBits, // Anything not treated differently from arbitrary integer data
1321+
MonoNonNull, // Non-null pointers (used for optional-pointer optimization)
1322+
// FIXME(#3547)---scalars and floats are
1323+
// treated differently in most ABIs. But we
1324+
// should be doing something more detailed
1325+
// here.
1326+
MonoFloat
1327+
}
1328+
1329+
pub fn mono_data_classify(t: ty::t) -> MonoDataClass {
1330+
match ty::get(t).sty {
1331+
ty::ty_float(_) => MonoFloat,
1332+
ty::ty_rptr(*) | ty::ty_uniq(*) |
1333+
ty::ty_box(*) | ty::ty_opaque_box(*) |
1334+
ty::ty_estr(ty::vstore_uniq) | ty::ty_evec(_, ty::vstore_uniq) |
1335+
ty::ty_estr(ty::vstore_box) | ty::ty_evec(_, ty::vstore_box) |
1336+
ty::ty_bare_fn(*) => MonoNonNull,
1337+
// Is that everything? Would closures or slices qualify?
1338+
_ => MonoBits
1339+
}
1340+
}
1341+
1342+
13181343
#[deriving(Eq)]
13191344
pub struct mono_id_ {
13201345
def: ast::def_id,
@@ -1338,6 +1363,12 @@ impl to_bytes::IterBytes for mono_param_id {
13381363
}
13391364
}
13401365
1366+
impl to_bytes::IterBytes for MonoDataClass {
1367+
fn iter_bytes(&self, lsb0: bool, f:to_bytes::Cb) {
1368+
(*self as u8).iter_bytes(lsb0, f)
1369+
}
1370+
}
1371+
13411372
impl to_bytes::IterBytes for mono_id_ {
13421373
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
13431374
to_bytes::iter_bytes_2(&self.def, &self.params, lsb0, f);

trunk/src/librustc/middle/trans/monomorphize.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -395,22 +395,14 @@ pub fn make_mono_id(ccx: @CrateContext,
395395
let size = machine::llbitsize_of_real(ccx, llty);
396396
let align = machine::llalign_of_pref(ccx, llty);
397397
let mode = datum::appropriate_mode(subst);
398-
399-
// FIXME(#3547)---scalars and floats are
400-
// treated differently in most ABIs. But we
401-
// should be doing something more detailed
402-
// here.
403-
let is_float = match ty::get(subst).sty {
404-
ty::ty_float(_) => true,
405-
_ => false
406-
};
398+
let data_class = mono_data_classify(subst);
407399

408400
// Special value for nil to prevent problems
409401
// with undef return pointers.
410402
if size <= 8u && ty::type_is_nil(subst) {
411-
mono_repr(0u, 0u, is_float, mode)
403+
mono_repr(0u, 0u, data_class, mode)
412404
} else {
413-
mono_repr(size, align, is_float, mode)
405+
mono_repr(size, align, data_class, mode)
414406
}
415407
} else {
416408
mono_precise(subst, None)

trunk/src/libstd/num/rational.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<T: Copy + Num + Ord>
5151
#[inline(always)]
5252
pub fn new(numer: T, denom: T) -> Ratio<T> {
5353
if denom == Zero::zero() {
54-
fail!(~"denominator == 0");
54+
fail!(~"quotient of 0");
5555
}
5656
let mut ret = Ratio::new_raw(numer, denom);
5757
ret.reduce();

trunk/src/llvm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit 56dd407f4f97a01b8df6554c569170d2fc276fcb
1+
Subproject commit 2e9f0d21fe321849a4759a01fc28eae82ef196d6

trunk/src/rt/rust_builtin.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -549,11 +549,6 @@ rust_get_stack_segment() {
549549
return rust_get_current_task()->stk;
550550
}
551551

552-
extern "C" CDECL stk_seg *
553-
rust_get_c_stack() {
554-
return rust_get_current_task()->get_c_stack();
555-
}
556-
557552
extern "C" CDECL void
558553
start_task(rust_task *target, fn_env_pair *f) {
559554
target->start(f->f, f->env, NULL);

trunk/src/rt/rust_task.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,6 @@ rust_task : public kernel_owned<rust_task>
374374
void call_on_c_stack(void *args, void *fn_ptr);
375375
void call_on_rust_stack(void *args, void *fn_ptr);
376376
bool have_c_stack() { return c_stack != NULL; }
377-
stk_seg *get_c_stack() { return c_stack; }
378377

379378
rust_task_state get_state() { return state; }
380379
rust_cond *get_cond() { return cond; }

trunk/src/rt/rustrt.def.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ rust_task_is_unwinding
4949
rust_get_task
5050
rust_try_get_task
5151
rust_get_stack_segment
52-
rust_get_c_stack
5352
rust_log_str
5453
start_task
5554
vec_reserve_shared_actual

0 commit comments

Comments
 (0)