Count CFEExit as control flow for the purposes of finding dominators
This commit is contained in:
parent
2842ce97b8
commit
c05380d518
|
@ -192,7 +192,7 @@ buildGraph params root =
|
||||||
base
|
base
|
||||||
|
|
||||||
idToRange = M.fromList mapping
|
idToRange = M.fromList mapping
|
||||||
isRealEdge (from, to, edge) = case edge of CFEFlow -> True; _ -> False
|
isRealEdge (from, to, edge) = case edge of CFEFlow -> True; CFEExit -> True; _ -> False
|
||||||
onlyRealEdges = filter isRealEdge edges
|
onlyRealEdges = filter isRealEdge edges
|
||||||
(_, mainExit) = fromJust $ M.lookup (getId root) idToRange
|
(_, mainExit) = fromJust $ M.lookup (getId root) idToRange
|
||||||
|
|
||||||
|
@ -1301,7 +1301,10 @@ findPostDominators mainexit graph = asArray
|
||||||
reversed = grev withExitEdges
|
reversed = grev withExitEdges
|
||||||
postDoms = dom reversed mainexit
|
postDoms = dom reversed mainexit
|
||||||
(_, maxNode) = nodeRange graph
|
(_, maxNode) = nodeRange graph
|
||||||
asArray = array (0, maxNode) postDoms
|
-- Holes in the array cause "Exception: (Array.!): undefined array element" while
|
||||||
|
-- inspecting/debugging, so fill the array first and then update.
|
||||||
|
initializedArray = listArray (0, maxNode) $ repeat []
|
||||||
|
asArray = initializedArray // postDoms
|
||||||
|
|
||||||
return []
|
return []
|
||||||
runTests = $( [| $(forAllProperties) (quickCheckWithResult (stdArgs { maxSuccess = 1 }) ) |])
|
runTests = $( [| $(forAllProperties) (quickCheckWithResult (stdArgs { maxSuccess = 1 }) ) |])
|
||||||
|
|
Loading…
Reference in New Issue