backend.sig 945 Bytes
signature MACHINE_INSTR = sig
  type t

  val use : t -> Temp.t list
  val def : t -> Temp.t list
  val jumps : t -> Label.t list
  val isFallThrough : t -> bool
  val isMoveBetweenTemps : t -> (Temp.t * Temp.t) option
  val isAssignmentToTemp : t -> Temp.t option
  val isLabel : t -> Label.t option
  val renameInstr : t -> (Temp.t -> Temp.t) -> t
end

signature MACHINE_FUN = sig
  type t

  structure I : MACHINE_INSTR

  val machineFunctionName : t -> string
  val machineFunctionBody : t -> I.t list
  val machineFunctionRename : t -> (Temp.t -> Temp.t) -> t
  val machineFunctionSpill : t -> Temp.t list -> t
end

signature MACHINE_PRG = sig
  type t

  structure F : MACHINE_FUN

  val machinePrgFunctions : t -> F.t list
  val replaceFunctions: t -> F.t list -> t
end

signature CODEGEN = sig

  structure P : MACHINE_PRG

  val codeGen : Tree.prg -> P.t
  val allRegisters : Temp.t list
  val generalPurposeRegisters : Temp.t list
end