diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-06-29 18:20:51 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-07-16 13:25:41 -0400 |
commit | f1c449910256c61cb35e361a367d5209bc51cc7a (patch) | |
tree | 1e2f0951f4e3b24d6c7075834526aca24711c7cd /compiler/GHC/CmmToLlvm | |
parent | 28347d7141761fc5c3c9bd66e5c4b2ea1c16f58a (diff) | |
download | haskell-f1c449910256c61cb35e361a367d5209bc51cc7a.tar.gz |
cmm: Eliminate orphan Outputable instances
Here we reorganize `GHC.Cmm` to eliminate the orphan `Outputable` and
`OutputableP` instances for the Cmm AST. This makes it significantly
easier to use the Cmm pretty-printers in tracing output without
incurring module import cycles.
Diffstat (limited to 'compiler/GHC/CmmToLlvm')
-rw-r--r-- | compiler/GHC/CmmToLlvm/Base.hs | 1 | ||||
-rw-r--r-- | compiler/GHC/CmmToLlvm/CodeGen.hs | 7 |
2 files changed, 3 insertions, 5 deletions
diff --git a/compiler/GHC/CmmToLlvm/Base.hs b/compiler/GHC/CmmToLlvm/Base.hs index f72411c4ec..33592092de 100644 --- a/compiler/GHC/CmmToLlvm/Base.hs +++ b/compiler/GHC/CmmToLlvm/Base.hs @@ -42,7 +42,6 @@ import GHC.CmmToLlvm.Regs import GHC.CmmToLlvm.Config import GHC.Cmm.CLabel -import GHC.Cmm.Ppr.Expr () import GHC.Platform.Regs ( activeStgRegs, globalRegMaybe ) import GHC.Driver.Session import GHC.Data.FastString diff --git a/compiler/GHC/CmmToLlvm/CodeGen.hs b/compiler/GHC/CmmToLlvm/CodeGen.hs index f44fe1af6e..55c6e18883 100644 --- a/compiler/GHC/CmmToLlvm/CodeGen.hs +++ b/compiler/GHC/CmmToLlvm/CodeGen.hs @@ -19,7 +19,6 @@ import GHC.CmmToLlvm.Regs import GHC.Cmm.BlockId import GHC.Cmm.CLabel import GHC.Cmm -import GHC.Cmm.Ppr as PprCmm import GHC.Cmm.Utils import GHC.Cmm.Switch import GHC.Cmm.Dataflow.Block @@ -1204,7 +1203,7 @@ genStore_slow addr val alignment meta = do other -> pprPanic "genStore: ptr not right type!" - (PprCmm.pprExpr platform addr <+> text ( + (pdoc platform addr <+> text ( "Size of Ptr: " ++ show (llvmPtrBits platform) ++ ", Size of var: " ++ show (llvmWidthInBits platform other) ++ ", Var: " ++ renderWithContext (llvmCgContext cfg) (ppVar cfg vaddr))) @@ -1725,7 +1724,7 @@ genMachOp_slow opt op [x, y] = case op of -> do -- Error. Continue anyway so we can debug the generated ll file. let render = renderWithContext (llvmCgContext cfg) - cmmToStr = (lines . render . PprCmm.pprExpr platform) + cmmToStr = (lines . render . pdoc platform) statement $ Comment $ map fsLit $ cmmToStr x statement $ Comment $ map fsLit $ cmmToStr y doExprW (ty vx) $ binOp vx vy @@ -1882,7 +1881,7 @@ genLoad_slow atomic e ty align meta = do doExprW (cmmToLlvmType ty) (MExpr meta $ mkLoad atomic ptr align) other -> pprPanic "exprToVar: CmmLoad expression is not right type!" - (PprCmm.pprExpr platform e <+> text ( + (pdoc platform e <+> text ( "Size of Ptr: " ++ show (llvmPtrBits platform) ++ ", Size of var: " ++ show (llvmWidthInBits platform other) ++ ", Var: " ++ renderWithContext (llvmCgContext cfg) (ppVar cfg iptr))) |