Skip to content

Commit 2da9fd5

Browse files
committed
---
yaml --- r: 6640 b: refs/heads/master c: 54f72fb h: refs/heads/master v: v3
1 parent c0d2165 commit 2da9fd5

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
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: 4f1713185506c57527561fd61c7c42502ccd4cf0
2+
refs/heads/master: 54f72fbc10e3846214423d8734c15eebe0228575

trunk/src/comp/driver/rustc.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ fn compile_input(sess: session::session, cfg: ast::crate_cfg, input: str,
138138
time(time_passes, "parsing", bind parse_input(sess, cfg, input));
139139
if sess.get_opts().parse_only { ret; }
140140

141+
sess.set_building_library(crate);
142+
141143
crate =
142144
time(time_passes, "configuration",
143145
bind front::config::strip_unconfigured_items(crate));
@@ -492,7 +494,7 @@ fn build_session(sopts: @session::options) -> session::session {
492494
sopts.addl_lib_search_paths);
493495
ret session::session(target_cfg, sopts, cstore,
494496
@{cm: codemap::new_codemap(), mutable next_id: 0},
495-
none, 0u, filesearch);
497+
none, 0u, filesearch, false);
496498
}
497499

498500
fn parse_pretty(sess: session::session, &&name: str) -> pp_mode {

trunk/src/comp/driver/session.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ obj session(targ_cfg: @config,
5959
// For a library crate, this is always none
6060
mutable main_fn: option::t<node_id>,
6161
mutable err_count: uint,
62-
filesearch: filesearch::filesearch) {
62+
filesearch: filesearch::filesearch,
63+
mutable building_library: bool) {
6364
fn get_targ_cfg() -> @config { ret targ_cfg; }
6465
fn get_opts() -> @options { ret opts; }
6566
fn get_cstore() -> metadata::cstore::cstore { cstore }
@@ -118,7 +119,10 @@ obj session(targ_cfg: @config,
118119
fn set_main_id(d: node_id) { main_fn = some(d); }
119120
fn get_main_id() -> option::t<node_id> { main_fn }
120121
fn filesearch() -> filesearch::filesearch { filesearch }
121-
fn building_library() -> bool { opts.crate_type == lib_crate }
122+
fn building_library() -> bool { building_library }
123+
fn set_building_library(crate: @ast::crate) {
124+
building_library = session::building_library(opts.crate_type, crate);
125+
}
122126
}
123127

124128
fn building_library(req_crate_type: crate_type, crate: @ast::crate) -> bool {

0 commit comments

Comments
 (0)