Commit 4dc7d04e authored by Simon Marlow's avatar Simon Marlow

replaceLabels: null out the cml_cont field of CmmCall

This fixes a CmmLint complaint when doing proc-point splitting.
parent 92957808
......@@ -354,7 +354,10 @@ replaceBranches env cmmg
last (CmmBranch id) = CmmBranch (lookup id)
last (CmmCondBranch e ti fi) = CmmCondBranch e (lookup ti) (lookup fi)
last (CmmSwitch e tbl) = CmmSwitch e (map (fmap lookup) tbl)
last l@(CmmCall {}) = l
last l@(CmmCall {}) = l { cml_cont = Nothing }
-- NB. remove the continuation of a CmmCall, since this
-- label will now be in a different CmmProc. Not only
-- is this tidier, it stops CmmLint from complaining.
last l@(CmmForeignCall {}) = l
lookup id = fmap lookup (mapLookup id env) `orElse` id
-- XXX: this is a recursive lookup, it follows chains
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment