summaryrefslogtreecommitdiff
path: root/Intermediate.hs
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2019-11-21 20:45:27 +0100
committerTom Smeding <tom.smeding@gmail.com>2019-11-21 20:55:13 +0100
commitcf7b7db0e4040c17e05f851fd0e9d79bc173aafd (patch)
treee4ce52409bf1217fcc40d4701af249a90641916a /Intermediate.hs
parent141b46dc4273cdbccf34f449109ec9df7f01705b (diff)
Tail call optimisation
Diffstat (limited to 'Intermediate.hs')
-rw-r--r--Intermediate.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/Intermediate.hs b/Intermediate.hs
index 0e181a4..95f6cc7 100644
--- a/Intermediate.hs
+++ b/Intermediate.hs
@@ -41,6 +41,7 @@ data Terminator
= IBr Ref Int Int
| IJmp Int
| IRet Ref
+ | ITailC Ref [Ref]
| IExit
| IUnknown
deriving Eq
@@ -91,5 +92,6 @@ instance Show Terminator where
show (IBr r b1 b2) = "br " ++ show r ++ " " ++ show b1 ++ " " ++ show b2
show (IJmp b) = "jmp " ++ show b
show (IRet r) = "ret " ++ show r
+ show (ITailC r as) = "tailc " ++ show r ++ " " ++ show as
show IExit = "exit"
show IUnknown = "<<UNKNOWN>>"