Skip to content
  • Michal Terepeta's avatar
    Hoopl/Dataflow: use block-oriented interface · 679ccd1c
    Michal Terepeta authored and Ben Gamari's avatar Ben Gamari committed
    
    
    This introduces the new interface for dataflow analysis, where transfer
    functions operate on a whole basic block.
    
    The main changes are:
    - Hoopl.Dataflow: implement the new interface and remove the old code;
      expose a utility function to do a strict fold over the nodes of a
      basic block (for analyses that do want to look at all the nodes)
    - Refactor all the analyses to use the new interface.
    
    One of the nice effects is that we can remove the `analyzeFwdBlocks`
    hack that ignored the middle nodes (that existed for analyses that
    didn't need to go over all the nodes). Now this is no longer a special
    case and fits well with the new interface.
    
    Signed-off-by: default avatarMichal Terepeta <michal.terepeta@gmail.com>
    
    Test Plan:
    validate, earlier version of the patch had assertions
    comparing the results with the old implementation
    
    Reviewers: erikd, austin, simonmar, hvr, goldfire, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: goldfire, erikd, thomie
    
    Differential Revision: https://phabricator.haskell.org/D2754
    679ccd1c