aboutsummaryrefslogtreecommitdiffstats
path: root/debug/DwarfUtil.ml
blob: 3841caa551a059a191c13ace4a37e83de244b90f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(* *********************************************************************)
(*                                                                     *)
(*              The Compcert verified compiler                         *)
(*                                                                     *)
(*          Bernhard Schommer, AbsInt Angewandte Informatik GmbH       *)
(*                                                                     *)
(*  AbsInt Angewandte Informatik GmbH. All rights reserved. This file  *)
(*  is distributed under the terms of the INRIA Non-Commercial         *)
(*  License Agreement.                                                 *)
(*                                                                     *)
(* *********************************************************************)

(* Utility functions for the dwarf debuging type *)

open DwarfTypes

let id = ref 0

let next_id () = 
  let nid = !id in
  incr id; nid

let new_entry tag =
  let id = next_id () in
  {
   tag = tag;
   children = [];
   id = id;
 }

let add_children entry child =
  {entry with children = child::entry.children;}