1995-08-09 08:06:35 -07:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Objective Caml *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
1999-11-17 10:59:06 -08:00
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
|
|
|
(* under the terms of the Q Public License version 1.0. *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
|
|
(* $Id$ *)
|
|
|
|
|
1995-06-15 01:17:29 -07:00
|
|
|
(* Transformation of Mach code into a list of pseudo-instructions. *)
|
|
|
|
|
|
|
|
type label = int
|
|
|
|
val new_label: unit -> label
|
|
|
|
|
|
|
|
type instruction =
|
1997-03-07 07:32:26 -08:00
|
|
|
{ mutable desc: instruction_desc;
|
1995-06-15 01:17:29 -07:00
|
|
|
next: instruction;
|
|
|
|
arg: Reg.t array;
|
|
|
|
res: Reg.t array;
|
|
|
|
live: Reg.Set.t }
|
|
|
|
|
|
|
|
and instruction_desc =
|
|
|
|
Lend
|
|
|
|
| Lop of Mach.operation
|
1995-08-25 01:46:03 -07:00
|
|
|
| Lreloadretaddr
|
1995-06-15 01:17:29 -07:00
|
|
|
| Lreturn
|
|
|
|
| Llabel of label
|
|
|
|
| Lbranch of label
|
|
|
|
| Lcondbranch of Mach.test * label
|
1995-08-12 07:26:23 -07:00
|
|
|
| Lcondbranch3 of label option * label option * label option
|
1995-06-15 01:17:29 -07:00
|
|
|
| Lswitch of label array
|
1995-07-07 05:07:07 -07:00
|
|
|
| Lsetuptrap of label
|
|
|
|
| Lpushtrap
|
1995-06-15 01:17:29 -07:00
|
|
|
| Lpoptrap
|
|
|
|
| Lraise
|
|
|
|
|
1995-08-13 02:31:50 -07:00
|
|
|
val end_instr: instruction
|
|
|
|
val instr_cons:
|
|
|
|
instruction_desc -> Reg.t array -> Reg.t array -> instruction -> instruction
|
|
|
|
|
1995-06-15 01:17:29 -07:00
|
|
|
type fundecl =
|
|
|
|
{ fun_name: string;
|
1995-07-02 09:41:48 -07:00
|
|
|
fun_body: instruction;
|
|
|
|
fun_fast: bool }
|
1995-06-15 01:17:29 -07:00
|
|
|
|
|
|
|
val fundecl: Mach.fundecl -> fundecl
|
|
|
|
|