Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
67722 commits behind the upstream repository.
  • Alp Mestanogullari's avatar
    900cf195
    compiler: introduce DynFlags plugins · 900cf195
    Alp Mestanogullari authored and Marge Bot's avatar Marge Bot committed
    They have type '[CommandLineOpts] -> Maybe (DynFlags -> IO DynFlags)'.
    All plugins that supply a non-Nothing 'dynflagsPlugin' will see their
    updates applied to the current DynFlags right after the plugins are
    loaded.
    
    One use case for this is to superseede !1580 for registering hooks
    from a plugin. Frontend/parser plugins were considered to achieve this
    but they respectively conflict with how this plugin is going to be used
    and don't allow overriding/modifying the DynFlags, which is how hooks have
    to be registered.
    
    This commit comes with a test, 'test-hook-plugin', that registers a "fake"
    meta hook that replaces TH expressions with the 0 integer literal.
    900cf195
    History
    compiler: introduce DynFlags plugins
    Alp Mestanogullari authored and Marge Bot's avatar Marge Bot committed
    They have type '[CommandLineOpts] -> Maybe (DynFlags -> IO DynFlags)'.
    All plugins that supply a non-Nothing 'dynflagsPlugin' will see their
    updates applied to the current DynFlags right after the plugins are
    loaded.
    
    One use case for this is to superseede !1580 for registering hooks
    from a plugin. Frontend/parser plugins were considered to achieve this
    but they respectively conflict with how this plugin is going to be used
    and don't allow overriding/modifying the DynFlags, which is how hooks have
    to be registered.
    
    This commit comes with a test, 'test-hook-plugin', that registers a "fake"
    meta hook that replaces TH expressions with the 0 integer literal.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.