Common.hs 555 Bytes
Newer Older
1
{-# LANGUAGE CPP #-}
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
module Common where

import GhcPlugins

install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]
install options todos = do
    putMsgS $ "Simple Plugin Passes Queried"
    putMsgS $ "Got options: " ++ unwords options

    -- Create some actual passes to continue the test.
    return $ CoreDoPluginPass "Main pass" mainPass
             : todos

mainPass :: ModGuts -> CoreM ModGuts
mainPass guts = do
17 18 19
#if defined(RUN2)
    putMsgS "Simple Plugin Pass Run 2"
#else
20
    putMsgS "Simple Plugin Pass Run"
21
#endif
22
    return guts