on master help sign in
Remove unused function in JS codegen
4fc4c93Thomas Scholtes
src/IRTS/JavaScript/Codegen.hs−14
@@ -222,10 +222,6 @@ addUsedArgsTailCallOptim :: Set (Text, Text) -> State CGBodyState ()
222addUsedArgsTailCallOptim p =
222addUsedArgsTailCallOptim p =
223 modify (\s -> s {usedArgsTailCallOptim = Set.union p (usedArgsTailCallOptim s) })
223 modify (\s -> s {usedArgsTailCallOptim = Set.union p (usedArgsTailCallOptim s) })
224
224
225−getNewCGNames :: Int -> State CGBodyState [Text]
226−getNewCGNames n =
227− mapM (\_ -> getNewCGName) [1..n]
228−
229getConsId :: Name -> State CGBodyState (Int, Int)
225getConsId :: Name -> State CGBodyState (Int, Int)
230getConsId n =
226getConsId n =
231 do
227 do
@@ -273,16 +269,6 @@ cgFun dfs n args def = do
273 }
269 }
274 (fn, state')
270 (fn, state')
275
271
276−getSwitchJs :: JsExpr -> [LAlt] -> JsExpr
277−getSwitchJs x alts =
278− if any conCase alts then JsArrayProj (JsInt 0) x
279− else if any constBigIntCase alts then JsForeign "%0.toString()" [x]
280− else x
281− where conCase (LConCase _ _ _ _) = True
282− conCase _ = False
283− constBigIntCase (LConstCase (BI _) _) = True
284− constBigIntCase _ = False
285−
286addRT :: BodyResTarget -> JsExpr -> JsStmt
272addRT :: BodyResTarget -> JsExpr -> JsStmt
287addRT ReturnBT x = JsReturn x
273addRT ReturnBT x = JsReturn x
288addRT (DecBT n) x = JsDecLet n x
274addRT (DecBT n) x = JsDecLet n x