aboutsummaryrefslogtreecommitdiffstats
path: root/backend/Duplicateaux.ml
blob: a64f4862777e121b4b4ac84fa229f3031e6bd01e (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 f.fn_code)

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