Moved the old attempt at a usage checker into a new module just for doing Rain usage checks
This commit is contained in:
parent
4d6d645010
commit
700ddf149e
|
@ -46,7 +46,7 @@ BUILT_SOURCES = frontends/LexOccam.hs frontends/LexRain.hs CompilerCommands.hs
|
||||||
CLEANFILES = $(BUILT_SOURCES)
|
CLEANFILES = $(BUILT_SOURCES)
|
||||||
|
|
||||||
tock_SOURCES = transformations/SimplifyExprs.hs transformations/SimplifyTypes.hs
|
tock_SOURCES = transformations/SimplifyExprs.hs transformations/SimplifyTypes.hs
|
||||||
tock_SOURCES += transformations/Unnest.hs transformations/UsageCheck.hs transformations/SimplifyProcs.hs
|
tock_SOURCES += transformations/Unnest.hs transformations/RainUsageCheck.hs transformations/SimplifyProcs.hs
|
||||||
tock_SOURCES += transformations/SimplifyComms.hs
|
tock_SOURCES += transformations/SimplifyComms.hs
|
||||||
tock_SOURCES += frontends/PreprocessOccam.hs frontends/ParseRain.hs frontends/StructureOccam.hs
|
tock_SOURCES += frontends/PreprocessOccam.hs frontends/ParseRain.hs frontends/StructureOccam.hs
|
||||||
tock_SOURCES += frontends/ParseOccam.hs frontends/RainTypes.hs frontends/RainPasses.hs frontends/ParseUtils.hs
|
tock_SOURCES += frontends/ParseOccam.hs frontends/RainTypes.hs frontends/RainPasses.hs frontends/ParseUtils.hs
|
||||||
|
@ -60,7 +60,7 @@ tock_SOURCES += backends/GenerateC.hs backends/GenerateCPPCSP.hs
|
||||||
tock_SOURCES += Main.hs
|
tock_SOURCES += Main.hs
|
||||||
|
|
||||||
tocktest_SOURCES = $(tock_SOURCES)
|
tocktest_SOURCES = $(tock_SOURCES)
|
||||||
tocktest_SOURCES += transformations/PassTest.hs transformations/UsageCheckTest.hs
|
tocktest_SOURCES += transformations/PassTest.hs transformations/RainUsageCheckTest.hs
|
||||||
tocktest_SOURCES += backends/GenerateCTest.hs backends/BackendPassesTest.hs
|
tocktest_SOURCES += backends/GenerateCTest.hs backends/BackendPassesTest.hs
|
||||||
tocktest_SOURCES += common/TestUtil.hs common/CommonTest.hs common/FlowGraphTest.hs
|
tocktest_SOURCES += common/TestUtil.hs common/CommonTest.hs common/FlowGraphTest.hs
|
||||||
tocktest_SOURCES += frontends/ParseRainTest.hs frontends/RainPassesTest.hs frontends/RainTypesTest.hs
|
tocktest_SOURCES += frontends/ParseRainTest.hs frontends/RainPassesTest.hs frontends/RainTypesTest.hs
|
||||||
|
|
|
@ -32,7 +32,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
--
|
--
|
||||||
-- * "RainPassTest"
|
-- * "RainPassTest"
|
||||||
--
|
--
|
||||||
-- * "UsageCheckTest"
|
-- * "RainUsageCheckTest"
|
||||||
module TestMain () where
|
module TestMain () where
|
||||||
|
|
||||||
import Test.HUnit
|
import Test.HUnit
|
||||||
|
@ -45,7 +45,7 @@ import qualified ParseRainTest (tests)
|
||||||
import qualified PassTest (tests)
|
import qualified PassTest (tests)
|
||||||
import qualified RainPassesTest (tests)
|
import qualified RainPassesTest (tests)
|
||||||
import qualified RainTypesTest (tests)
|
import qualified RainTypesTest (tests)
|
||||||
import qualified UsageCheckTest (tests)
|
import qualified RainUsageCheckTest (tests)
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do runTestTT $ TestList
|
main = do runTestTT $ TestList
|
||||||
|
@ -58,6 +58,6 @@ main = do runTestTT $ TestList
|
||||||
,PassTest.tests
|
,PassTest.tests
|
||||||
,RainPassesTest.tests
|
,RainPassesTest.tests
|
||||||
,RainTypesTest.tests
|
,RainTypesTest.tests
|
||||||
,UsageCheckTest.tests
|
,RainUsageCheckTest.tests
|
||||||
]
|
]
|
||||||
return ()
|
return ()
|
||||||
|
|
|
@ -16,7 +16,11 @@ You should have received a copy of the GNU General Public License along
|
||||||
with this program. If not, see <http://www.gnu.org/licenses/>.
|
with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
-}
|
-}
|
||||||
|
|
||||||
module UsageCheck where
|
-- | This code implements the usage checking in Rain. It is designed to work with
|
||||||
|
-- the control-flow graph stuff, hence the use of functions that match the dictionary
|
||||||
|
-- of functions in FlowGraph. This is also why we don't drill down into processes;
|
||||||
|
-- the control-flow graph means that we only need to concentrate on each node that isn't nested.
|
||||||
|
module RainUsageCheck where
|
||||||
|
|
||||||
import Data.Generics
|
import Data.Generics
|
||||||
import Data.List
|
import Data.List
|
|
@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along
|
||||||
with this program. If not, see <http://www.gnu.org/licenses/>.
|
with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
-}
|
-}
|
||||||
|
|
||||||
module UsageCheckTest (tests) where
|
module RainUsageCheckTest (tests) where
|
||||||
|
|
||||||
import Prelude hiding (fail)
|
import Prelude hiding (fail)
|
||||||
import Test.HUnit
|
import Test.HUnit
|
||||||
|
@ -24,7 +24,7 @@ import Test.HUnit
|
||||||
|
|
||||||
import qualified AST as A
|
import qualified AST as A
|
||||||
import TestUtil
|
import TestUtil
|
||||||
import qualified UsageCheck as UC
|
import RainUsageCheck
|
||||||
|
|
||||||
|
|
||||||
--See note in UsageCheck about WrittenRead not using sets. Therefore our equality function is inefficient
|
--See note in UsageCheck about WrittenRead not using sets. Therefore our equality function is inefficient
|
Loading…
Reference in New Issue
Block a user