Skip to content
  • Austin Seipp's avatar
    Nuke {save,restore}StaticFlagGlobals. · 16c40113
    Austin Seipp authored
    As discussed in #8276, this code was somewhat broken because while you
    could always revert the actual argument list, you can never revert the
    CAFs upon which they are based - so really this didn't buy you much.
    
    However, Haddock in particular expects to be able to parse GHC flags,
    including static flags, and used this code to do so. In its place, we
    instead have discardStaticFlags, which will safely remove any of the
    remaining 5 flags from a list of arguments. Haddock instead discards
    these, as they aren't related to anything it does anyway (mostly
    controlling debugging output and some basic optimizer phases.)
    
    This fixes #8276
    
    . In the future, we will eventually completely remove
    the remaining StaticFlags, removing the need for this fix. Unfortunately
    these changes will be quite invasive and require more time.
    
    Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
    16c40113