aboutsummaryrefslogtreecommitdiffstats
path: root/debug/Debug.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-09-18 16:42:05 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2015-09-18 16:42:05 +0200
commit31aceeb1be64d529432f35bbea16ebafc3a21df0 (patch)
treeacb6e197e6960405b450c9c9842fdf37e18a5b40 /debug/Debug.ml
parentc8a0b76c6b9c3eb004a7fccdd2ad15cc8615ef93 (diff)
downloadcompcert-kvx-31aceeb1be64d529432f35bbea16ebafc3a21df0.tar.gz
compcert-kvx-31aceeb1be64d529432f35bbea16ebafc3a21df0.zip
Started implementing the scope for the Debug Informations.
Scopes will be handled by a stack of all open scopes. This stack then can also be used to generate the debug directives to track the scopes through the rest of the passes.
Diffstat (limited to 'debug/Debug.ml')
-rw-r--r--debug/Debug.ml10
1 files changed, 10 insertions, 0 deletions
diff --git a/debug/Debug.ml b/debug/Debug.ml
index c45fd074..bf3892d2 100644
--- a/debug/Debug.ml
+++ b/debug/Debug.ml
@@ -30,6 +30,8 @@ type implem =
mutable add_fun_addr: atom -> (int * int) -> unit;
mutable generate_debug_info: unit -> dw_entry option;
mutable all_files_iter: (string -> unit) -> unit;
+ mutable insert_local_declaration: storage -> ident -> typ -> location -> unit;
+ mutable atom_local_variable: ident -> atom -> unit;
}
let implem =
@@ -44,6 +46,8 @@ let implem =
add_fun_addr = (fun _ _ -> ());
generate_debug_info = (fun _ -> None);
all_files_iter = (fun _ -> ());
+ insert_local_declaration = (fun _ _ _ _ -> ());
+ atom_local_variable = (fun _ _ -> ());
}
let init () =
@@ -58,6 +62,8 @@ let init () =
implem.add_fun_addr <- DebugInformation.add_fun_addr;
implem.generate_debug_info <- (fun () -> Some (Dwarfgen.gen_debug_info ()));
implem.all_files_iter <- (fun f -> DebugInformation.StringSet.iter f !DebugInformation.all_files);
+ implem.insert_local_declaration <- DebugInformation.insert_local_declaration;
+ implem.atom_local_variable <- DebugInformation.atom_local_variable;
end else begin
implem.init <- (fun _ -> ());
implem.atom_function <- (fun _ _ -> ());
@@ -69,6 +75,8 @@ let init () =
implem.add_fun_addr <- (fun _ _ -> ());
implem.generate_debug_info <- (fun _ -> None);
implem.all_files_iter <- (fun _ -> ());
+ implem.insert_local_declaration <- (fun _ _ _ _ -> ());
+ implem.atom_local_variable <- (fun _ _ -> ());
end
let init_compile_unit name = implem.init name
@@ -81,3 +89,5 @@ let insert_global_declaration env dec = implem.insert_global_declaration env dec
let add_fun_addr atom addr = implem.add_fun_addr atom addr
let generate_debug_info () = implem.generate_debug_info ()
let all_files_iter f = implem.all_files_iter f
+let insert_local_declaration sto id ty loc = implem.insert_local_declaration sto id ty loc
+let atom_local_variable id atom = implem.atom_local_variable id atom