aboutsummaryrefslogtreecommitdiffstats
path: root/debug/DebugInformation.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-12-03 14:21:39 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2015-12-03 14:21:39 +0100
commit0ba8c3f06308f8f6a75abe4130972d2cb32a9abe (patch)
tree26c4193fda00d6456c75edf52f76f543036f9972 /debug/DebugInformation.ml
parent05f604d7f6e5ca3a0b005ae7ae1073f2b9e83207 (diff)
downloadcompcert-kvx-0ba8c3f06308f8f6a75abe4130972d2cb32a9abe.tar.gz
compcert-kvx-0ba8c3f06308f8f6a75abe4130972d2cb32a9abe.zip
Fixed regression introduce by merge of PR#69.
Since the identifier of a function definition and of its declaration are equal we only should remove functions if the function iteself is removed. Bug 17724.
Diffstat (limited to 'debug/DebugInformation.ml')
-rw-r--r--debug/DebugInformation.ml10
1 files changed, 10 insertions, 0 deletions
diff --git a/debug/DebugInformation.ml b/debug/DebugInformation.ml
index ed00ea0d..be322a55 100644
--- a/debug/DebugInformation.ml
+++ b/debug/DebugInformation.ml
@@ -295,6 +295,16 @@ let gen_comp_typ sou id at =
let remove_unused id =
try
let id' = Hashtbl.find stamp_to_definition id.stamp in
+ let var = Hashtbl.find definitions id' in
+ match var with
+ | Function _ -> ()
+ | _ -> Hashtbl.remove definitions id';
+ Hashtbl.remove stamp_to_definition id.stamp
+ with Not_found -> ()
+
+let remove_unused_function id =
+ try
+ let id' = Hashtbl.find stamp_to_definition id.stamp in
Hashtbl.remove definitions id';
Hashtbl.remove stamp_to_definition id.stamp
with Not_found -> ()