• Ömer Sinan Ağacan's avatar
    Return ModIface in compilation pipeline, remove IORef hack for generating ModIfaces · bbdd54aa
    Ömer Sinan Ağacan authored
    The compilation phases now optionally return ModIface (for phases that
    generate an interface, currently only HscOut when (re)compiling a file).
    The value is then used by compileOne' to return the generated interface
    with HomeModInfo (which is then used by the batch mode compiler when
    building rest of the tree).
    
    hscIncrementalMode also returns a DynFlags with plugin info, to be used
    in the rest of the pipeline.
    
    Unfortunately this introduces a (perhaps less bad) hack in place of the
    previous IORef: we now record the DynFlags used to generate the partial
    infterface in HscRecomp and use the same DynFlags when generating the
    full interface. I spent almost three days trying to understand what's
    changing in DynFlags that causes a backpack test to fail, but I couldn't
    figure it out. There's a FIXME added next to the field so hopefully
    someone who understands this better than I do will fix it leter.
    bbdd54aa
HscMain.hs 79.4 KB