Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tobias Decking
GHC
Commits
5cf71826
Commit
5cf71826
authored
Sep 24, 2012
by
Simon Marlow
Browse files
Misc tidyup
parent
254f1a6c
Changes
6
Hide whitespace changes
Inline
Side-by-side
compiler/cmm/CmmBuildInfoTables.hs
View file @
5cf71826
...
...
@@ -19,19 +19,15 @@ where
#
include
"HsVersions.h"
-- These should not be imported here!
import
StgCmmUtils
import
Hoopl
import
Digraph
import
qualified
Prelude
as
P
import
Prelude
hiding
(
succ
)
import
BlockId
import
Bitmap
import
CLabel
import
PprCmmDecl
()
import
Cmm
import
CmmUtils
import
CmmInfo
import
Data.List
import
DynFlags
import
Maybes
...
...
@@ -47,6 +43,9 @@ import Data.Set (Set)
import
qualified
Data.Set
as
Set
import
Control.Monad
import
qualified
Prelude
as
P
import
Prelude
hiding
(
succ
)
foldSet
::
(
a
->
b
->
b
)
->
b
->
Set
a
->
b
foldSet
=
Set
.
foldr
...
...
@@ -228,7 +227,7 @@ maxBmpSize dflags = widthInBits (wordWidth dflags) `div` 2
-- Adapted from codeGen/StgCmmUtils, which converts from SRT to C_SRT.
to_SRT
::
DynFlags
->
CLabel
->
Int
->
Int
->
Bitmap
->
UniqSM
(
Maybe
CmmDecl
,
C_SRT
)
to_SRT
dflags
top_srt
off
len
bmp
|
len
>
maxBmpSize
dflags
||
bmp
==
[
toStgWord
dflags
(
fromStgHalfWord
(
srt
_e
scape
dflags
))]
|
len
>
maxBmpSize
dflags
||
bmp
==
[
toStgWord
dflags
(
fromStgHalfWord
(
srt
E
scape
dflags
))]
=
do
id
<-
getUniqueM
let
srt_desc_lbl
=
mkLargeSRTLabel
id
tbl
=
CmmData
RelocatableReadOnlyData
$
...
...
@@ -236,7 +235,7 @@ to_SRT dflags top_srt off len bmp
(
cmmLabelOffW
dflags
top_srt
off
:
mkWordCLit
dflags
(
toStgWord
dflags
(
fromIntegral
len
))
:
map
(
mkWordCLit
dflags
)
bmp
)
return
(
Just
tbl
,
C_SRT
srt_desc_lbl
0
(
srt
_e
scape
dflags
))
return
(
Just
tbl
,
C_SRT
srt_desc_lbl
0
(
srt
E
scape
dflags
))
|
otherwise
=
return
(
Nothing
,
C_SRT
top_srt
off
(
toStgHalfWord
dflags
(
fromStgWord
(
head
bmp
))))
-- The fromIntegral converts to StgHalfWord
...
...
compiler/cmm/CmmInfo.hs
View file @
5cf71826
...
...
@@ -9,6 +9,7 @@ module CmmInfo (
mkEmptyContInfoTable
,
cmmToRawCmm
,
mkInfoTable
,
srtEscape
)
where
#
include
"HsVersions.h"
...
...
@@ -384,3 +385,9 @@ newStringLit bytes
=
do
{
uniq
<-
getUniqueUs
;
return
(
mkByteStringCLit
uniq
bytes
)
}
-- Misc utils
-- | Value of the srt field of an info table when using an StgLargeSRT
srtEscape
::
DynFlags
->
StgHalfWord
srtEscape
dflags
=
toStgHalfWord
dflags
(
-
1
)
compiler/cmm/CmmLayoutStack.hs
View file @
5cf71826
...
...
@@ -3,9 +3,9 @@ module CmmLayoutStack (
cmmLayoutStack
,
setInfoTableStackMap
)
where
import
StgCmmUtils
(
callerSaveVolatileRegs
)
-- XXX
import
StgCmmForeign
(
saveThreadState
,
loadThreadState
)
-- XXX
import
StgCmmLayout
(
entryCode
)
-- XXX
import
StgCmmUtils
(
callerSaveVolatileRegs
)
-- XXX
layering violation
import
StgCmmForeign
(
saveThreadState
,
loadThreadState
)
-- XXX
layering violation
import
StgCmmLayout
(
entryCode
)
-- XXX
layering violation
import
Cmm
import
BlockId
...
...
compiler/cmm/CmmRewriteAssignments.hs
View file @
5cf71826
...
...
@@ -15,10 +15,11 @@ module CmmRewriteAssignments
(
rewriteAssignments
)
where
import
StgCmmUtils
-- XXX layering violation
import
Cmm
import
CmmUtils
import
CmmOpt
import
StgCmmUtils
import
DynFlags
import
UniqSupply
...
...
compiler/cmm/CmmSink.hs
View file @
5cf71826
...
...
@@ -3,7 +3,7 @@ module CmmSink (
cmmSink
)
where
import
StgCmmUtils
(
callerSaves
)
import
CodeGen.Platform
(
callerSaves
)
import
Cmm
import
BlockId
...
...
compiler/codeGen/StgCmmUtils.hs
View file @
5cf71826
...
...
@@ -37,9 +37,7 @@ module StgCmmUtils (
mkWordCLit
,
newStringCLit
,
newByteStringCLit
,
packHalfWordsCLit
,
blankWord
,
srt_escape
blankWord
)
where
#
include
"HsVersions.h"
...
...
@@ -719,6 +717,3 @@ assignTemp' e
let
reg
=
CmmLocal
lreg
emitAssign
reg
e
return
(
CmmReg
reg
)
srt_escape
::
DynFlags
->
StgHalfWord
srt_escape
dflags
=
toStgHalfWord
dflags
(
-
1
)
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