Removed cppremoveSpec, since it was doing the same as cremoveSpec

This commit is contained in:
Neil Brown 2009-02-27 10:49:45 +00:00
parent 69b798735f
commit cd1b409f96

View File

@ -39,7 +39,7 @@ import System.IO
import qualified AST as A
import CompState
import GenerateC (cgenOps, cgenReplicatorLoop, cgenType, cintroduceSpec, cremoveSpec,
import GenerateC (cgenOps, cgenReplicatorLoop, cgenType, cintroduceSpec,
generate, genComma, genLeftB, genMeta, genName, genRightB, justOnly, seqComma, withIf)
import GenerateCBased
import Errors
@ -88,8 +88,7 @@ cppgenOps = cgenOps {
genUnfoldedExpression = cppgenUnfoldedExpression,
genUnfoldedVariable = cppgenUnfoldedVariable,
getScalarType = cppgetScalarType,
introduceSpec = cppintroduceSpec,
removeSpec = cppremoveSpec
introduceSpec = cppintroduceSpec
}
--}}}
@ -513,18 +512,6 @@ cppdeclareInit _ _ _ = Nothing
cppdeclareFree :: Meta -> A.Type -> A.Variable -> Maybe (CGen ())
cppdeclareFree _ _ _ = Nothing
-- | Changed to work properly with declareFree to free channel arrays.
cppremoveSpec :: A.Specification -> CGen ()
cppremoveSpec (A.Specification m n (A.Declaration _ t))
= do fdeclareFree <- fget declareFree
case fdeclareFree m t var of
Just p -> p
Nothing -> return ()
where
var = A.Variable m n
-- Otherwise, defer to the C implementation:
cppremoveSpec sp = cremoveSpec sp
--Changed from GenerateC to add a name function (to allow us to use the same function for doing function parameters as constructor parameters)
--and also changed to use infixComma.
--Therefore these functions are not part of GenOps. They are called directly by cppgenForwardDeclaration and cppintroduceSpec.