summaryrefslogtreecommitdiff
path: root/Compiler.hs
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2019-04-18 23:24:56 +0200
committerTom Smeding <tom.smeding@gmail.com>2019-04-18 23:24:56 +0200
commitd37b2cfec1cfcbc3b6cfcedc88a9c6775312f8eb (patch)
tree5426e28f530b69fbf5f618ac759c2bde9cf87bd3 /Compiler.hs
parent7b2f8b602e65ed2462b7d2c5a432d102f0ba6705 (diff)
Lower to isa WIP
Diffstat (limited to 'Compiler.hs')
-rw-r--r--Compiler.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Compiler.hs b/Compiler.hs
index 2e3b80b..8c32236 100644
--- a/Compiler.hs
+++ b/Compiler.hs
@@ -6,7 +6,6 @@ import Control.Monad.State.Strict
import Data.List
import qualified Data.Map.Strict as Map
import qualified Data.Set as Set
-import Debug.Trace
import AST
import Intermediate
@@ -160,7 +159,10 @@ compileProgram (Program values) = runCM $ do
switchBlock bnext
addIns (RNone, IDiscard ref)
setTerm IExit
- ([firstbb], otherbbs) <- liftM (partition ((== bstart) . bbId) . Map.elems) (gets csBlocks)
+ (bbs, otherbbs) <- liftM (partition ((== bstart) . bbId) . Map.elems) (gets csBlocks)
+ let firstbb = case bbs of
+ [bb] -> bb
+ _ -> error "Multiple bb's with the same ID!"
funcs <- gets csFunctions
datas <- gets csDatas
return (IRProgram (firstbb : otherbbs) funcs datas)