Skip to content

Commit 42102c3

Browse files
committed
---
yaml --- r: 94844 b: refs/heads/try c: cbe8c61 h: refs/heads/master v: v3
1 parent a75d53f commit 42102c3

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: a7a9e488a47ef9ca2f9cc9f73903b2ac3f54fc4c
5+
refs/heads/try: cbe8c61fed3ccff0a34a9ff79105ad5b7a7de5b3
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/driver/driver.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,14 @@ pub fn stop_after_phase_1(sess: Session) -> bool {
417417
return false;
418418
}
419419

420+
pub fn stop_after_phase_2(sess: Session) -> bool {
421+
if sess.opts.no_analysis {
422+
debug!("invoked with --no-analysis, returning early from compile_input");
423+
return true;
424+
}
425+
return false;
426+
}
427+
420428
pub fn stop_after_phase_5(sess: Session) -> bool {
421429
if sess.opts.output_type != link::output_type_exe {
422430
debug!("not building executable, returning early from compile_input");
@@ -482,6 +490,8 @@ pub fn compile_input(sess: Session, cfg: ast::CrateConfig, input: &input,
482490

483491
write_out_deps(sess, input, outputs, &expanded_crate);
484492

493+
if stop_after_phase_2(sess) { return; }
494+
485495
let analysis = phase_3_run_analysis_passes(sess, &expanded_crate);
486496
if stop_after_phase_3(sess) { return; }
487497
let trans = phase_4_translate_to_llvm(sess, expanded_crate,
@@ -697,6 +707,7 @@ pub fn build_session_options(binary: @str,
697707

698708
let parse_only = matches.opt_present("parse-only");
699709
let no_trans = matches.opt_present("no-trans");
710+
let no_analysis = matches.opt_present("no-analysis");
700711

701712
let lint_levels = [lint::allow, lint::warn,
702713
lint::deny, lint::forbid];
@@ -850,6 +861,7 @@ pub fn build_session_options(binary: @str,
850861
test: test,
851862
parse_only: parse_only,
852863
no_trans: no_trans,
864+
no_analysis: no_analysis,
853865
debugging_opts: debugging_opts,
854866
android_cross_path: android_cross_path,
855867
write_dependency_info: write_dependency_info,
@@ -943,6 +955,9 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
943955
optflag("", "ls", "List the symbols defined by a library crate"),
944956
optflag("", "no-trans",
945957
"Run all passes except translation; no output"),
958+
optflag("", "no-analysis",
959+
"Parse and expand the output, but run no analysis or produce \
960+
output"),
946961
optflag("O", "", "Equivalent to --opt-level=2"),
947962
optopt("o", "", "Write output to <filename>", "FILENAME"),
948963
optopt("", "opt-level",

branches/try/src/librustc/driver/session.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ pub struct options {
167167
test: bool,
168168
parse_only: bool,
169169
no_trans: bool,
170+
no_analysis: bool,
170171
debugging_opts: uint,
171172
android_cross_path: Option<~str>,
172173
/// Whether to write dependency files. It's (enabled, optional filename).
@@ -398,6 +399,7 @@ pub fn basic_options() -> @options {
398399
test: false,
399400
parse_only: false,
400401
no_trans: false,
402+
no_analysis: false,
401403
debugging_opts: 0u,
402404
android_cross_path: None,
403405
write_dependency_info: (false, None),

0 commit comments

Comments
 (0)