Update register CFG initialization for new label and value fields.

This commit is contained in:
Kevin Quick 2018-08-10 15:06:04 -07:00
parent da991102e7
commit 05a4d96cd7
No known key found for this signature in database
GPG Key ID: E6D7733599CC0A21

View File

@ -127,14 +127,16 @@ mkCrucCFG archFns halloc nm action = do
h <- C.mkHandle' halloc nm argTypes macawStructRepr
let ps0 = initCrucPersistentState 1
blockRes <- runMacawMonad ps0 action
blks <-
(blks, finalSt) <-
case blockRes of
(Left err, _) -> fail err
(Right blks, _) -> pure blks
(Right blks, fs) -> pure (blks, fs)
-- Create control flow graph
let rg :: CR.CFG (MacawExt arch) s (MacawFunctionArgs arch) (MacawFunctionResult arch)
rg = CR.CFG { CR.cfgHandle = h
, CR.cfgBlocks = blks
, CR.cfgNextValue = valueCount finalSt
, CR.cfgNextLabel = length blks
}
crucGenArchConstraints archFns $
pure $ C.toSSA rg