~jojo/Carth

ref: dcafbbc6cd8f38a8fdbe3f7de3ef98fb96edaaaf Carth/src/Low.hs -rw-r--r-- 449 bytes
dcafbbc6JoJo Begin work on low level IR 3 months ago
                                                                                
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
module Low (module Low, Type(..)) where

import Monomorphic (Type(..))

type Block = ([Stmt], Terminator)

data Stmt
    = Do Instr
    | Let Name Instr

data Instr
    = Add Operand Operand
    | Mul Operand Operand

data Terminator
    = Ret Operand
    | Br Operand Label Label
    | Jmp Label

data Const
    = Int Int
    | F64 Double
    | Str Word

data Operand
    = Const Const
    | Local Type Name

type Name = String
type Label = String