[commit: ghc] wip/kavon-nosplit-llvm: just using mapToList; the maps aren't big anyways (6c1e020)

git at git.haskell.org git at git.haskell.org
Tue Jun 27 09:16:25 UTC 2017


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

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

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

commit 6c1e0203383a451ad1d246c9a8c606ff5ed208d3
Author: Kavon Farvardin <kavon at farvard.in>
Date:   Wed Jun 7 11:27:15 2017 +0100

    just using mapToList; the maps aren't big anyways


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

6c1e0203383a451ad1d246c9a8c606ff5ed208d3
 compiler/llvmGen/LlvmCodeGen.hs      | 7 ++++++-
 compiler/llvmGen/LlvmCodeGen/Data.hs | 3 ++-
 compiler/main/CodeOutput.hs          | 3 ++-
 compiler/main/HscMain.hs             | 1 +
 4 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/compiler/llvmGen/LlvmCodeGen.hs b/compiler/llvmGen/LlvmCodeGen.hs
index b3a8cec..35c24aa 100644
--- a/compiler/llvmGen/LlvmCodeGen.hs
+++ b/compiler/llvmGen/LlvmCodeGen.hs
@@ -116,10 +116,15 @@ llvmGroupLlvmGens cmm = do
             joinInfo :: LabelMap ManglerStr -> RawCmmDecl -> LlvmM (LabelMap ManglerStr)
             joinInfo acc grp = case grp of
                 CmmProc info _ _ _ -> do
-                    newInfo <- mapMap cvtForMangler info 
+                    let asL = mapToList info
+                    newInfo <- foldM cvt mapEmpty asL
                     return $ mapUnion acc newInfo
                 CmmData _ _ -> return acc
                 
+            cvt acc (key, val) = do
+                str <- cvtForMangler val
+                return $ mapInsert key str acc
+                
         foldM joinInfo mapEmpty cmm
 
 -- -----------------------------------------------------------------------------
diff --git a/compiler/llvmGen/LlvmCodeGen/Data.hs b/compiler/llvmGen/LlvmCodeGen/Data.hs
index 4a97ff6..7be62d9 100644
--- a/compiler/llvmGen/LlvmCodeGen/Data.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Data.hs
@@ -11,6 +11,7 @@ module LlvmCodeGen.Data (
 
 import Llvm
 import LlvmCodeGen.Base
+import LlvmMangler ( ManglerStr )
 
 import BlockId
 import CLabel
@@ -152,5 +153,5 @@ genStaticLit (CmmHighStackMark)
     
 
 -- | Convert a CmmStatic into a byte string for the mangler
-cvtForMangler :: CmmStatics -> LlvmM B.ByteString
+cvtForMangler :: CmmStatics -> LlvmM ManglerStr
 cvtForMangler _ = error "implement cvtForMangler"
diff --git a/compiler/main/CodeOutput.hs b/compiler/main/CodeOutput.hs
index 487dd46..2f50105 100644
--- a/compiler/main/CodeOutput.hs
+++ b/compiler/main/CodeOutput.hs
@@ -19,13 +19,14 @@ import Finder           ( mkStubPaths )
 import PprC             ( writeCs )
 import CmmLint          ( cmmLint )
 import Packages
-import Cmm              ( RawCmmGroup, ManglerInfo )
+import Cmm              ( RawCmmGroup )
 import HscTypes
 import DynFlags
 import Config
 import SysTools
 import Stream           (Stream)
 import qualified Stream
+import LlvmMangler ( ManglerInfo )
 
 import ErrUtils
 import Outputable
diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs
index 7c660b0..10175c6 100644
--- a/compiler/main/HscMain.hs
+++ b/compiler/main/HscMain.hs
@@ -137,6 +137,7 @@ import FamInstEnv
 import Fingerprint      ( Fingerprint )
 import Hooks
 import TcEnv
+import LlvmMangler ( ManglerInfo )
 
 import DynFlags
 import ErrUtils



More information about the ghc-commits mailing list