Merge pull request #121 from Z-snails/fix-arity-raising

Don't arity raise or unbox `grinMain`
This commit is contained in:
Andor Penzes 2021-05-28 11:46:18 +01:00 committed by GitHub
commit 2135fe545d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -103,6 +103,7 @@ phase1 te = pdArityData . cata collect where
, isJust mtag
, p `notElem` (bdOther body)
, p `notElem` (snd <$> (filter ((/=fn) . fst) (bdFunCall body)))
, fn /= "grinMain"
]
in FunData $ case funData of
[] -> Map.empty

View File

@ -92,7 +92,7 @@ functionsToUnbox te (Program exts defs) = result where
nonCandidateTailCallMap = Map.withoutKeys tranisitiveTailCalls result0
candidateCalledByNonCandidate = (Set.unions $ Map.elems nonCandidateTailCallMap) `Set.intersection` result0
result = result0 `Set.difference` candidateCalledByNonCandidate
result = Set.delete "grinMain" $ result0 `Set.difference` candidateCalledByNonCandidate
result0 = Set.fromList $ step initial
initial = map funName $ filter (doesReturnAKnownProduct te . funName) defs