Changes between Version 8 and Version 9 of Plugins


Ignore:
Timestamp:
May 28, 2008 4:33:20 AM (7 years ago)
Author:
sseefried
Comment:

Reformatted the code a little. Lines were too long for my screen.

Legend:

Unmodified
Added
Removed
Modified
  • Plugins

    v8 v9  
    7777--  * -pfoo=n
    7878--  * -pfoo;
    79 -- Furthermore we cannot warn about unrecognized -p args unless we have plugins report back unrecognized args. Reporting the error at that
    80 -- late stage will also be problematic, so we probably shouldn't bother.
    81 -- We should provide a library that is able to parse these for plugin writers so they don't reinvent the wheel (maybe just using
    82 -- GHCs CmdLineParser)
    83 -- An alternative design for functionPragmaOptions would be to attach the pragma data structures to Notes in the Core syntax tree.
    84 -- However, SPJ feels that would interact too much with other compiler stages, that have a habit of moving Notes around..
    85 newtype PluginOptions = PluginOptions { ambientPragmaOptions :: [Dynamic], functionPragmaOptions :: Map Id [Dynamic], commandLineOptions :: [String] }
     79-- Furthermore we cannot warn about unrecognized -p args unless we have plugins report back unrecognized args.
     80-- Reporting the error at that late stage will also be problematic, so we probably shouldn't bother.
     81-- We should provide a library that is able to parse these for plugin writers so they don't reinvent the
     82-- wheel (maybe just using GHCs CmdLineParser)
     83-- An alternative design for functionPragmaOptions would be to attach the pragma data structures to Notes
     84-- in the Core syntax tree. However, SPJ feels that would interact too much with other compiler stages, that
     85-- have a habit of moving Notes around.
     86newtype PluginOptions =
     87  PluginOptions { ambientPragmaOptions :: [Dynamic]
     88                , functionPragmaOptions :: Map Id [Dynamic]
     89                , commandLineOptions :: [String] }
    8690initialize :: PluginOptions -> IO GHCPluginInstance
    8791             
    8892data GHCPluginInstance = GHCPluginInstance {
    89   -- We could either have them change the pipeline explicitly, by providing a CoreDoPluginPass constructor in CoreToDo:
     93  -- We could either have them change the pipeline explicitly,
     94  -- by providing a CoreDoPluginPass constructor in CoreToDo:
    9095  installCorePasses :: [CoreToDo] -> [CoreToDo]
    9196  -- Or (possibly less fragile and operational, but more complicated) just something like: