on master help sign in
Some clean up.
c707c2dniklas
src/IRTS/CodegenC.hs+3−4
@@ -62,7 +62,6 @@ codegenC' defs out exec incs objs libs flags dbg
62 hPutStr tmph cout
62 hPutStr tmph cout
63 hFlush tmph
63 hFlush tmph
64 hClose tmph
64 hClose tmph
65− let useclang = False
66 comp <- getCC
65 comp <- getCC
67 libFlags <- getLibFlags
66 libFlags <- getLibFlags
68 incFlags <- getIncFlags
67 incFlags <- getIncFlags
@@ -175,15 +174,15 @@ bcc i (CASE True r code def)
175 | length code < 4 = showCase i def code
174 | length code < 4 = showCase i def code
176 where
175 where
177 showCode :: Int -> [BC] -> String
176 showCode :: Int -> [BC] -> String
178− showCode i bc = "{\n" ++ indent i ++ concatMap (bcc (i + 1)) bc ++
177+ showCode i bc = "{\n" ++ concatMap (bcc (i + 1)) bc ++
179 indent i ++ "}\n"
178 indent i ++ "}\n"
180
179
181 showCase :: Int -> Maybe [BC] -> [(Int, [BC])] -> String
180 showCase :: Int -> Maybe [BC] -> [(Int, [BC])] -> String
182 showCase i Nothing [(t, c)] = showCode i c
181 showCase i Nothing [(t, c)] = showCode i c
183 showCase i (Just def) [] = showCode i def
182 showCase i (Just def) [] = showCode i def
184 showCase i def ((t, c) : cs)
183 showCase i def ((t, c) : cs)
185− = "if (CTAG(" ++ creg r ++ ") == " ++ show t ++ ") " ++ showCode i c
184+ = indent i ++ "if (CTAG(" ++ creg r ++ ") == " ++ show t ++ ") " ++ showCode i c
186− ++ "else " ++ showCase i def cs
185+ ++ indent i ++ "else " ++ showCase i def cs
187
186
188bcc i (CASE safe r code def)
187bcc i (CASE safe r code def)
189 = indent i ++ "switch(" ++ ctag safe ++ "(" ++ creg r ++ ")) {\n" ++
188 = indent i ++ "switch(" ++ ctag safe ++ "(" ++ creg r ++ ")) {\n" ++