Include file paths when dumping the list of resolved crates via debug!
.
This commit is contained in:
parent
eb6856c307
commit
acfc99dddd
@ -17,7 +17,7 @@ use back::svh::Svh;
|
||||
use driver::session::Session;
|
||||
use driver::{driver, config};
|
||||
use metadata::cstore;
|
||||
use metadata::cstore::CStore;
|
||||
use metadata::cstore::{CStore, CrateSource};
|
||||
use metadata::decoder;
|
||||
use metadata::loader;
|
||||
use metadata::loader::CratePaths;
|
||||
@ -68,10 +68,15 @@ impl<'a> visit::Visitor<()> for Env<'a> {
|
||||
|
||||
fn dump_crates(cstore: &CStore) {
|
||||
debug!("resolved crates:");
|
||||
cstore.iter_crate_data(|_, data| {
|
||||
cstore.iter_crate_data_origins(|_, data, opt_source| {
|
||||
debug!("crate_id: {}", data.crate_id());
|
||||
debug!(" cnum: {}", data.cnum);
|
||||
debug!(" hash: {}", data.hash());
|
||||
opt_source.map(|cs| {
|
||||
let CrateSource { dylib, rlib, cnum: _ } = cs;
|
||||
dylib.map(|dl| debug!(" dylib: {}", dl.display()));
|
||||
rlib.map(|rl| debug!(" rlib: {}", rl.display()));
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -114,6 +114,17 @@ impl CStore {
|
||||
}
|
||||
}
|
||||
|
||||
/// Like `iter_crate_data`, but passes source paths (if available) as well.
|
||||
pub fn iter_crate_data_origins(&self, i: |ast::CrateNum,
|
||||
&crate_metadata,
|
||||
Option<CrateSource>|) {
|
||||
for (&k, v) in self.metas.borrow().iter() {
|
||||
let origin = self.get_used_crate_source(k);
|
||||
origin.as_ref().map(|cs| { assert!(k == cs.cnum); });
|
||||
i(k, &**v, origin);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_used_crate_source(&self, src: CrateSource) {
|
||||
let mut used_crate_sources = self.used_crate_sources.borrow_mut();
|
||||
if !used_crate_sources.contains(&src) {
|
||||
|
Loading…
Reference in New Issue
Block a user