- Timestamp:
- Oct 6, 2011, 6:31:27 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Deliverables/D2.2/8051-indexed-labels-branch/src/clight/clightAnnotator.ml
r1305 r1310 10 10 let cost_id_prefix = "_cost" 11 11 let cost_incr_prefix = "_cost_incr" 12 let loop_id_prefix = "_i" 12 13 13 14 … … 313 314 | Clight.Internal def -> 314 315 let max_depth = max_loop_index def.Clight.fn_body in 315 let indexes_defs = loop_indexes_defs l_ind max_depth in 316 let vars = loop_indexes_defs l_ind max_depth in 317 let vars = List.rev_append vars def.Clight.fn_vars in 316 318 let body = instrument_body l_ind cost_mapping cost_incr def.Clight.fn_body in 317 Clight.Internal { def with Clight.fn_body = body 319 Clight.Internal { def with Clight.fn_body = body; Clight.fn_vars = vars} 318 320 | Clight.External _ -> def 319 321 in … … 361 363 let cost_id = StringTools.Gen.fresh_prefix names cost_id_prefix in 362 364 let cost_decl = cost_decl cost_id in 365 366 (* Create a fresh loop index prefix *) 367 let names = StringTools.Set.add cost_id names in 368 let l_ind = StringTools.Gen.fresh_prefix names loop_id_prefix in 363 369 364 370 (* Define an increment function for the cost variable. *) … … 369 375 370 376 (* Instrument each function *) 371 let prog_funct = 372 List.map (instrument_funct cost_mapping cost_incr) p.Clight.prog_funct in 377 let prog_funct = p.Clight.prog_funct in 378 let prog_funct = 379 List.map (instrument_funct l_ind cost_mapping cost_incr) prog_funct in 373 380 374 381 (* Glue all this together. *)
Note: See TracChangeset
for help on using the changeset viewer.