summaryrefslogtreecommitdiff
path: root/arm/Unusedglob1.ml
blob: 33a9bf8d3ecd55a62e7a373f210af37edb8b8395 (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                         *)
(*                                                                     *)
(*          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