Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#9529 closed task (fixed)

Clean up cseProgram

Reported by: dfeuer Owned by:
Priority: normal Milestone: 7.10.1
Component: Compiler Version: 7.9
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

I think this should be a no-brainer:

Replace

cseProgram :: CoreProgram -> CoreProgram
cseProgram binds = cseBinds emptyCSEnv binds

cseBinds :: CSEnv -> [CoreBind] -> [CoreBind]
cseBinds _   []     = []
cseBinds env (b:bs) = (b':bs')
                    where
                      (env1, b') = cseBind  env  b
                      bs'        = cseBinds env1 bs

with

cseProgram :: CoreProgram -> CoreProgram
cseProgram = snd . mapAccumL cseBind emptyCSEnv

I'll attach a patch.

Attachments (1)

CSE.diff (724 bytes) - added by dfeuer 5 years ago.
Patch to clean up cseProgram

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by dfeuer

Attachment: CSE.diff added

Patch to clean up cseProgram

comment:1 Changed 5 years ago by dfeuer

Status: newpatch
Type: bugtask

comment:2 Changed 5 years ago by Simon Peyton Jones <simonpj@…>

In 48f17f156c3bb608603575ade2788140fadab192/ghc:

Use mapAccumL (refactoring only)

Fixes Trac #9529

comment:3 Changed 5 years ago by simonpj

Resolution: fixed
Status: patchclosed

comment:4 Changed 5 years ago by thoughtpolice

Milestone: 7.8.47.10.1
Note: See TracTickets for help on using tickets.