X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fcmm%2FCmmCvt.hs;h=7b22958f2414e5cc8e233585f8fc0f2c6bdc280d;hp=35ebb4f56ba32daa06124699ded3f0833fb8c1b3;hb=45cbf5e1207b4850dcaf7b94b053cc397f5642fe;hpb=9d2b0ebb2a6c43d6cd4f27e763897cc06592f5a0 diff --git a/compiler/cmm/CmmCvt.hs b/compiler/cmm/CmmCvt.hs index 35ebb4f..7b22958 100644 --- a/compiler/cmm/CmmCvt.hs +++ b/compiler/cmm/CmmCvt.hs @@ -27,7 +27,7 @@ cmmOfZgraph = cmmMapGraph ofZgraph toZgraph :: String -> ListGraph CmmStmt -> UniqSM CmmGraph toZgraph _ (ListGraph []) = lgraphOfAGraph emptyAGraph -toZgraph fun_name (ListGraph (BasicBlock id ss : other_blocks)) = +toZgraph fun_name g@(ListGraph (BasicBlock id ss : other_blocks)) = labelAGraph id $ mkStmts ss <*> foldr addBlock emptyAGraph other_blocks where addBlock (BasicBlock id ss) g = mkLabel id <*> mkStmts ss <*> g mkStmts (CmmNop : ss) = mkNop <*> mkStmts ss @@ -43,8 +43,7 @@ toZgraph fun_name (ListGraph (BasicBlock id ss : other_blocks)) = mkStmts (last : []) = mkLast last mkStmts [] = bad "fell off end" mkStmts (_ : _ : _) = bad "last node not at end" - bad msg = panic (msg {- ++ " in block " ++ showSDoc (ppr b) -} - ++ " in function " ++ fun_name) + bad msg = pprPanic (msg ++ " in function " ++ fun_name) (ppr g) mkLast (CmmCall f [] args _ CmmNeverReturns) = mkFinalCall f args mkLast (CmmSwitch scrutinee table) = mkSwitch scrutinee table mkLast (CmmJump tgt args) = mkJump tgt args