[commit: ghc] wip/kavon-nosplit-llvm: there's no need for so many spaces (c3300f7)

git at git.haskell.org git at git.haskell.org
Tue Jun 27 09:15:44 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/kavon-nosplit-llvm
Link       : http://ghc.haskell.org/trac/ghc/changeset/c3300f7e336cf31ec8420760040e6ec08541e055/ghc

>---------------------------------------------------------------

commit c3300f7e336cf31ec8420760040e6ec08541e055
Author: Kavon Farvardin <kavon at farvard.in>
Date:   Thu Jun 1 12:20:56 2017 +0100

    there's no need for so many spaces


>---------------------------------------------------------------

c3300f7e336cf31ec8420760040e6ec08541e055
 compiler/llvmGen/Llvm/Types.hs | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/compiler/llvmGen/Llvm/Types.hs b/compiler/llvmGen/Llvm/Types.hs
index 8e04ed7..03c404d 100644
--- a/compiler/llvmGen/Llvm/Types.hs
+++ b/compiler/llvmGen/Llvm/Types.hs
@@ -70,8 +70,8 @@ instance Outputable LlvmType where
   ppr (LMVector nr tp ) = char '<' <> ppr nr <> text " x " <> ppr tp <> char '>'
   ppr (LMLabel        ) = text "label"
   ppr (LMVoid         ) = text "void"
-  ppr (LMStruct tys   ) = text "<{" <> ppCommaJoin tys <> text "}>"
-  ppr (LMStructU tys  ) = text "{" <> ppCommaJoin tys <> text "}"
+  ppr (LMStruct tys   ) = text "<{" <> ppSlimCommaJoin tys <> text "}>"
+  ppr (LMStructU tys  ) = text "{" <> ppSlimCommaJoin tys <> text "}"
   ppr (LMMetadata     ) = text "metadata"
 
   ppr (LMFunction (LlvmFunctionDecl _ _ _ r varg p _))
@@ -83,11 +83,11 @@ ppParams :: LlvmParameterListType -> [LlvmParameter] -> SDoc
 ppParams varg p
   = let varg' = case varg of
           VarArgs | null args -> sLit "..."
-                  | otherwise -> sLit ", ..."
+                  | otherwise -> sLit ",..."
           _otherwise          -> sLit ""
         -- by default we don't print param attributes
         args = map fst p
-    in ppCommaJoin args <> ptext varg'
+    in ppSlimCommaJoin args <> ptext varg'
 
 -- | An LLVM section definition. If Nothing then let LLVM decide the section
 type LMSection = Maybe LMString
@@ -896,6 +896,10 @@ fixEndian = reverse
 -- * Misc functions
 --------------------------------------------------------------------------------
 
+-- no spaces version of CommaJoin
+ppSlimCommaJoin :: (Outputable a) => [a] -> SDoc
+ppSlimCommaJoin strs = hcat $ punctuate comma (map ppr strs)
+
 ppCommaJoin :: (Outputable a) => [a] -> SDoc
 ppCommaJoin strs = hsep $ punctuate comma (map ppr strs)
 



More information about the ghc-commits mailing list