Skip to content

Commit 568f8b0

Browse files
committed
---
yaml --- r: 42361 b: refs/heads/master c: b894347 h: refs/heads/master i: 42359: 41d59a8 v: v3
1 parent 088f221 commit 568f8b0

File tree

5 files changed

+86
-84
lines changed

5 files changed

+86
-84
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: 42727658304b04babff6dd384637398c17331bbe
2+
refs/heads/master: b8943474dc4313c432ed791cebe9b76f89b0ad84
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
55
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650

trunk/src/librustc/driver/driver.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,6 @@ pub fn build_session_options(+binary: ~str,
521521
} else {
522522
session::unknown_crate
523523
};
524-
let static = opt_present(matches, ~"static");
525-
let gc = opt_present(matches, ~"gc");
526-
527524
let parse_only = opt_present(matches, ~"parse-only");
528525
let no_trans = opt_present(matches, ~"no-trans");
529526
@@ -570,7 +567,6 @@ pub fn build_session_options(+binary: ~str,
570567
}
571568
}
572569
573-
let jit = opt_present(matches, ~"jit");
574570
let output_type =
575571
if parse_only || no_trans {
576572
link::output_type_none
@@ -584,8 +580,6 @@ pub fn build_session_options(+binary: ~str,
584580
} else if opt_present(matches, ~"emit-llvm") {
585581
link::output_type_bitcode
586582
} else { link::output_type_exe };
587-
let extra_debuginfo = opt_present(matches, ~"xg");
588-
let debuginfo = opt_present(matches, ~"g") || extra_debuginfo;
589583
let sysroot_opt = getopts::opt_maybe_str(matches, ~"sysroot");
590584
let sysroot_opt = sysroot_opt.map(|m| Path(*m));
591585
let target_opt = getopts::opt_maybe_str(matches, ~"target");
@@ -616,6 +610,12 @@ pub fn build_session_options(+binary: ~str,
616610
}
617611
} else { No }
618612
};
613+
let gc = debugging_opts & session::gc != 0;
614+
let jit = debugging_opts & session::jit != 0;
615+
let extra_debuginfo = debugging_opts & session::extra_debug_info != 0;
616+
let debuginfo = debugging_opts & session::debug_info != 0 ||
617+
extra_debuginfo;
618+
let static = debugging_opts & session::static != 0;
619619
let target =
620620
match target_opt {
621621
None => host_triple(),
@@ -712,14 +712,11 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
712712
environment", ~"SPEC"),
713713
optflag(~"", ~"emit-llvm",
714714
~"Produce an LLVM bitcode file"),
715-
optflag(~"g", ~"", ~"Produce debug info (experimental)"),
716-
optflag(~"", ~"gc", ~"Garbage collect shared data (experimental)"),
717715
optflag(~"h", ~"help",~"Display this message"),
718716
optmulti(~"L", ~"", ~"Add a directory to the library search path",
719717
~"PATH"),
720718
optflag(~"", ~"lib", ~"Compile a library crate"),
721719
optflag(~"", ~"ls", ~"List the symbols defined by a library crate"),
722-
optflag(~"", ~"jit", ~"Execute using JIT (experimental)"),
723720
optflag(~"", ~"no-trans",
724721
~"Run all passes except translation; no output"),
725722
optflag(~"O", ~"", ~"Equivalent to --opt-level=2"),
@@ -739,13 +736,9 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
739736
or identified (fully parenthesized,
740737
AST nodes and blocks with IDs)", ~"TYPE"),
741738
optflag(~"S", ~"", ~"Compile only; do not assemble or link"),
742-
optflag(~"", ~"xg", ~"Extra debugging info (experimental)"),
743739
optflag(~"", ~"save-temps",
744740
~"Write intermediate files (.bc, .opt.bc, .o)
745741
in addition to normal output"),
746-
optflag(~"", ~"static",
747-
~"Use or produce static libraries or binaries
748-
(experimental)"),
749742
optopt(~"", ~"sysroot",
750743
~"Override the system root", ~"PATH"),
751744
optflag(~"", ~"test", ~"Build a test harness"),

trunk/src/librustc/driver/session.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ pub const count_type_sizes: uint = 1 << 14;
7575
pub const meta_stats: uint = 1 << 15;
7676
pub const no_opt: uint = 1 << 16;
7777
pub const no_monomorphic_collapse: uint = 1 << 17;
78+
const gc: uint = 1 << 18;
79+
const jit: uint = 1 << 19;
80+
const debug_info: uint = 1 << 20;
81+
const extra_debug_info: uint = 1 << 21;
82+
const static: uint = 1 << 22;
7883

7984
pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
8085
~[(~"verbose", ~"in general, enable more debug printouts", verbose),
@@ -102,6 +107,13 @@ pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
102107
(~"no-opt", ~"do not optimize, even if -O is passed", no_opt),
103108
(~"no-monomorphic-collapse", ~"do not collapse template instantiations",
104109
no_monomorphic_collapse),
110+
(~"gc", ~"Garbage collect shared data (experimental)", gc),
111+
(~"jit", ~"Execute using JIT (experimental)", jit),
112+
(~"extra-debug-info", ~"Extra debugging info (experimental)",
113+
extra_debug_info),
114+
(~"debug-info", ~"Produce debug info (experimental)", debug_info),
115+
(~"static", ~"Use or produce static libraries or binaries " +
116+
"(experimental)", static)
105117
]
106118
}
107119

trunk/src/libsyntax/ext/tt/transcribe.rs

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ type tt_frame = @{
3939
up: tt_frame_up,
4040
};
4141

42-
pub type tt_reader = @tt_reader_;
43-
pub type tt_reader_ = {
42+
pub type tt_reader = @{
4443
sp_diag: span_handler,
4544
interner: @ident_interner,
4645
mut cur: tt_frame,
@@ -88,7 +87,7 @@ pure fn dup_tt_frame(&&f: tt_frame) -> tt_frame {
8887
}
8988
}
9089

91-
pub pure fn dup_tt_reader(r: &tt_reader_) -> tt_reader {
90+
pub pure fn dup_tt_reader(&&r: tt_reader) -> tt_reader {
9291
@{sp_diag: r.sp_diag, interner: r.interner,
9392
mut cur: dup_tt_frame(r.cur),
9493
interpolations: r.interpolations,
@@ -97,7 +96,7 @@ pub pure fn dup_tt_reader(r: &tt_reader_) -> tt_reader {
9796
}
9897

9998

100-
pure fn lookup_cur_matched_by_matched(r: &tt_reader_,
99+
pure fn lookup_cur_matched_by_matched(r: tt_reader,
101100
start: @named_match) -> @named_match {
102101
pure fn red(+ad: @named_match, idx: &uint) -> @named_match {
103102
match *ad {
@@ -111,15 +110,15 @@ pure fn lookup_cur_matched_by_matched(r: &tt_reader_,
111110
vec::foldl(start, r.repeat_idx, red)
112111
}
113112

114-
fn lookup_cur_matched(r: &tt_reader_, name: ident) -> @named_match {
113+
fn lookup_cur_matched(r: tt_reader, name: ident) -> @named_match {
115114
lookup_cur_matched_by_matched(r, r.interpolations.get(&name))
116115
}
117116
enum lis {
118117
lis_unconstrained, lis_constraint(uint, ident), lis_contradiction(~str)
119118
}
120119

121-
fn lockstep_iter_size(t: token_tree, r: &tt_reader_) -> lis {
122-
fn lis_merge(lhs: lis, rhs: lis, r: &tt_reader_) -> lis {
120+
fn lockstep_iter_size(t: token_tree, r: tt_reader) -> lis {
121+
fn lis_merge(lhs: lis, rhs: lis, r: tt_reader) -> lis {
123122
match lhs {
124123
lis_unconstrained => rhs,
125124
lis_contradiction(_) => lhs,
@@ -151,7 +150,7 @@ fn lockstep_iter_size(t: token_tree, r: &tt_reader_) -> lis {
151150
}
152151

153152

154-
pub fn tt_next_token(r: &tt_reader_) -> TokenAndSpan {
153+
pub fn tt_next_token(&&r: tt_reader) -> TokenAndSpan {
155154
let ret_val = TokenAndSpan { tok: r.cur_tok, sp: r.cur_span };
156155
while r.cur.idx >= r.cur.readme.len() {
157156
/* done with this set; pop or repeat? */
@@ -200,26 +199,25 @@ pub fn tt_next_token(r: &tt_reader_) -> TokenAndSpan {
200199
return ret_val;
201200
}
202201
tt_seq(sp, ref tts, ref sep, zerok) => {
203-
match lockstep_iter_size(tt_seq(sp, (*tts), (*sep), zerok), r) {
204-
lis_unconstrained => {
205-
r.sp_diag.span_fatal(
202+
match lockstep_iter_size(tt_seq(sp, (*tts), (*sep), zerok), r) {
203+
lis_unconstrained => {
204+
r.sp_diag.span_fatal(
206205
sp, /* blame macro writer */
207-
~"attempted to repeat an expression \
208-
containing no syntax \
209-
variables matched as repeating at this depth");
210-
}
211-
lis_contradiction(ref msg) => {
212-
/* FIXME #2887 blame macro invoker instead*/
213-
r.sp_diag.span_fatal(sp, (*msg));
214-
}
215-
lis_constraint(len, _) => {
216-
if len == 0 {
217-
if !zerok {
206+
~"attempted to repeat an expression containing no syntax \
207+
variables matched as repeating at this depth");
208+
}
209+
lis_contradiction(ref msg) => {
210+
/* FIXME #2887 blame macro invoker instead*/
211+
r.sp_diag.span_fatal(sp, (*msg));
212+
}
213+
lis_constraint(len, _) => {
214+
if len == 0 {
215+
if !zerok {
218216
r.sp_diag.span_fatal(sp, /* FIXME #2887 blame invoker
219-
*/
217+
*/
220218
~"this must repeat at least \
221-
once");
222-
}
219+
once");
220+
}
223221

224222
r.cur.idx += 1u;
225223
return tt_next_token(r);

0 commit comments

Comments
 (0)