@@ -101,7 +101,7 @@ type metadata<T> = {node: ValueRef, data: T};
101
101
102
102
type file_md = { path: str } ;
103
103
type compile_unit_md = { path: str } ;
104
- type subprogram_md = { path : str } ;
104
+ type subprogram_md = { id : ast :: node_id } ;
105
105
type local_var_md = { id : ast:: node_id } ;
106
106
type tydesc_md = { hash : uint } ;
107
107
type block_md = { start : codemap:: loc , end : codemap:: loc } ;
@@ -225,39 +225,39 @@ fn line_from_span(cm: codemap::codemap, sp: span) -> uint {
225
225
}
226
226
227
227
fn create_block ( cx : @block_ctxt , sp : span ) -> @metadata < block_md > {
228
- let cache = get_cache ( bcx_ccx ( cx) ) ;
228
+ // let cache = get_cache(bcx_ccx(cx));
229
229
let start = codemap:: lookup_char_pos ( bcx_ccx ( cx) . sess . codemap ,
230
230
sp. lo ) ;
231
231
let fname = start. filename ;
232
232
let end = codemap:: lookup_char_pos ( bcx_ccx ( cx) . sess . codemap ,
233
233
sp. hi ) ;
234
234
let tg = LexicalBlockTag ;
235
- alt cached_metadata :: < @metadata < block_md > > (
235
+ /* alt cached_metadata::<@metadata<block_md>>(
236
236
cache, tg,
237
237
{|md| start == md.data.start && end == md.data.end}) {
238
238
option::some(md) { ret md; }
239
239
option::none {}
240
- }
240
+ }*/
241
241
242
242
let parent = alt cx. parent {
243
243
parent_none { create_function( cx. fcx , sp) . node }
244
- parent_some ( bcx) { create_block ( cx , sp) . node }
244
+ parent_some ( bcx) { create_block ( bcx , sp) . node }
245
245
} ;
246
246
let file_node = create_file ( bcx_ccx ( cx) , fname) ;
247
- let unique_id = alt cache. find ( LexicalBlockTag ) {
247
+ /* let unique_id = alt cache.find(LexicalBlockTag) {
248
248
option::some(v) { vec::len(v) as int }
249
249
option::none { 0 }
250
- } ;
250
+ };*/
251
251
let lldata = [ lltag ( tg) ,
252
252
parent,
253
253
lli32 ( start. line as int ) ,
254
254
lli32 ( start. col as int ) ,
255
- file_node. node ,
256
- lli32 ( unique_id)
255
+ file_node. node /* ,
256
+ lli32(unique_id)*/
257
257
] ;
258
258
let val = llmdnode ( lldata) ;
259
259
let mdval = @{ node: val, data : { start : start, end : end} } ;
260
- update_cache ( cache, tg, block_metadata ( mdval) ) ;
260
+ // update_cache(cache, tg, block_metadata(mdval));
261
261
ret mdval;
262
262
}
263
263
@@ -721,7 +721,7 @@ fn create_function(fcx: @fn_ctxt, sp: span) -> @metadata<subprogram_md> {
721
721
#debug ( "~~" ) ;
722
722
log ( debug, fcx. id ) ;
723
723
724
- log ( debug, codemap:: span_to_str ( sp, cx. sess . codemap ) ) ;
724
+ // log(debug, codemap::span_to_str(sp, cx.sess.codemap));
725
725
726
726
let ( ident, ret_ty, id) = alt cx. ast_map . get ( fcx. id ) {
727
727
ast_map:: node_item ( item) {
@@ -754,15 +754,14 @@ fn create_function(fcx: @fn_ctxt, sp: span) -> @metadata<subprogram_md> {
754
754
log ( debug, ident) ;
755
755
log ( debug, id) ;
756
756
757
- let path = str:: connect ( fcx. lcx . path + [ ident] , "::" ) ;
758
-
759
- let cache = get_cache ( cx) ;
757
+ /*let cache = get_cache(cx);
760
758
alt cached_metadata::<@metadata<subprogram_md>>(
761
- cache, SubprogramTag , { |md| md. data . path == path &&
762
- /*md.data.path == ??*/ true } ) {
759
+ cache, SubprogramTag, {|md| md.data.id == id}) {
763
760
option::some(md) { ret md; }
764
761
option::none {}
765
- }
762
+ }*/
763
+
764
+ let path = str:: connect ( fcx. lcx . path + [ ident] , "::" ) ;
766
765
767
766
let loc = codemap:: lookup_char_pos ( cx. sess . codemap ,
768
767
sp. lo ) ;
@@ -805,7 +804,7 @@ fn create_function(fcx: @fn_ctxt, sp: span) -> @metadata<subprogram_md> {
805
804
] ;
806
805
let val = llmdnode ( fn_metadata) ;
807
806
add_named_metadata ( cx, "llvm.dbg.sp" , val) ;
808
- let mdval = @{ node: val, data : { path : path } } ;
809
- update_cache ( cache, SubprogramTag , subprogram_metadata ( mdval) ) ;
807
+ let mdval = @{ node: val, data : { id : id } } ;
808
+ // update_cache(cache, SubprogramTag, subprogram_metadata(mdval));
810
809
ret mdval;
811
810
}
0 commit comments