Add -Zinput-stats
Emits loc, and node count - before and after expansion. E.g., ``` rustc: x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore Lines of code: 32060 Pre-expansion node count: 120205 Post-expansion node count: 482749 ```
This commit is contained in:
@@ -559,6 +559,10 @@ impl FileMap {
|
||||
pub fn is_imported(&self) -> bool {
|
||||
self.src.is_none()
|
||||
}
|
||||
|
||||
fn count_lines(&self) -> usize {
|
||||
self.lines.borrow().len()
|
||||
}
|
||||
}
|
||||
|
||||
/// An abstraction over the fs operations used by the Parser.
|
||||
@@ -1021,6 +1025,10 @@ impl CodeMap {
|
||||
debug!("span_allows_unstable? {}", allows_unstable);
|
||||
allows_unstable
|
||||
}
|
||||
|
||||
pub fn count_lines(&self) -> usize {
|
||||
self.files.borrow().iter().fold(0, |a, f| a + f.count_lines())
|
||||
}
|
||||
}
|
||||
|
||||
// _____________________________________________________________________________
|
||||
|
||||
Reference in New Issue
Block a user