diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-02-03 17:57:29 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-02-20 21:18:48 -0500 |
commit | 6880d6aa1e6e96579bbff89712efd813489cc828 (patch) | |
tree | f2156d5a5c168bf28ee569a62a74b51adf74dac9 /compiler/GHC/Llvm | |
parent | 74ad75e87317196c600dfabc61aee1b87d95c214 (diff) | |
download | haskell-6880d6aa1e6e96579bbff89712efd813489cc828.tar.gz |
Disentangle DynFlags and SDoc
Remove several uses of `sdocWithDynFlags`. The remaining ones are mostly
CodeGen related (e.g. depend on target platform constants) and will be
fixed separately.
Metric Decrease:
T12425
T9961
WWRec
T1969
T14683
Diffstat (limited to 'compiler/GHC/Llvm')
-rw-r--r-- | compiler/GHC/Llvm/Ppr.hs | 5 | ||||
-rw-r--r-- | compiler/GHC/Llvm/Types.hs | 9 |
2 files changed, 6 insertions, 8 deletions
diff --git a/compiler/GHC/Llvm/Ppr.hs b/compiler/GHC/Llvm/Ppr.hs index 0e8d279a50..092dec39fb 100644 --- a/compiler/GHC/Llvm/Ppr.hs +++ b/compiler/GHC/Llvm/Ppr.hs @@ -87,9 +87,8 @@ ppLlvmGlobal (LMGlobal var@(LMGlobalVar _ _ link x a c) dat) = in ppAssignment var $ ppr link <+> text const <+> rhs <> sect <> align $+$ newLine -ppLlvmGlobal (LMGlobal var val) = sdocWithDynFlags $ \dflags -> - error $ "Non Global var ppr as global! " - ++ showSDoc dflags (ppr var) ++ " " ++ showSDoc dflags (ppr val) +ppLlvmGlobal (LMGlobal var val) = pprPanic "ppLlvmGlobal" $ + text "Non Global var ppr as global! " <> ppr var <> text "=" <> ppr val -- | Print out a list of LLVM type aliases. diff --git a/compiler/GHC/Llvm/Types.hs b/compiler/GHC/Llvm/Types.hs index f4fa9a9a56..61c2b2cb86 100644 --- a/compiler/GHC/Llvm/Types.hs +++ b/compiler/GHC/Llvm/Types.hs @@ -196,9 +196,9 @@ pprStaticArith s1 s2 int_op float_op op_name = op = if isFloat ty1 then float_op else int_op in if ty1 == getStatType s2 then ppr ty1 <+> ptext op <+> lparen <> ppr s1 <> comma <> ppr s2 <> rparen - else sdocWithDynFlags $ \dflags -> - error $ op_name ++ " with different types! s1: " - ++ showSDoc dflags (ppr s1) ++ ", s2: " ++ showSDoc dflags (ppr s2) + else pprPanic "pprStaticArith" $ + text op_name <> text " with different types! s1: " <> ppr s1 + <> text", s2: " <> ppr s2 -- ----------------------------------------------------------------------------- -- ** Operations on LLVM Basic Types and Variables @@ -228,8 +228,7 @@ ppLit (LMIntLit i (LMInt 64)) = ppr (fromInteger i :: Int64) ppLit (LMIntLit i _ ) = ppr ((fromInteger i)::Int) ppLit (LMFloatLit r LMFloat ) = ppFloat $ narrowFp r ppLit (LMFloatLit r LMDouble) = ppDouble r -ppLit f@(LMFloatLit _ _) = sdocWithDynFlags (\dflags -> - error $ "Can't print this float literal!" ++ showSDoc dflags (ppr f)) +ppLit f@(LMFloatLit _ _) = pprPanic "ppLit" (text "Can't print this float literal: " <> ppr f) ppLit (LMVectorLit ls ) = char '<' <+> ppCommaJoin ls <+> char '>' ppLit (LMNullLit _ ) = text "null" -- #11487 was an issue where we passed undef for some arguments |