Skip to content

Commit dfdbd7d

Browse files
committed
---
yaml --- r: 82409 b: refs/heads/master c: cf844ab h: refs/heads/master i: 82407: ff68056 v: v3
1 parent c929954 commit dfdbd7d

File tree

7 files changed

+42
-41
lines changed

7 files changed

+42
-41
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: 532ab94c4b5e1f111cbf75d4aa20c78a88759b2e
2+
refs/heads/master: cf844abced94b74913985c7cffb6bd0b9a9b3445
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729

trunk/Makefile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ CSREQ$(1)_T_$(2)_H_$(3) = \
440440
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
441441
$$(HBIN$(1)_H_$(3))/rustpkg$$(X_$(3)) \
442442
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
443+
$$(HBIN$(1)_H_$(3))/rusti$$(X_$(3)) \
443444
$$(HLIB$(1)_H_$(3))/$(CFG_LIBRUSTPKG_$(3)) \
444445
$$(HLIB$(1)_H_$(3))/$(CFG_LIBRUSTDOC_$(3)) \
445446
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2)) \

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,7 +1917,7 @@ fn trans_match_inner(scope_cx: @mut Block,
19171917
Infallible
19181918
}
19191919
};
1920-
let lldiscr = discr_datum.to_ref_llval(bcx);
1920+
let lldiscr = discr_datum.to_zeroable_ref_llval(bcx);
19211921
compile_submatch(bcx, matches, [lldiscr], chk);
19221922

19231923
let mut arm_cxs = ~[];
@@ -1996,7 +1996,7 @@ pub fn store_local(bcx: @mut Block,
19961996
if bcx.sess().asm_comments() {
19971997
add_comment(bcx, "creating zeroable ref llval");
19981998
}
1999-
let llptr = init_datum.to_ref_llval(bcx);
1999+
let llptr = init_datum.to_zeroable_ref_llval(bcx);
20002000
return bind_irrefutable_pat(bcx, pat, llptr, BindLocal);
20012001
}
20022002
}

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

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -473,25 +473,38 @@ impl Datum {
473473
C_null(type_of::type_of(bcx.ccx(), self.ty).ptr_to())
474474
} else {
475475
let slot = alloc_ty(bcx, self.ty, "");
476-
// The store created here can be modified through a reference, for example:
477-
//
478-
// // free the old allocation, and change the pointer to a new allocation
479-
// fn foo(x: &mut ~u8) {
480-
// *x = ~5;
481-
// }
482-
//
483-
// foo(&mut ~5);
484476
Store(bcx, self.val, slot);
485-
// The old cleanup needs to be cancelled, in order for the destructor to observe
486-
// any changes made through the reference.
487-
self.cancel_clean(bcx);
488-
add_clean_temp_mem(bcx, slot, self.ty);
489477
slot
490478
}
491479
}
492480
}
493481
}
494482

483+
pub fn to_zeroable_ref_llval(&self, bcx: @mut Block) -> ValueRef {
484+
/*!
485+
* Returns a by-ref llvalue that can be zeroed in order to
486+
* cancel cleanup. This is a kind of hokey bridge used
487+
* to adapt to the match code. Please don't use it for new code.
488+
*/
489+
490+
match self.mode {
491+
// All by-ref datums are zeroable, even if we *could* just
492+
// cancel the cleanup.
493+
ByRef(_) => self.val,
494+
495+
// By value datums can't be zeroed (where would you store
496+
// the zero?) so we have to spill them. Add a temp cleanup
497+
// for this spilled value and cancel the cleanup on this
498+
// current value.
499+
ByValue => {
500+
let slot = self.to_ref_llval(bcx);
501+
self.cancel_clean(bcx);
502+
add_clean_temp_mem(bcx, slot, self.ty);
503+
slot
504+
}
505+
}
506+
}
507+
495508
pub fn appropriate_mode(&self, ccx: &mut CrateContext) -> DatumMode {
496509
/*! See the `appropriate_mode()` function */
497510

trunk/src/librustdoc/html/format.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,7 @@ impl fmt::Default for clean::Path {
115115
fn resolved_path(w: &mut io::Writer, id: ast::NodeId, p: &clean::Path,
116116
print_all: bool) {
117117
path(w, p, print_all,
118-
|_cache, loc| {
119-
match p.segments[0].name.as_slice() {
120-
"super" => Some("../".repeat(loc.len() - 1)),
121-
_ => Some("../".repeat(loc.len())),
122-
}
123-
},
118+
|_cache, loc| { Some("../".repeat(loc.len())) },
124119
|cache| {
125120
match cache.paths.find(&id) {
126121
None => None,

trunk/src/librustdoc/html/render.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ use std::rt::io::file::{FileInfo, DirectoryInfo};
4444
use std::rt::io::file;
4545
use std::rt::io;
4646
use std::rt::io::Reader;
47+
use std::os;
4748
use std::str;
4849
use std::task;
4950
use std::unstable::finally::Finally;
@@ -686,7 +687,15 @@ impl Context {
686687
Process(Context, clean::Item),
687688
}
688689
enum Progress { JobNew, JobDone }
689-
static WORKERS: int = 10;
690+
691+
let workers = match os::getenv("RUSTDOC_WORKERS") {
692+
Some(s) => {
693+
match from_str::<uint>(s) {
694+
Some(n) => n, None => fail2!("{} not a number", s)
695+
}
696+
}
697+
None => 10,
698+
};
690699

691700
let mut item = match crate.module.take() {
692701
Some(i) => i,
@@ -706,7 +715,7 @@ impl Context {
706715
// using the same channel/port. Through this, the crate is recursed on
707716
// in a hierarchical fashion, and parallelization is only achieved if
708717
// one node in the hierarchy has more than one child (very common).
709-
for i in range(0, WORKERS) {
718+
for i in range(0, workers) {
710719
let port = port.clone();
711720
let chan = chan.clone();
712721
let prog_chan = prog_chan.clone();
@@ -761,7 +770,7 @@ impl Context {
761770
if jobs == 0 { break }
762771
}
763772

764-
for _ in range(0, WORKERS) {
773+
for _ in range(0, workers) {
765774
chan.send(Die);
766775
}
767776
}

trunk/src/test/run-pass/cancel-clean-via-immediate-rvalue-ref.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)