Module type Fang_frame.FRAME

type t

The state of a stack frame.

type handle

A handle to a value allocated in a frame.

type _ ir

An IR fragment.

val word_size : int

The size, in byte, of a machine word in this architecture.

val address : value ir

The address of a frame from inside the frame itself.

val make : string -> scope list -> t

Define a new frame with the given name and a list of frame parameter scopes.

val args : t -> int -> handle

The arguments provided to the frame by the caller.

val label : t -> label

The label corresponding to a frame.

val name : t -> string

The name of a frame.

val alloc : scope -> t -> handle * t

Allocate a value in the frame with the given scope.

val access : address:value ir -> handle -> value ir

access ~address h is the IR fragment for the frame value referred to by the handle given the address address of the frame in which the value was allocated.

val call_external : string -> value ir list -> value ir

Call the externally-defined function with the given name in an architecture-specific fashion.

val finalize : value ir -> t -> value ir * frame_ptr

Augment the body of a frame with necessary set-up and tear-down based on the current frame state.