diff options
| author | Patrick Walton <[email protected]> | 2010-09-07 16:35:00 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2010-09-07 16:35:21 -0700 |
| commit | ffdb5fc8582c77eef7b3a30859eaa216872525a4 (patch) | |
| tree | f43afee8d7fcbad87aac197bc774b11e440edfad /src/boot/driver/lib.ml | |
| parent | Add hashmap tests exercising strings as keys and values. No longer leaks on ... (diff) | |
| download | rust-ffdb5fc8582c77eef7b3a30859eaa216872525a4.tar.xz rust-ffdb5fc8582c77eef7b3a30859eaa216872525a4.zip | |
Initial support for a global crate metadata cache
Diffstat (limited to 'src/boot/driver/lib.ml')
| -rw-r--r-- | src/boot/driver/lib.ml | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/boot/driver/lib.ml b/src/boot/driver/lib.ml index 71b310b0..40d79256 100644 --- a/src/boot/driver/lib.ml +++ b/src/boot/driver/lib.ml @@ -59,7 +59,7 @@ let get_sects let get_meta (sess:Session.sess) (filename:filename) - : Ast.meta option = + : Session.meta option = htab_search_or_add meta_cache filename begin fun _ -> @@ -190,6 +190,10 @@ let get_mod match get_meta sess file with None -> () | Some meta -> + if not (Hashtbl.mem + sess.Session.sess_crate_meta meta) then + Hashtbl.add sess.Session.sess_crate_meta + meta (Session.make_crate_id sess); Array.iter (fun (k,v) -> log sess "%s = %S" k v) meta; |