Skip to content

Add a flag to force generating toplevel crate map #10422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/librustc/driver/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ pub static no_vectorize_loops: uint = 1 << 26;
pub static no_vectorize_slp: uint = 1 << 27;
pub static no_prepopulate_passes: uint = 1 << 28;
pub static use_softfp: uint = 1 << 29;
pub static gen_crate_map: uint = 1 << 30;

pub fn debugging_opts_map() -> ~[(&'static str, &'static str, uint)] {
~[("verbose", "in general, enable more debug printouts", verbose),
Expand Down Expand Up @@ -128,6 +129,7 @@ pub fn debugging_opts_map() -> ~[(&'static str, &'static str, uint)] {
"Don't run LLVM's SLP vectorization passes",
no_vectorize_slp),
("soft-float", "Generate software floating point library calls", use_softfp),
("gen-crate-map", "Force generation of a toplevel crate map", gen_crate_map),
]
}

Expand Down Expand Up @@ -331,6 +333,9 @@ impl Session_ {
pub fn no_vectorize_slp(&self) -> bool {
self.debugging_opt(no_vectorize_slp)
}
pub fn gen_crate_map(&self) -> bool {
self.debugging_opt(gen_crate_map)
}

// pointless function, now...
pub fn str_of(&self, id: ast::Ident) -> @str {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2961,7 +2961,7 @@ pub fn decl_crate_map(sess: session::Session, mapmeta: LinkMeta,
let mut n_subcrates = 1;
let cstore = sess.cstore;
while cstore::have_crate_data(cstore, n_subcrates) { n_subcrates += 1; }
let mapname = if *sess.building_library {
let mapname = if *sess.building_library && !sess.gen_crate_map() {
format!("{}_{}_{}", mapmeta.name, mapmeta.vers, mapmeta.extras_hash)
} else {
~"toplevel"
Expand Down