Skip to content
Snippets Groups Projects
Commit f021fc6f authored by Kevin Glynn's avatar Kevin Glynn
Browse files

[project @ 1999-10-18 11:44:20 by kglynn]

The fix to ignore error() cases when doing CPR analysis exposed a
problem with the Void type.  A function that always constructs a void
result was converted to w/w, but the worker was producing an unboxed
tuple with 0 components.  Not good.

Fixed so that constructing a void gives CPR value Top.  This is OK
because we won't really be constructing a void each time, we will be
returning a pointer to a shared void cell.
parent 170d1670
No related merge requests found
......@@ -221,7 +221,14 @@ cprAnalExpr rho e@(Var v)
-- has product type then this is a manifest constructor (hooray!)
cprAnalExpr rho (Con con args)
= (Con con args_cpr,
if isConProdType con
-- If we are a product with 0 args we must be void(like)
-- We can't create an unboxed tuple with 0 args for this
-- and since Void has only one, constant value it should
-- just mean returning a pointer to a pre-existing cell.
-- So we won't really gain from doing anything fancy
-- and we treat this case as Top.
if isConProdType con
&& length args > 0
then Tuple args_aval_filt_funs
else Top)
where
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment