mirror of
https://github.com/grin-compiler/grin.git
synced 2024-09-11 07:25:28 +03:00
Merge pull request #121 from Z-snails/fix-arity-raising
Don't arity raise or unbox `grinMain`
This commit is contained in:
commit
2135fe545d
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user