projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix numeric escape sequences parsing
[ghc-hetmet.git]
/
compiler
/
codeGen
/
StgCmmMonad.hs
diff --git
a/compiler/codeGen/StgCmmMonad.hs
b/compiler/codeGen/StgCmmMonad.hs
index
c1f743d
..
f1823bd
100644
(file)
--- a/
compiler/codeGen/StgCmmMonad.hs
+++ b/
compiler/codeGen/StgCmmMonad.hs
@@
-10,7
+10,7
@@
module StgCmmMonad (
FCode, -- type
initC, thenC, thenFC, listCs, listFCs, mapCs, mapFCs,
FCode, -- type
initC, thenC, thenFC, listCs, listFCs, mapCs, mapFCs,
- returnFC, fixC, nopC, whenC,
+ returnFC, fixC, fixC_, nopC, whenC,
newUnique, newUniqSupply,
emit, emitData, emitProc, emitProcWithConvention, emitSimpleProc,
newUnique, newUniqSupply,
emit, emitData, emitProc, emitProcWithConvention, emitSimpleProc,
@@
-149,6
+149,8
@@
fixC fcode = FCode (
result
)
result
)
+fixC_ :: (a -> FCode a) -> FCode ()
+fixC_ fcode = fixC fcode >> return ()
--------------------------------------------------------
-- The code generator environment
--------------------------------------------------------
-- The code generator environment
@@
-213,6
+215,9
@@
data Sequel
-- space that's unused on this path?
-- We need to do this only if the expression may
-- allocate (e.g. it's a foreign call or allocating primOp)
-- space that's unused on this path?
-- We need to do this only if the expression may
-- allocate (e.g. it's a foreign call or allocating primOp)
+instance Show Sequel where
+ show (Return _) = "Sequel: Return"
+ show (AssignTo _ _) = "Sequel: Assign"
initCgInfoDown :: DynFlags -> Module -> CgInfoDownwards
initCgInfoDown dflags mod
initCgInfoDown :: DynFlags -> Module -> CgInfoDownwards
initCgInfoDown dflags mod
@@
-255,7
+260,9
@@
data CgState
data HeapUsage =
HeapUsage {
virtHp :: VirtualHpOffset, -- Virtual offset of highest-allocated word
data HeapUsage =
HeapUsage {
virtHp :: VirtualHpOffset, -- Virtual offset of highest-allocated word
+ -- Incremented whenever we allocate
realHp :: VirtualHpOffset -- realHp: Virtual offset of real heap ptr
realHp :: VirtualHpOffset -- realHp: Virtual offset of real heap ptr
+ -- Used in instruction addressing modes
}
type VirtualHpOffset = WordOff
}
type VirtualHpOffset = WordOff
@@
-504,7
+511,7
@@
forkProc body_code
= do { info_down <- getInfoDown
; us <- newUniqSupply
; state <- getState
= do { info_down <- getInfoDown
; us <- newUniqSupply
; state <- getState
- ; let info_down' = info_down { cgd_sequel = initSequel }
+ ; let info_down' = info_down -- { cgd_sequel = initSequel }
fork_state_in = (initCgState us) { cgs_binds = cgs_binds state }
(result, fork_state_out) = doFCode body_code info_down' fork_state_in
; setState $ state `addCodeBlocksFrom` fork_state_out
fork_state_in = (initCgState us) { cgs_binds = cgs_binds state }
(result, fork_state_out) = doFCode body_code info_down' fork_state_in
; setState $ state `addCodeBlocksFrom` fork_state_out
@@
-598,13
+605,13
@@
emitProcWithConvention :: Convention -> CmmInfo -> CLabel -> CmmFormals ->
emitProcWithConvention conv info lbl args blocks
= do { us <- newUniqSupply
; let (offset, entry) = mkEntry (mkBlockId $ uniqFromSupply us) conv args
emitProcWithConvention conv info lbl args blocks
= do { us <- newUniqSupply
; let (offset, entry) = mkEntry (mkBlockId $ uniqFromSupply us) conv args
- blks = initUs_ us $ lgraphOfAGraph offset $ entry <*> blocks
- ; let proc_block = CmmProc info lbl args blks
+ blks = initUs_ us $ lgraphOfAGraph $ entry <*> blocks
+ ; let proc_block = CmmProc info lbl args ((offset, Just initUpdFrameOff), blks)
; state <- getState
; setState $ state { cgs_tops = cgs_tops state `snocOL` proc_block } }
emitProc :: CmmInfo -> CLabel -> CmmFormals -> CmmAGraph -> FCode ()
; state <- getState
; setState $ state { cgs_tops = cgs_tops state `snocOL` proc_block } }
emitProc :: CmmInfo -> CLabel -> CmmFormals -> CmmAGraph -> FCode ()
-emitProc = emitProcWithConvention Native
+emitProc = emitProcWithConvention NativeNodeCall
emitSimpleProc :: CLabel -> CmmAGraph -> FCode ()
emitSimpleProc lbl code =
emitSimpleProc :: CLabel -> CmmAGraph -> FCode ()
emitSimpleProc lbl code =
@@
-630,5
+637,5
@@
getCmm code
cgStmtsToBlocks :: CmmAGraph -> FCode CmmGraph
cgStmtsToBlocks stmts
= do { us <- newUniqSupply
cgStmtsToBlocks :: CmmAGraph -> FCode CmmGraph
cgStmtsToBlocks stmts
= do { us <- newUniqSupply
- ; return (initUs_ us (lgraphOfAGraph 0 stmts)) }
+ ; return (initUs_ us (lgraphOfAGraph stmts)) }