Skip to content

Commit 6233dad

Browse files
committed
---
yaml --- r: 2027 b: refs/heads/master c: 32e62d0 h: refs/heads/master i: 2025: 779f4b5 2023: 64db226 v: v3
1 parent 5a6f591 commit 6233dad

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 973023030e7c0ca9814bc60f389bb8d75923edc7
2+
refs/heads/master: 32e62d01510c7b1c0dbd39f9ecc9fd997c2ff2b9

trunk/src/comp/driver/rustc.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ impure fn compile_input(session.session sess,
5959
str input, str output,
6060
bool shared,
6161
bool optimize,
62+
bool parse_only,
6263
vec[str] library_search_paths) {
6364
auto def = tup(0, 0);
6465
auto p = parser.new_parser(sess, env, def, input);
6566
auto crate = parse_input(sess, p, input);
67+
if (parse_only) {ret;}
6668
crate = creader.read_crates(sess, crate, library_search_paths);
6769
crate = resolve.resolve_crate(sess, crate);
6870
auto typeck_result = typeck.check_crate(sess, crate);
@@ -132,6 +134,7 @@ impure fn main(vec[str] args) {
132134
let bool shared = false;
133135
let bool pretty = false;
134136
let bool ls = false;
137+
let bool parse_only = false;
135138
let bool glue = false;
136139

137140
// FIXME: Maybe we should support -O0, -O1, -Os, etc
@@ -156,6 +159,8 @@ impure fn main(vec[str] args) {
156159
pretty = true;
157160
} else if (_str.eq(arg, "-ls")) {
158161
ls = true;
162+
} else if (_str.eq(arg, "-parse-only")) {
163+
parse_only = true;
159164
} else if (_str.eq(arg, "-o")) {
160165
if (i+1u < len) {
161166
output_file = some(args.(i+1u));
@@ -228,11 +233,13 @@ impure fn main(vec[str] args) {
228233
parts += vec(".bc");
229234
auto ofile = _str.concat(parts);
230235
compile_input(sess, env, ifile, ofile, shared,
231-
optimize, library_search_paths);
236+
optimize, parse_only,
237+
library_search_paths);
232238
}
233239
case (some[str](?ofile)) {
234240
compile_input(sess, env, ifile, ofile, shared,
235-
optimize, library_search_paths);
241+
optimize, parse_only,
242+
library_search_paths);
236243
}
237244
}
238245
}

0 commit comments

Comments
 (0)