• Ben Gamari's avatar
    LLVM: Factor out accumulation of LLVM statements and variables · 95394085
    Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
    The LLVM code generator currently has a rather large amount of
    boilerplate devoted to piping around and building up various AST
    elements. This is rather unfortunate for a language which prides itself
    on ease of abstraction and detracts from readability.
    
    Here I continue a refactoring that I originally suggested in D991, using
    `WriterT` to factor out this pattern. `WriterT` is in general a bit
    problematic from an evaluation perspective, but the expressions here are
    small enough that it should be a problem in practice.
    
    Test Plan: Validate
    
    Reviewers: austin
    
    Reviewed By: austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1286
    95394085