@@ -36,83 +36,84 @@ use syntax::ast;
3636use  syntax:: parse:: token:: InternedString ; 
3737
3838pub  struct  CrateContext  { 
39-      sess :  session:: Session , 
40-      llmod :  ModuleRef , 
41-      llcx :  ContextRef , 
42-      metadata_llmod :  ModuleRef , 
43-      td :  TargetData , 
44-      tn :  TypeNames , 
45-      externs :  RefCell < ExternMap > , 
46-      intrinsics :  HashMap < & ' static  str ,  ValueRef > , 
47-      item_vals :  RefCell < HashMap < ast:: NodeId ,  ValueRef > > , 
48-      exp_map2 :  resolve:: ExportMap2 , 
49-      reachable :  @RefCell < HashSet < ast:: NodeId > > , 
50-      item_symbols :  RefCell < HashMap < ast:: NodeId ,  ~str > > , 
51-      link_meta :  LinkMeta , 
52-      tydescs :  RefCell < HashMap < ty:: t ,  @tydesc_info > > , 
53-      // Set when running emit_tydescs to enforce that no more tydescs are 
54-      // created. 
55-      finished_tydescs :  Cell < bool > , 
56-      // Track mapping of external ids to local items imported for inlining 
57-      external :  RefCell < HashMap < ast:: DefId ,  Option < ast:: NodeId > > > , 
58-      // Backwards version of the `external` map (inlined items to where they 
59-      // came from) 
60-      external_srcs :  RefCell < HashMap < ast:: NodeId ,  ast:: DefId > > , 
61-      // A set of static items which cannot be inlined into other crates. This 
62-      // will pevent in IIItem() structures from being encoded into the metadata 
63-      // that is generated 
64-      non_inlineable_statics :  RefCell < HashSet < ast:: NodeId > > , 
65-      // Cache instances of monomorphized functions 
66-      monomorphized :  RefCell < HashMap < mono_id ,  ValueRef > > , 
67-      monomorphizing :  RefCell < HashMap < ast:: DefId ,  uint > > , 
68-      // Cache generated vtables 
69-      vtables :  RefCell < HashMap < ( ty:: t ,  mono_id ) ,  ValueRef > > , 
70-      // Cache of constant strings, 
71-      const_cstr_cache :  RefCell < HashMap < InternedString ,  ValueRef > > , 
39+     sess :  session:: Session , 
40+     llmod :  ModuleRef , 
41+     llcx :  ContextRef , 
42+     metadata_llmod :  ModuleRef , 
43+     td :  TargetData , 
44+     tn :  TypeNames , 
45+     externs :  RefCell < ExternMap > , 
46+     intrinsics :  HashMap < & ' static  str ,  ValueRef > , 
47+     item_vals :  RefCell < HashMap < ast:: NodeId ,  ValueRef > > , 
48+     exp_map2 :  resolve:: ExportMap2 , 
49+     reachable :  @RefCell < HashSet < ast:: NodeId > > , 
50+     item_symbols :  RefCell < HashMap < ast:: NodeId ,  ~str > > , 
51+     link_meta :  LinkMeta , 
52+     drop_glues :  RefCell < HashMap < ty:: t ,  ValueRef > > , 
53+     tydescs :  RefCell < HashMap < ty:: t ,  @tydesc_info > > , 
54+     // Set when running emit_tydescs to enforce that no more tydescs are 
55+     // created. 
56+     finished_tydescs :  Cell < bool > , 
57+     // Track mapping of external ids to local items imported for inlining 
58+     external :  RefCell < HashMap < ast:: DefId ,  Option < ast:: NodeId > > > , 
59+     // Backwards version of the `external` map (inlined items to where they 
60+     // came from) 
61+     external_srcs :  RefCell < HashMap < ast:: NodeId ,  ast:: DefId > > , 
62+     // A set of static items which cannot be inlined into other crates. This 
63+     // will pevent in IIItem() structures from being encoded into the metadata 
64+     // that is generated 
65+     non_inlineable_statics :  RefCell < HashSet < ast:: NodeId > > , 
66+     // Cache instances of monomorphized functions 
67+     monomorphized :  RefCell < HashMap < mono_id ,  ValueRef > > , 
68+     monomorphizing :  RefCell < HashMap < ast:: DefId ,  uint > > , 
69+     // Cache generated vtables 
70+     vtables :  RefCell < HashMap < ( ty:: t ,  mono_id ) ,  ValueRef > > , 
71+     // Cache of constant strings, 
72+     const_cstr_cache :  RefCell < HashMap < InternedString ,  ValueRef > > , 
7273
73-       // Reverse-direction for const ptrs cast from globals. 
74-       // Key is an int, cast from a ValueRef holding a *T, 
75-       // Val is a ValueRef holding a *[T]. 
76-       // 
77-       // Needed because LLVM loses pointer->pointee association 
78-       // when we ptrcast, and we have to ptrcast during translation 
79-       // of a [T] const because we form a slice, a [*T,int] pair, not 
80-       // a pointer to an LLVM array type. 
81-       const_globals :  RefCell < HashMap < int ,  ValueRef > > , 
74+     // Reverse-direction for const ptrs cast from globals. 
75+     // Key is an int, cast from a ValueRef holding a *T, 
76+     // Val is a ValueRef holding a *[T]. 
77+     // 
78+     // Needed because LLVM loses pointer->pointee association 
79+     // when we ptrcast, and we have to ptrcast during translation 
80+     // of a [T] const because we form a slice, a [*T,int] pair, not 
81+     // a pointer to an LLVM array type. 
82+     const_globals :  RefCell < HashMap < int ,  ValueRef > > , 
8283
83-       // Cache of emitted const values 
84-       const_values :  RefCell < HashMap < ast:: NodeId ,  ValueRef > > , 
84+     // Cache of emitted const values 
85+     const_values :  RefCell < HashMap < ast:: NodeId ,  ValueRef > > , 
8586
86-       // Cache of external const values 
87-       extern_const_values :  RefCell < HashMap < ast:: DefId ,  ValueRef > > , 
87+     // Cache of external const values 
88+     extern_const_values :  RefCell < HashMap < ast:: DefId ,  ValueRef > > , 
8889
89-       impl_method_cache :  RefCell < HashMap < ( ast:: DefId ,  ast:: Name ) ,  ast:: DefId > > , 
90+     impl_method_cache :  RefCell < HashMap < ( ast:: DefId ,  ast:: Name ) ,  ast:: DefId > > , 
9091
91-       // Cache of closure wrappers for bare fn's. 
92-       closure_bare_wrapper_cache :  RefCell < HashMap < ValueRef ,  ValueRef > > , 
92+     // Cache of closure wrappers for bare fn's. 
93+     closure_bare_wrapper_cache :  RefCell < HashMap < ValueRef ,  ValueRef > > , 
9394
94-       module_data :  RefCell < HashMap < ~str ,  ValueRef > > , 
95-       lltypes :  RefCell < HashMap < ty:: t ,  Type > > , 
96-       llsizingtypes :  RefCell < HashMap < ty:: t ,  Type > > , 
97-       adt_reprs :  RefCell < HashMap < ty:: t ,  @adt:: Repr > > , 
98-       symbol_hasher :  RefCell < Sha256 > , 
99-       type_hashcodes :  RefCell < HashMap < ty:: t ,  ~str > > , 
100-       all_llvm_symbols :  RefCell < HashSet < ~str > > , 
101-       tcx :  ty:: ctxt , 
102-       maps :  astencode:: Maps , 
103-       stats :  @Stats , 
104-       tydesc_type :  Type , 
105-       int_type :  Type , 
106-       opaque_vec_type :  Type , 
107-       builder :  BuilderRef_res , 
108-       crate_map :  ValueRef , 
109-       crate_map_name :  ~str , 
110-       // Set when at least one function uses GC. Needed so that 
111-       // decl_gc_metadata knows whether to link to the module metadata, which 
112-       // is not emitted by LLVM's GC pass when no functions use GC. 
113-       uses_gc :  bool , 
114-       dbg_cx :  Option < debuginfo:: CrateDebugContext > , 
115-       do_not_commit_warning_issued :  Cell < bool > , 
95+     module_data :  RefCell < HashMap < ~str ,  ValueRef > > , 
96+     lltypes :  RefCell < HashMap < ty:: t ,  Type > > , 
97+     llsizingtypes :  RefCell < HashMap < ty:: t ,  Type > > , 
98+     adt_reprs :  RefCell < HashMap < ty:: t ,  @adt:: Repr > > , 
99+     symbol_hasher :  RefCell < Sha256 > , 
100+     type_hashcodes :  RefCell < HashMap < ty:: t ,  ~str > > , 
101+     all_llvm_symbols :  RefCell < HashSet < ~str > > , 
102+     tcx :  ty:: ctxt , 
103+     maps :  astencode:: Maps , 
104+     stats :  @Stats , 
105+     tydesc_type :  Type , 
106+     int_type :  Type , 
107+     opaque_vec_type :  Type , 
108+     builder :  BuilderRef_res , 
109+     crate_map :  ValueRef , 
110+     crate_map_name :  ~str , 
111+     // Set when at least one function uses GC. Needed so that 
112+     // decl_gc_metadata knows whether to link to the module metadata, which 
113+     // is not emitted by LLVM's GC pass when no functions use GC. 
114+     uses_gc :  bool , 
115+     dbg_cx :  Option < debuginfo:: CrateDebugContext > , 
116+     do_not_commit_warning_issued :  Cell < bool > , 
116117} 
117118
118119impl  CrateContext  { 
@@ -175,64 +176,65 @@ impl CrateContext {
175176            } 
176177
177178            CrateContext  { 
178-                   sess :  sess, 
179-                   llmod :  llmod, 
180-                   llcx :  llcx, 
181-                   metadata_llmod :  metadata_llmod, 
182-                   td :  td, 
183-                   tn :  tn, 
184-                   externs :  RefCell :: new ( HashMap :: new ( ) ) , 
185-                   intrinsics :  intrinsics, 
186-                   item_vals :  RefCell :: new ( HashMap :: new ( ) ) , 
187-                   exp_map2 :  emap2, 
188-                   reachable :  reachable, 
189-                   item_symbols :  RefCell :: new ( HashMap :: new ( ) ) , 
190-                   link_meta :  link_meta, 
191-                   tydescs :  RefCell :: new ( HashMap :: new ( ) ) , 
192-                   finished_tydescs :  Cell :: new ( false ) , 
193-                   external :  RefCell :: new ( HashMap :: new ( ) ) , 
194-                   external_srcs :  RefCell :: new ( HashMap :: new ( ) ) , 
195-                   non_inlineable_statics :  RefCell :: new ( HashSet :: new ( ) ) , 
196-                   monomorphized :  RefCell :: new ( HashMap :: new ( ) ) , 
197-                   monomorphizing :  RefCell :: new ( HashMap :: new ( ) ) , 
198-                   vtables :  RefCell :: new ( HashMap :: new ( ) ) , 
199-                   const_cstr_cache :  RefCell :: new ( HashMap :: new ( ) ) , 
200-                   const_globals :  RefCell :: new ( HashMap :: new ( ) ) , 
201-                   const_values :  RefCell :: new ( HashMap :: new ( ) ) , 
202-                   extern_const_values :  RefCell :: new ( HashMap :: new ( ) ) , 
203-                   impl_method_cache :  RefCell :: new ( HashMap :: new ( ) ) , 
204-                   closure_bare_wrapper_cache :  RefCell :: new ( HashMap :: new ( ) ) , 
205-                   module_data :  RefCell :: new ( HashMap :: new ( ) ) , 
206-                   lltypes :  RefCell :: new ( HashMap :: new ( ) ) , 
207-                   llsizingtypes :  RefCell :: new ( HashMap :: new ( ) ) , 
208-                   adt_reprs :  RefCell :: new ( HashMap :: new ( ) ) , 
209-                   symbol_hasher :  RefCell :: new ( symbol_hasher) , 
210-                   type_hashcodes :  RefCell :: new ( HashMap :: new ( ) ) , 
211-                   all_llvm_symbols :  RefCell :: new ( HashSet :: new ( ) ) , 
212-                   tcx :  tcx, 
213-                   maps :  maps, 
214-                   stats :  @Stats  { 
215-                     n_static_tydescs :  Cell :: new ( 0 u) , 
216-                     n_glues_created :  Cell :: new ( 0 u) , 
217-                     n_null_glues :  Cell :: new ( 0 u) , 
218-                     n_real_glues :  Cell :: new ( 0 u) , 
219-                     n_fns :  Cell :: new ( 0 u) , 
220-                     n_monos :  Cell :: new ( 0 u) , 
221-                     n_inlines :  Cell :: new ( 0 u) , 
222-                     n_closures :  Cell :: new ( 0 u) , 
223-                     n_llvm_insns :  Cell :: new ( 0 u) , 
224-                     llvm_insns :  RefCell :: new ( HashMap :: new ( ) ) , 
225-                     fn_stats :  RefCell :: new ( ~[ ] ) , 
226-                   } , 
227-                   tydesc_type :  tydesc_type, 
228-                   int_type :  int_type, 
229-                   opaque_vec_type :  opaque_vec_type, 
230-                   builder :  BuilderRef_res ( llvm:: LLVMCreateBuilderInContext ( llcx) ) , 
231-                   crate_map :  crate_map, 
232-                   crate_map_name :  crate_map_name, 
233-                   uses_gc :  false , 
234-                   dbg_cx :  dbg_cx, 
235-                   do_not_commit_warning_issued :  Cell :: new ( false ) , 
179+                  sess :  sess, 
180+                  llmod :  llmod, 
181+                  llcx :  llcx, 
182+                  metadata_llmod :  metadata_llmod, 
183+                  td :  td, 
184+                  tn :  tn, 
185+                  externs :  RefCell :: new ( HashMap :: new ( ) ) , 
186+                  intrinsics :  intrinsics, 
187+                  item_vals :  RefCell :: new ( HashMap :: new ( ) ) , 
188+                  exp_map2 :  emap2, 
189+                  reachable :  reachable, 
190+                  item_symbols :  RefCell :: new ( HashMap :: new ( ) ) , 
191+                  link_meta :  link_meta, 
192+                  drop_glues :  RefCell :: new ( HashMap :: new ( ) ) , 
193+                  tydescs :  RefCell :: new ( HashMap :: new ( ) ) , 
194+                  finished_tydescs :  Cell :: new ( false ) , 
195+                  external :  RefCell :: new ( HashMap :: new ( ) ) , 
196+                  external_srcs :  RefCell :: new ( HashMap :: new ( ) ) , 
197+                  non_inlineable_statics :  RefCell :: new ( HashSet :: new ( ) ) , 
198+                  monomorphized :  RefCell :: new ( HashMap :: new ( ) ) , 
199+                  monomorphizing :  RefCell :: new ( HashMap :: new ( ) ) , 
200+                  vtables :  RefCell :: new ( HashMap :: new ( ) ) , 
201+                  const_cstr_cache :  RefCell :: new ( HashMap :: new ( ) ) , 
202+                  const_globals :  RefCell :: new ( HashMap :: new ( ) ) , 
203+                  const_values :  RefCell :: new ( HashMap :: new ( ) ) , 
204+                  extern_const_values :  RefCell :: new ( HashMap :: new ( ) ) , 
205+                  impl_method_cache :  RefCell :: new ( HashMap :: new ( ) ) , 
206+                  closure_bare_wrapper_cache :  RefCell :: new ( HashMap :: new ( ) ) , 
207+                  module_data :  RefCell :: new ( HashMap :: new ( ) ) , 
208+                  lltypes :  RefCell :: new ( HashMap :: new ( ) ) , 
209+                  llsizingtypes :  RefCell :: new ( HashMap :: new ( ) ) , 
210+                  adt_reprs :  RefCell :: new ( HashMap :: new ( ) ) , 
211+                  symbol_hasher :  RefCell :: new ( symbol_hasher) , 
212+                  type_hashcodes :  RefCell :: new ( HashMap :: new ( ) ) , 
213+                  all_llvm_symbols :  RefCell :: new ( HashSet :: new ( ) ) , 
214+                  tcx :  tcx, 
215+                  maps :  maps, 
216+                  stats :  @Stats  { 
217+                    n_static_tydescs :  Cell :: new ( 0 u) , 
218+                    n_glues_created :  Cell :: new ( 0 u) , 
219+                    n_null_glues :  Cell :: new ( 0 u) , 
220+                    n_real_glues :  Cell :: new ( 0 u) , 
221+                    n_fns :  Cell :: new ( 0 u) , 
222+                    n_monos :  Cell :: new ( 0 u) , 
223+                    n_inlines :  Cell :: new ( 0 u) , 
224+                    n_closures :  Cell :: new ( 0 u) , 
225+                    n_llvm_insns :  Cell :: new ( 0 u) , 
226+                    llvm_insns :  RefCell :: new ( HashMap :: new ( ) ) , 
227+                    fn_stats :  RefCell :: new ( ~[ ] ) , 
228+                  } , 
229+                  tydesc_type :  tydesc_type, 
230+                  int_type :  int_type, 
231+                  opaque_vec_type :  opaque_vec_type, 
232+                  builder :  BuilderRef_res ( llvm:: LLVMCreateBuilderInContext ( llcx) ) , 
233+                  crate_map :  crate_map, 
234+                  crate_map_name :  crate_map_name, 
235+                  uses_gc :  false , 
236+                  dbg_cx :  dbg_cx, 
237+                  do_not_commit_warning_issued :  Cell :: new ( false ) , 
236238            } 
237239        } 
238240    } 
0 commit comments