Fixed the C++ backends so that it continues to declare timer variables, even though the C backend doesn't any more
This commit is contained in:
parent
ba75f5b06c
commit
c733ac2cff
|
@ -17,7 +17,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
-}
|
||||
|
||||
-- | Generate C code from the mangled AST.
|
||||
module GenerateC (cgenOps, cgenType, cintroduceSpec, cPreReq, genComma, genCPasses, generate, generateC, genLeftB, genMeta, genName, genRightB, indexOfFreeDimensions, seqComma, withIf ) where
|
||||
module GenerateC (cgenOps, cgenDeclaration, cgenType, cintroduceSpec, cPreReq, genComma, genCPasses, generate, generateC, genLeftB, genMeta, genName, genRightB, indexOfFreeDimensions, seqComma, withIf ) where
|
||||
|
||||
import Data.Char
|
||||
import Data.Generics
|
||||
|
|
|
@ -39,7 +39,7 @@ import System.IO
|
|||
|
||||
import qualified AST as A
|
||||
import CompState
|
||||
import GenerateC (cgenOps, cintroduceSpec, cgenType, generate, genComma, genLeftB, genMeta, genName, genRightB, indexOfFreeDimensions, seqComma, withIf)
|
||||
import GenerateC (cgenDeclaration, cgenOps, cintroduceSpec, cgenType, generate, genComma, genLeftB, genMeta, genName, genRightB, indexOfFreeDimensions, seqComma, withIf)
|
||||
import GenerateCBased
|
||||
import Metadata
|
||||
import Pass
|
||||
|
@ -60,6 +60,7 @@ cppgenOps = cgenOps {
|
|||
genAllocMobile = cppgenAllocMobile,
|
||||
genAlt = cppgenAlt,
|
||||
genClearMobile = cppgenClearMobile,
|
||||
genDeclaration = cppgenDeclaration,
|
||||
genDirectedVariable = cppgenDirectedVariable,
|
||||
genForwardDeclaration = cppgenForwardDeclaration,
|
||||
genGetTime = cppgenGetTime,
|
||||
|
@ -472,6 +473,14 @@ cppgenProcCall n as
|
|||
call genActuals as
|
||||
tell [");"]
|
||||
|
||||
cppgenDeclaration :: A.Type -> A.Name -> Bool -> CGen ()
|
||||
cppgenDeclaration A.Timer n _
|
||||
= do call genType A.Timer
|
||||
tell [" "]
|
||||
genName n
|
||||
tell [";"]
|
||||
cppgenDeclaration t n b = cgenDeclaration t n b
|
||||
|
||||
-- | Changed because we initialise channels and arrays differently in C++
|
||||
cppdeclareInit :: Meta -> A.Type -> A.Variable -> Maybe (CGen ())
|
||||
cppdeclareInit m t@(A.Array ds t') var
|
||||
|
|
Loading…
Reference in New Issue
Block a user