
#11179: Allow plugins to access "dead code" -------------------------------------+------------------------------------- Reporter: lerkok | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by gridaphobe): I looked into this briefly a while ago, and IIRC the first option may be as simple as removing the call to `simpleOptPgm` inside `Desugar.deSugar`. Or, rather, moving it to an initial Core2Core pass, which would preserve the current pipeline but cleanly allow plugins access to the fully unoptimized program. There's a warning right before the call though, that suggests the unoptimized program may be excessively large. I don't know how much of a concern this would be in practice. The other thing to consider is whether removing the initial optimization pass may break existing Core2Core plugins. If a plugin inserts itself at the beginning of the Core2Core pipeline, the overall order would change from {{{ simpleOptPgm > plugin > ... }}} to {{{ plugin > simpleOptPgm > ... }}} For some plugins, e.g. Levent's or LiquidHaskell, this is exactly what is desired, but it could break others. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11179#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler