File tree Expand file tree Collapse file tree 3 files changed +14
-10
lines changed
branches/dist-snap/src/librustc Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
- refs/heads/dist-snap: a1747a609122f6bc82f396897752d182fd583d4a
9
+ refs/heads/dist-snap: 25337a7f9fd824ca26faee47a4bc4aaa6e542586
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
12
12
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
Original file line number Diff line number Diff line change @@ -521,14 +521,18 @@ pub fn symbol_hash(tcx: ty::ctxt,
521
521
}
522
522
523
523
pub fn get_symbol_hash ( ccx : & mut CrateContext , t : ty:: t ) -> @str {
524
- match ccx. type_hashcodes . find ( & t) {
525
- Some ( & h) => h,
526
- None => {
527
- let hash = symbol_hash ( ccx. tcx , & mut ccx. symbol_hasher , t, & ccx. link_meta ) ;
528
- ccx. type_hashcodes . insert ( t, hash) ;
529
- hash
530
- }
524
+ {
525
+ let type_hashcodes = ccx. type_hashcodes . borrow ( ) ;
526
+ match type_hashcodes. get ( ) . find ( & t) {
527
+ Some ( & h) => return h,
528
+ None => { }
529
+ }
531
530
}
531
+
532
+ let mut type_hashcodes = ccx. type_hashcodes . borrow_mut ( ) ;
533
+ let hash = symbol_hash ( ccx. tcx , & mut ccx. symbol_hasher , t, & ccx. link_meta ) ;
534
+ type_hashcodes. get ( ) . insert ( t, hash) ;
535
+ hash
532
536
}
533
537
534
538
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ pub struct CrateContext {
96
96
llsizingtypes : RefCell < HashMap < ty:: t , Type > > ,
97
97
adt_reprs : RefCell < HashMap < ty:: t , @adt:: Repr > > ,
98
98
symbol_hasher : Sha256 ,
99
- type_hashcodes : HashMap < ty:: t , @str > ,
99
+ type_hashcodes : RefCell < HashMap < ty:: t , @str > > ,
100
100
type_short_names : HashMap < ty:: t , ~str > ,
101
101
all_llvm_symbols : HashSet < @str > ,
102
102
tcx : ty:: ctxt ,
@@ -207,7 +207,7 @@ impl CrateContext {
207
207
llsizingtypes : RefCell :: new ( HashMap :: new ( ) ) ,
208
208
adt_reprs : RefCell :: new ( HashMap :: new ( ) ) ,
209
209
symbol_hasher : symbol_hasher,
210
- type_hashcodes : HashMap :: new ( ) ,
210
+ type_hashcodes : RefCell :: new ( HashMap :: new ( ) ) ,
211
211
type_short_names : HashMap :: new ( ) ,
212
212
all_llvm_symbols : HashSet :: new ( ) ,
213
213
tcx : tcx,
You can’t perform that action at this time.
0 commit comments