Skip to content
  • Alex D's avatar
    Compile modules with `-fobject-code` enabled to byte-code when loaded with `*`... · 58a1ca38
    Alex D authored and Marge Bot's avatar Marge Bot committed
    Compile modules with `-fobject-code` enabled to byte-code when loaded with `*` prefix in ghci (#8042)
    
    The documentation states that when using :add and :load, the `*` prefix forces a module
    to be loaded as byte-code. However, this seems to be ignored when -fobject-code has been
    enabled. In that case, the compiled code is always used, regardless of whether the *-form
    is used.
    
    The idea is to consult the Targets in HscEnv and check the 'targetAllowObjCode' flag. If
    the flag for given module is set, then patch up DynFlags and select compilation backend
    accordingly.
    
    This would require a linear scan of course, but that shouldn't be too costly.
    58a1ca38