aboutsummaryrefslogtreecommitdiffstats
path: root/backend/Duplicateaux.ml
blob: 9ff2ae55dd8ede4f890cd111fec643b20a3eb0cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
open RTL
open Maps

let rec make_identity_ptree_rec = function
| [] -> PTree.empty
| m::lm -> let (n, _) = m in PTree.set n n (make_identity_ptree_rec lm)

let make_identity_ptree f = make_identity_ptree_rec (PTree.elements (fn_code f))

(* For now, identity function *)
let duplicate_aux f =
  let pTreeId = make_identity_ptree f
  in (((fn_code f), (fn_entrypoint f)), pTreeId)