@@ -1,4 +1,4 @@
1−module CodeGen.IL.Optimizer.TCO (tco) where
1+module CodeGen.IL.Optimizer.TCO (tco, tcoLoop) where
22
33import Prelude.Compat
44
@@ -11,19 +11,22 @@ import CodeGen.IL.Common
1111
1212import qualified Language.PureScript.Constants as C
1313
14+tcoLoop :: Text
15+tcoLoop = "__tco_loop"
16+
1417tco :: AST -> AST -> AST
1518tco mn = everywhere convert where
1619 tcoVar :: Text -> Text
17− tcoVar arg = "ᵗ" <> arg
20+ tcoVar arg = "__tco_var_" <> arg
1821
1922 copyVar :: Text -> Text
20− copyVar arg = "ᶜ" <> arg
23+ copyVar arg = "__copy_" <> arg
2124
2225 tcoDone :: Text
23− tcoDone = "ᵗᶜdone"
26+ tcoDone = "__tco_done"
2427
2528 tcoResult :: Text
26− tcoResult = "ᵗᶜresult"
29+ tcoResult = "__tco_result"
2730
2831 convert :: AST -> AST
2932 convert fn@(Function ss (Just name) args _)