Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
48bb69ac
Commit
48bb69ac
authored
Dec 11, 2012
by
ian@well-typed.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small refactoring: Use more idiomatic strictness forcing in AsmCodeGen
parent
497cb612
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
compiler/nativeGen/AsmCodeGen.lhs
compiler/nativeGen/AsmCodeGen.lhs
+5
-7
No files found.
compiler/nativeGen/AsmCodeGen.lhs
View file @
48bb69ac
...
...
@@ -80,6 +80,7 @@ import qualified Stream
import Data.List
import Data.Maybe
import Control.Exception
import Control.Monad
import System.IO
...
...
@@ -363,19 +364,16 @@ cmmNativeGens dflags ncgImpl h us (cmm : cmms) impAcc profAcc count
$ withPprStyleDoc dflags (mkCodeStyle AsmStyle)
$ vcat $ map (pprNatCmmDecl ncgImpl) native
-- carefully evaluate this strictly. Binding it with 'let'
-- and then using 'seq' doesn't work, because the let
-- apparently gets inlined first.
lsPprNative <- return $!
let !lsPprNative =
if dopt Opt_D_dump_asm dflags
|| dopt Opt_D_dump_asm_stats dflags
then native
else []
count'
<- return $!
count + 1
;
let !
count'
=
count + 1
-- force evaulation all this stuff to avoid space leaks
{-# SCC "seqString" #-} seqString (showSDoc dflags $ vcat $ map ppr imports)
`seq` return ()
{-# SCC "seqString" #-}
evaluate $
seqString (showSDoc dflags $ vcat $ map ppr imports)
cmmNativeGens dflags ncgImpl
h us' cmms
...
...
@@ -384,7 +382,7 @@ cmmNativeGens dflags ncgImpl h us (cmm : cmms) impAcc profAcc count
count'
where seqString [] = ()
seqString (x:xs) = x `seq` seqString xs
`seq` ()
seqString (x:xs) = x `seq` seqString xs
-- | Complete native code generation phase for a single top-level chunk of Cmm.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment