summaryrefslogtreecommitdiff
path: root/arm/Unusedglob1.ml
diff options
context:
space:
mode:
Diffstat (limited to 'arm/Unusedglob1.ml')
-rw-r--r--arm/Unusedglob1.ml32
1 files changed, 32 insertions, 0 deletions
diff --git a/arm/Unusedglob1.ml b/arm/Unusedglob1.ml
new file mode 100644
index 0000000..04ef89a
--- /dev/null
+++ b/arm/Unusedglob1.ml
@@ -0,0 +1,32 @@
+(* *********************************************************************)
+(* *)
+(* The Compcert verified compiler *)
+(* *)
+(* Xavier Leroy, INRIA Paris-Rocquencourt *)
+(* *)
+(* Copyright Institut National de Recherche en Informatique et en *)
+(* Automatique. All rights reserved. This file is distributed *)
+(* under the terms of the INRIA Non-Commercial License Agreement. *)
+(* *)
+(* *********************************************************************)
+
+(* Identifiers referenced from an ARM Asm instruction *)
+
+open Datatypes
+open AST
+open Asm
+
+let referenced_builtin ef =
+ match ef with
+ | EF_vload_global(chunk, id, ofs) -> [id]
+ | EF_vstore_global(chunk, id, ofs) -> [id]
+ | _ -> []
+
+let referenced_instr = function
+ | Pbsymb(s, _) -> [s]
+ | Pblsymb(s, _) -> [s]
+ | Ploadsymbol(_, s, _) -> [s]
+ | Pbuiltin ef -> referenced_builtin ef
+ | _ -> []
+
+let code_of_function f = f.fn_code