on master help sign in
Don't give up when compiling Types

Just generate a placeholder value - this might happen when erasure is disabled, for example.

commit76ad5062ef88ed01c7255d1062a89cc61093db00 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateFri 2 Jan 2015, 16:32 (12 years ago) parentf936366
1 file changed+4
src/IRTS/CodegenC.hs+4
src/IRTS/CodegenC.hs+4
@@ -154,6 +154,10 @@ bcc i (ASSIGNCONST l c)
154154 mkConst (B16V x) = let x' = V.toList x in "MKB16x8const(vm, " ++ intercalate ", " (map (\elem -> show elem ++ "U") x') ++ ")"
155155 mkConst (B32V x) = let x' = V.toList x in "MKB32x4const(vm, " ++ intercalate ", " (map (\elem -> show elem ++ "UL") x') ++ ")"
156156 mkConst (B64V x) = let x' = V.toList x in "MKB64x2const(vm, " ++ intercalate ", " (map (\elem -> show elem ++ "ULL") x') ++ ")"
157+ -- if it's a type constant, we won't use it, but equally it shouldn't
158+ -- report an error. These might creep into generated for various reasons
159+ -- (especially if erasure is disabled).
160+ mkConst c | isTypeConst c = "MKINT(42424242)"
157161 mkConst c = error $ "mkConst of (" ++ show c ++ ") not implemented"
158162
159163bcc i (UPDATE l r) = indent i ++ creg l ++ " = " ++ creg r ++ ";\n"