[commit: ghc] wip/llvm-3.6: More TNTC cleanup (077940b)
git at git.haskell.org
git at git.haskell.org
Mon Jan 19 23:16:46 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/llvm-3.6
Link : http://ghc.haskell.org/trac/ghc/changeset/077940b9a4f5659722e48df505c2fa30e39a855f/ghc
>---------------------------------------------------------------
commit 077940b9a4f5659722e48df505c2fa30e39a855f
Author: Ben Gamari <bgamari.foss at gmail.com>
Date: Fri Nov 28 09:30:29 2014 -0500
More TNTC cleanup
>---------------------------------------------------------------
077940b9a4f5659722e48df505c2fa30e39a855f
compiler/llvmGen/LlvmCodeGen.hs | 7 +------
compiler/llvmGen/LlvmCodeGen/Base.hs | 7 -------
compiler/llvmGen/LlvmCodeGen/Ppr.hs | 6 +++---
3 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/compiler/llvmGen/LlvmCodeGen.hs b/compiler/llvmGen/LlvmCodeGen.hs
index 6120a72..f0c184a 100644
--- a/compiler/llvmGen/LlvmCodeGen.hs
+++ b/compiler/llvmGen/LlvmCodeGen.hs
@@ -138,13 +138,8 @@ cmmLlvmGen cmm at CmmProc{} = do
-- generate llvm code from cmm
llvmBC <- withClearVars $ genLlvmProc fixed_cmm
- -- allocate IDs for info table and code, so the mangler can later
- -- make sure they end up next to each other.
- itableSection <- freshSectionId
- _codeSection <- freshSectionId
-
-- pretty print
- (docs, ivars) <- fmap unzip $ mapM (pprLlvmCmmDecl itableSection) llvmBC
+ (docs, ivars) <- fmap unzip $ mapM pprLlvmCmmDecl llvmBC
-- Output, note down used variables
renderLlvm (vcat docs)
diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs
index c1111cf..a23b5ef 100644
--- a/compiler/llvmGen/LlvmCodeGen/Base.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Base.hs
@@ -24,7 +24,6 @@ module LlvmCodeGen.Base (
getMetaUniqueId,
setUniqMeta, getUniqMeta,
- freshSectionId,
cmmToLlvmType, widthToLlvmFloat, widthToLlvmInt, llvmFunTy,
llvmFunSig, llvmFunArgs, llvmStdFunAttrs, llvmFunAlign, llvmInfAlign,
@@ -194,7 +193,6 @@ data LlvmEnv = LlvmEnv
, envDynFlags :: DynFlags -- ^ Dynamic flags
, envOutput :: BufHandle -- ^ Output buffer
, envUniq :: UniqSupply -- ^ Supply of unique values
- , envNextSection :: Int -- ^ Supply of fresh section IDs
, envFreshMeta :: Int -- ^ Supply of fresh metadata IDs
, envUniqMeta :: UniqFM Int -- ^ Global metadata nodes
, envFunMap :: LlvmEnvMap -- ^ Global functions so far, with type
@@ -248,7 +246,6 @@ runLlvm dflags ver out us m = do
, envUniq = us
, envFreshMeta = 0
, envUniqMeta = emptyUFM
- , envNextSection = 1
}
-- | Get environment (internal)
@@ -353,10 +350,6 @@ setUniqMeta f m = modifyEnv $ \env -> env { envUniqMeta = addToUFM (envUniqMeta
getUniqMeta :: Unique -> LlvmM (Maybe Int)
getUniqMeta s = getEnv (flip lookupUFM s . envUniqMeta)
--- | Returns a fresh section ID
-freshSectionId :: LlvmM Int
-freshSectionId = LlvmM $ \env -> return (envNextSection env, env { envNextSection = envNextSection env + 1})
-
-- ----------------------------------------------------------------------------
-- * Internal functions
--
diff --git a/compiler/llvmGen/LlvmCodeGen/Ppr.hs b/compiler/llvmGen/LlvmCodeGen/Ppr.hs
index 321064c..ecd1d3c 100644
--- a/compiler/llvmGen/LlvmCodeGen/Ppr.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Ppr.hs
@@ -96,11 +96,11 @@ pprLlvmData (globals, types) =
-- | Pretty print LLVM code
-pprLlvmCmmDecl :: Int -> LlvmCmmDecl -> LlvmM (SDoc, [LlvmVar])
-pprLlvmCmmDecl _ (CmmData _ lmdata)
+pprLlvmCmmDecl :: LlvmCmmDecl -> LlvmM (SDoc, [LlvmVar])
+pprLlvmCmmDecl (CmmData _ lmdata)
= return (vcat $ map pprLlvmData lmdata, [])
-pprLlvmCmmDecl count (CmmProc mb_info entry_lbl live (ListGraph blks))
+pprLlvmCmmDecl (CmmProc mb_info entry_lbl live (ListGraph blks))
= do let lbl = case mb_info of
Nothing -> entry_lbl
Just (Statics info_lbl _) -> info_lbl
More information about the ghc-commits
mailing list