Skip to content

Commit a70b0b4

Browse files
committed
---
yaml --- r: 95463 b: refs/heads/dist-snap c: cf844ab h: refs/heads/master i: 95461: a07871c 95459: 54e2f53 95455: e2af7ec v: v3
1 parent bbcd33d commit a70b0b4

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
@@ -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: 532ab94c4b5e1f111cbf75d4aa20c78a88759b2e
9+
refs/heads/dist-snap: cf844abced94b74913985c7cffb6bd0b9a9b3445
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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)) \

branches/dist-snap/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
}

branches/dist-snap/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

branches/dist-snap/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,

branches/dist-snap/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
}

branches/dist-snap/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)