mirror of
https://github.com/GaloisInc/macaw.git
synced 2024-11-27 12:52:52 +03:00
Marginally improve compile times
Disable a few optimizations in the TH-generated modules and add a fallthrough case to prevent the coverage checker from firing.
This commit is contained in:
parent
7256fd597f
commit
c7af261d66
@ -2,6 +2,7 @@
|
||||
{-# LANGUAGE GADTs #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE TypeApplications #-}
|
||||
{-# OPTIONS_GHC -fno-spec-constr -fno-specialise -fmax-simplifier-iterations=1 -fno-call-arity #-}
|
||||
module Data.Macaw.PPC.Semantics.PPC32
|
||||
( execInstruction
|
||||
) where
|
||||
|
@ -2,6 +2,7 @@
|
||||
{-# LANGUAGE GADTs #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE TypeApplications #-}
|
||||
{-# OPTIONS_GHC -fno-spec-constr -fno-specialise -fmax-simplifier-iterations=1 -fno-call-arity #-}
|
||||
module Data.Macaw.PPC.Semantics.PPC64
|
||||
( execInstruction
|
||||
) where
|
||||
|
@ -97,7 +97,12 @@ instructionMatcher ltr specialCases formulas = do
|
||||
opcodeVar <- newName "opcode"
|
||||
operandListVar <- newName "operands"
|
||||
let normalCases = map (mkSemanticsCase ltr ipVarName operandListVar) (Map.toList formulas)
|
||||
lamE [varP ipVarName, conP 'D.Instruction [varP opcodeVar, varP operandListVar]] (caseE (varE opcodeVar) (normalCases ++ specialCases))
|
||||
let fallthroughCase = match wildP (normalB [| error ("Unimplemented instruction: " ++ show $(varE opcodeVar)) |]) []
|
||||
let allCases = concat [ normalCases
|
||||
, specialCases
|
||||
, [fallthroughCase]
|
||||
]
|
||||
lamE [varP ipVarName, conP 'D.Instruction [varP opcodeVar, varP operandListVar]] (caseE (varE opcodeVar) allCases)
|
||||
|
||||
-- | Generate a single case for one opcode of the case expression.
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user