Ben Gamari pushed to branch wip/T23109 at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Driver/Main.hs
    ... ... @@ -1925,6 +1925,14 @@ hscGenHardCode hsc_env cgguts mod_loc output_filename = do
    1925 1925
                 dflags = hsc_dflags hsc_env
    
    1926 1926
                 logger = hsc_logger hsc_env
    
    1927 1927
     
    
    1928
    +        -------------------
    
    1929
    +        -- ADD IMPLICIT BINDINGS
    
    1930
    +        -- NB: we must feed mkImplicitBinds through corePrep too
    
    1931
    +        -- so that they are suitably cloned and eta-expanded
    
    1932
    +        let cp_pgm_cfg :: CorePrepPgmConfig
    
    1933
    +            cp_pgm_cfg = initCorePrepPgmConfig (hsc_dflags hsc_env)
    
    1934
    +                                               (interactiveInScope $ hsc_IC hsc_env)
    
    1935
    +        binds_with_implicits <- addImplicitBinds cp_pgm_cfg mod_loc (cg_tycons cgguts) core_binds
    
    1928 1936
     
    
    1929 1937
             -------------------
    
    1930 1938
             -- INSERT LATE COST CENTRES, based on the provided flags.
    
    ... ... @@ -1957,7 +1965,7 @@ hscGenHardCode hsc_env cgguts mod_loc output_filename = do
    1957 1965
                   }
    
    1958 1966
     
    
    1959 1967
             (late_cc_binds, late_cc_state) <-
    
    1960
    -          addLateCostCenters logger late_cc_config core_binds
    
    1968
    +          addLateCostCenters logger late_cc_config binds_with_implicits
    
    1961 1969
     
    
    1962 1970
             when (dopt Opt_D_dump_late_cc dflags || dopt Opt_D_verbose_core2core dflags) $
    
    1963 1971
               putDumpFileMaybe logger Opt_D_dump_late_cc "LateCC" FormatCore (vcat (map ppr late_cc_binds))
    
    ... ... @@ -1972,7 +1980,7 @@ hscGenHardCode hsc_env cgguts mod_loc output_filename = do
    1972 1980
                   cg_foreign_files = foreign_files,
    
    1973 1981
                   cg_dep_pkgs      = dependencies,
    
    1974 1982
                   cg_spt_entries   = spt_entries,
    
    1975
    -              cg_binds         = late_binds,
    
    1983
    +              cg_binds         = binds_to_prep,
    
    1976 1984
                   cg_ccs           = late_local_ccs
    
    1977 1985
                 }
    
    1978 1986
               , _
    
    ... ... @@ -1997,15 +2005,6 @@ hscGenHardCode hsc_env cgguts mod_loc output_filename = do
    1997 2005
               llvm_config = hsc_llvm_config hsc_env
    
    1998 2006
               profile = targetProfile dflags
    
    1999 2007
     
    
    2000
    -        -------------------
    
    2001
    -        -- ADD IMPLICIT BINDINGS
    
    2002
    -        -- NB: we must feed mkImplicitBinds through corePrep too
    
    2003
    -        -- so that they are suitably cloned and eta-expanded
    
    2004
    -        let cp_pgm_cfg :: CorePrepPgmConfig
    
    2005
    -            cp_pgm_cfg = initCorePrepPgmConfig (hsc_dflags hsc_env)
    
    2006
    -                                               (interactiveInScope $ hsc_IC hsc_env)
    
    2007
    -        binds_to_prep <- addImplicitBinds cp_pgm_cfg mod_loc tycons late_binds
    
    2008
    -
    
    2009 2008
             -------------------
    
    2010 2009
             -- PREPARE FOR CODE GENERATION
    
    2011 2010
             -- Do saturation and convert to A-normal form