Skip to content

Commit f6c3c50

Browse files
committed
---
yaml --- r: 32569 b: refs/heads/dist-snap c: 34bf0b9 h: refs/heads/master i: 32567: e474e83 v: v3
1 parent 095cc99 commit f6c3c50

File tree

9 files changed

+725
-402
lines changed

9 files changed

+725
-402
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: ff54ac8e598bfc71e827c0b60e392c5f0fbd4d7e
10+
refs/heads/dist-snap: 34bf0b9e979e528f14e1265a36488d0707e71805
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/rustc/driver/session.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type config =
3838
uint_type: uint_ty,
3939
float_type: float_ty};
4040

41-
const ppregions: uint = 1 << 0;
41+
const verbose: uint = 1 << 0;
4242
const time_passes: uint = 1 << 1;
4343
const count_llvm_insns: uint = 1 << 2;
4444
const time_llvm_passes: uint = 1 << 3;
@@ -60,8 +60,7 @@ const meta_stats: uint = 1 << 16;
6060
const no_opt: uint = 1 << 17;
6161

6262
fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
63-
~[(~"ppregions", ~"prettyprint regions with \
64-
internal repr details", ppregions),
63+
~[(~"verbose", ~"in general, enable more debug printouts", verbose),
6564
(~"time-passes", ~"measure time of each rustc pass", time_passes),
6665
(~"count-llvm-insns", ~"count where LLVM \
6766
instrs originate", count_llvm_insns),
@@ -219,7 +218,7 @@ impl session {
219218
fn impossible_case(sp: span, msg: &str) -> ! {
220219
self.span_bug(sp, #fmt("Impossible case reached: %s", msg));
221220
}
222-
fn ppregions() -> bool { self.debugging_opt(ppregions) }
221+
fn verbose() -> bool { self.debugging_opt(verbose) }
223222
fn time_passes() -> bool { self.debugging_opt(time_passes) }
224223
fn count_llvm_insns() -> bool { self.debugging_opt(count_llvm_insns) }
225224
fn count_type_sizes() -> bool { self.debugging_opt(count_type_sizes) }

branches/dist-snap/src/rustc/middle/pat_util.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ use syntax::fold::*;
66
use syntax::codemap::span;
77
use std::map::HashMap;
88

9-
export pat_binding_ids, pat_bindings, pat_id_map;
10-
export pat_is_variant;
9+
export pat_binding_ids, pat_bindings, pat_id_map, PatIdMap;
10+
export pat_is_variant, pat_is_binding_or_wild;
1111

12-
type pat_id_map = std::map::HashMap<ident, node_id>;
12+
type PatIdMap = std::map::HashMap<ident, node_id>;
1313

1414
// This is used because same-named variables in alternative patterns need to
1515
// use the node_id of their namesake in the first pattern.
16-
fn pat_id_map(dm: resolve::DefMap, pat: @pat) -> pat_id_map {
16+
fn pat_id_map(dm: resolve::DefMap, pat: @pat) -> PatIdMap {
1717
let map = std::map::uint_hash();
1818
do pat_bindings(dm, pat) |_bm, p_id, _s, n| {
1919
map.insert(path_to_ident(n), p_id);
@@ -32,6 +32,14 @@ fn pat_is_variant(dm: resolve::DefMap, pat: @pat) -> bool {
3232
}
3333
}
3434

35+
fn pat_is_binding_or_wild(dm: resolve::DefMap, pat: @pat) -> bool {
36+
match pat.node {
37+
pat_ident(*) => !pat_is_variant(dm, pat),
38+
pat_wild => true,
39+
_ => false
40+
}
41+
}
42+
3543
fn pat_bindings(dm: resolve::DefMap, pat: @pat,
3644
it: fn(binding_mode, node_id, span, @path)) {
3745
do walk_pat(pat) |p| {

0 commit comments

Comments
 (0)