Commits

Anonymous committed 3720a61

Update to compile with the final versions of compiler plugins, now in GHC HEAD

Also update .gitignore and rename cabal file

Comments (0)

Files changed (7)

 *.o
 *.hi
 *~
+tests/NonTerminating
+dist

BUILDING

-To build and install the actual plugin:
-
-runhaskell Setup.hs configure
-runhaskell Setup.hs build
-sudo runhaskell Setup.hs install
-
-Once you've done that, you can if you wish run the tests:
-
-cd tests
-ghc --make -fplugin=Strict.Plugin NonTerminating.hs
-./NonTerminating
-
-To use the plugin on any module you compile with GHC, use the -plgStrict.Plugin option, or include it in an OPTIONS_GHC pragma, like so:
-
-{-# OPTIONS_GHC -fplugin=Strict.Plugin #-}
+Copyright (c) 2008-2011, Maximilian Bolingbroke, Austin Seipp
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted
+provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this list of
+      conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice, this list of
+      conditions and the following disclaimer in the documentation and/or other materials
+      provided with the distribution.
+    * Neither the name of Maximilian Bolingbroke nor the names of other contributors may be used to
+      endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 module Strict.Pass (strictifyProgram) where
 
-import GHCPlugins
+import GhcPlugins
 
 import Control.Monad
 import Data.Generics
 Strictification of a program based on annotations.
 \begin{code}
 
-strictifyProgram :: ModGuts -> CoreM [CoreBind]
-strictifyProgram guts = mapM (strictifyFunc guts) (mg_binds guts)
+strictifyProgram :: ModGuts -> CoreM ModGuts
+strictifyProgram guts = do
+  newBinds <- mapM (strictifyFunc guts) (mg_binds guts)
+  return $ guts { mg_binds = newBinds }
 
 strictifyFunc :: ModGuts -> CoreBind -> CoreM CoreBind
 strictifyFunc guts x@(NonRec b e) = do 
 
 import Strict.Pass
 
-import GHCPlugins
+import GhcPlugins
 
 plugin :: Plugin
 plugin = defaultPlugin {
 
 install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]
 install _option todos = do
-    return $ CoreDoPluginPass "Strictify" (ModGutsToBindsPluginPass strictifyProgram) : todos
+    return $ CoreDoPluginPass "Strictify" strictifyProgram : todos

strict-ghc-plugin.cabal

+Name:           strict-ghc-plugin
+Version:        0.1
+License:        BSD3
+License-File:   LICENSE
+Synopsis:       Turn Haskell into a strict language with a compiler plugin
+Description:    This library allows you to annotate top-level function definitions, and the compiler will make them strict functions as opposed to lazy - you can turn Haskell into a strict language!
+Cabal-Version:  >= 1.10
+Build-Type:     Simple
+Author:         Max Bolingbroke <batterseapower@hotmail.com>
+Maintainer:     Austin Seipp <as@hacks.yi.org>
+Homepage:       http://github.com/thoughtpolice/strict-ghc-plugin
+Bug-reports:    https://github.com/thoughtpolice/strict-ghc-plugin/issues
+
+source-repository head
+  type: git
+  location: https://github.com/thoughtpolice/strict-ghc-plugin.git
+
+Library
+    Exposed-Modules:
+        Strict.Plugin
+        Strict.Annotation
+    Other-Modules:
+        Strict.Pass
+    Build-Depends:
+        base,
+        syb,
+        ghc >= 7.2
+    default-language: Haskell98

strict-plugin.cabal

-Name:           strict-plugin
-Version:        1.0
-License:        BSD3
-Synopsis:       A plugin for GHC that lets you change Haskell into a strict language!
-Cabal-Version:  >= 1.2
-Build-Type:	Simple
-Author:         Max Bolingbroke
-Homepage:       http://www.omega-prime.co.uk
-
-Library
-    Exposed-Modules:
-        Strict.Plugin
-        Strict.Annotation
-    Other-Modules:
-        Strict.Pass
-    Build-Depends:
-        base,
-        syb,
-        ghc >= 7.1