RegAlloc.Linear.StackMap

ghc-7.6.3: The GHC API

Safe Haskell | None

RegAlloc.Linear.StackMap

Description

The assignment of virtual registers to stack slots

Synopsis

- type StackSlot = Int
- data StackMap = StackMap {
  - stackMapFreeSlots :: [StackSlot]
  - stackMapAssignment :: UniqFM StackSlot
  }
- emptyStackMap :: Platform -> StackMap
- getStackSlotFor :: StackMap -> Unique -> (StackMap, Int)

# Documentation

type StackSlot = Int

Identifier for a stack slot.

data StackMap

Constructors

StackMap |
Fields stackMapFreeSlots :: [StackSlot] The slots that are still available to be allocated. stackMapAssignment :: UniqFM StackSlot Assignment of vregs to stack slots.

emptyStackMap :: Platform -> StackMap

An empty stack map, with all slots available.

getStackSlotFor :: StackMap -> Unique -> (StackMap, Int)

If this vreg unique already has a stack assignment then return the slot number, otherwise allocate a new slot, and update the map.