diff options
| author | kennytm <kennytm@gmail.com> | 2017-12-22 02:50:51 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-22 02:50:51 +0800 |
| commit | 614e285fa944dda3e147bb2b3f0d706ff10f7e4f (patch) | |
| tree | 1371ed0f20eaeb6d5a4fa36e6bbd1bfd643ca835 /src/libsyntax | |
| parent | dc00aa4983fbfb9ff43f1e7360515eb7d3c284cb (diff) | |
| parent | 0258c6dacaa6e187ae9bf744fd3184e79f78f2ef (diff) | |
| download | rust-614e285fa944dda3e147bb2b3f0d706ff10f7e4f.tar.gz rust-614e285fa944dda3e147bb2b3f0d706ff10f7e4f.zip | |
Rollup merge of #46839 - michaelwoerister:faster-span-hashing-2, r=nikomatsakis
incr.comp.: Precompute small hash for filenames to save some work. For each span we hash the filename of the file it points to. Since filenames can be quite long, especially with absolute paths, this PR pre-computes a hash of the filename and we then only hash the hash. r? @nikomatsakis
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/codemap.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 2c91d60ce9d..e49a7117192 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -246,6 +246,7 @@ impl CodeMap { name_was_remapped: bool, crate_of_origin: u32, src_hash: u128, + name_hash: u128, source_len: usize, mut file_local_lines: Vec<BytePos>, mut file_local_multibyte_chars: Vec<MultiByteChar>, @@ -282,6 +283,7 @@ impl CodeMap { lines: RefCell::new(file_local_lines), multibyte_chars: RefCell::new(file_local_multibyte_chars), non_narrow_chars: RefCell::new(file_local_non_narrow_chars), + name_hash, }); files.push(filemap.clone()); |
