forked from reflex-frp/reflex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ryan Trinkle
committed
Oct 18, 2016
1 parent
8c7653e
commit adfc860
Showing
7 changed files
with
83 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,5 @@ hsenv.log | |
.#* | ||
/shell.nix | ||
/ghci-tmp | ||
*.dump-* | ||
*.verbose-core2core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{-# LANGUAGE CPP #-} | ||
{-# LANGUAGE LambdaCase #-} | ||
module Reflex.Optimizer (plugin) where | ||
|
||
#ifndef ghcjs_HOST_OS | ||
|
||
import GhcPlugins | ||
import Control.Arrow | ||
|
||
plugin :: Plugin | ||
plugin = defaultPlugin { installCoreToDos = install } | ||
|
||
install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo] | ||
install [] p = return $ makeInlinable : p | ||
|
||
makeInlinable :: CoreToDo | ||
makeInlinable = CoreDoPluginPass "MakeInlinable" $ \modGuts -> do | ||
let f v = setIdInfo v $ let i = idInfo v in | ||
setInlinePragInfo i $ let p = inlinePragInfo i in | ||
if isDefaultInlinePragma p | ||
then defaultInlinePragma { inl_inline = Inlinable } | ||
else p | ||
newBinds = flip map (mg_binds modGuts) $ \case | ||
NonRec b e -> NonRec (f b) e | ||
Rec bes -> Rec $ map (first f) bes | ||
return $ modGuts { mg_binds = newBinds } | ||
|
||
#else | ||
|
||
plugin :: () | ||
plugin = () | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters