aboutsummaryrefslogtreecommitdiffstats
path: root/debug/DebugInformation.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-10-12 19:09:42 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2015-10-12 19:09:42 +0200
commit3b0bbd7a60771265ff81cc98310d413130ae4d79 (patch)
tree7a77101325f2eb2c5a97488df0c44da218e40ddf /debug/DebugInformation.ml
parent9873f9ee01c6ccca88fd461d318e107ff303fe88 (diff)
downloadcompcert-kvx-3b0bbd7a60771265ff81cc98310d413130ae4d79.tar.gz
compcert-kvx-3b0bbd7a60771265ff81cc98310d413130ae4d79.zip
Changed definition of implem for debug information.
Instead of making each filed mutuable we use a reference to a record of type implem. Now only the default implementation and the default debug information need to be upated to add a new function. Bug 17392.
Diffstat (limited to 'debug/DebugInformation.ml')
-rw-r--r--debug/DebugInformation.ml16
1 files changed, 1 insertions, 15 deletions
diff --git a/debug/DebugInformation.ml b/debug/DebugInformation.ml
index 96355d66..0f9c8ff3 100644
--- a/debug/DebugInformation.ml
+++ b/debug/DebugInformation.ml
@@ -60,7 +60,7 @@ let typ_to_string (ty: typ) =
Buffer.contents buf
(* Helper functions for the attributes *)
-let strip_attributes typ = strip_attributes_type typ [AConst;AVolatile]
+let strip_attributes typ = strip_attributes_type typ [AConst; AVolatile]
(* Does the type already exist? *)
let exist_type (ty: typ) =
@@ -536,20 +536,11 @@ let label_translation: (atom * positive, int) Hashtbl.t = Hashtbl.create 7
let add_label atom p i =
Hashtbl.add label_translation (atom,p) i
-(* Auxiliary data structures and functions *)
-module IntSet = Set.Make(struct
- type t = int
- let compare (x:int) (y:int) = compare x y
-end)
-
-let open_scopes: IntSet.t ref = ref IntSet.empty
-
let open_scope atom s_id lbl =
try
let s_id = Hashtbl.find atom_to_scope (atom,s_id) in
let old_r = try Hashtbl.find scope_ranges s_id with Not_found -> [] in
let n_scop = { start_addr = Some lbl; end_addr = None;} in
- open_scopes := IntSet.add s_id !open_scopes;
Hashtbl.replace scope_ranges s_id (n_scop::old_r)
with Not_found -> ()
@@ -564,7 +555,6 @@ let close_scope atom s_id lbl =
| _ -> assert false (* We must have an opening scope *)
end in
let new_r = ({last_r with end_addr = Some lbl;})::rest in
- open_scopes := IntSet.remove s_id !open_scopes;
Hashtbl.replace scope_ranges s_id new_r
with Not_found -> ()
@@ -590,10 +580,6 @@ let end_live_range (f,v) lbl =
let stack_variable (f,v) (sp,loc) =
Hashtbl.add var_locations (f,v) (FunctionLoc (sp,loc))
-let function_end atom loc =
- IntSet.iter (fun id -> close_scope atom id loc) !open_scopes;
- open_scopes := IntSet.empty
-
let compilation_section_start: (string,int) Hashtbl.t = Hashtbl.create 7
let compilation_section_end: (string,int) Hashtbl.t = Hashtbl.create 7