diff options
author | Jan Stolarek <jan.stolarek@p.lodz.pl> | 2013-08-29 10:56:48 +0100 |
---|---|---|
committer | Jan Stolarek <jan.stolarek@p.lodz.pl> | 2013-08-29 12:56:09 +0100 |
commit | 1d1ab12d084c07bd6aee03177ef6008c7ab08127 (patch) | |
tree | 8938200a404ff9f471fcc1c4441e82cff989963a /compiler/codeGen | |
parent | c86831b96776f28c1eeb6e49744d2ddbae4f3bb9 (diff) | |
download | haskell-1d1ab12d084c07bd6aee03177ef6008c7ab08127.tar.gz |
Whitespaces and comment formatting
Diffstat (limited to 'compiler/codeGen')
-rw-r--r-- | compiler/codeGen/StgCmmClosure.hs | 37 | ||||
-rw-r--r-- | compiler/codeGen/StgCmmMonad.hs | 27 |
2 files changed, 31 insertions, 33 deletions
diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index 611a570d70..3b9f38d36b 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -122,23 +122,23 @@ isGcPtrRep _ = False -- tail call or return that identifier. data LambdaFormInfo - = LFReEntrant -- Reentrant closure (a function) - TopLevelFlag -- True if top level - !RepArity -- Arity. Invariant: always > 0 - !Bool -- True <=> no fvs + = LFReEntrant -- Reentrant closure (a function) + TopLevelFlag -- True if top level + !RepArity -- Arity. Invariant: always > 0 + !Bool -- True <=> no fvs ArgDescr -- Argument descriptor (should really be in ClosureInfo) - | LFThunk -- Thunk (zero arity) + | LFThunk -- Thunk (zero arity) TopLevelFlag - !Bool -- True <=> no free vars - !Bool -- True <=> updatable (i.e., *not* single-entry) + !Bool -- True <=> no free vars + !Bool -- True <=> updatable (i.e., *not* single-entry) StandardFormInfo - !Bool -- True <=> *might* be a function type + !Bool -- True <=> *might* be a function type - | LFCon -- A saturated constructor application - DataCon -- The constructor + | LFCon -- A saturated constructor application + DataCon -- The constructor - | LFUnknown -- Used for function arguments and imported things. + | LFUnknown -- Used for function arguments and imported things. -- We know nothing about this closure. -- Treat like updatable "LFThunk"... -- Imported things which we *do* know something about use @@ -149,10 +149,10 @@ data LambdaFormInfo -- because then we know the entry code will do -- For a function, the entry code is the fast entry point - | LFUnLifted -- A value of unboxed type; + | LFUnLifted -- A value of unboxed type; -- always a value, needs evaluation - | LFLetNoEscape -- See LetNoEscape module for precise description + | LFLetNoEscape -- See LetNoEscape module for precise description | LFBlackHole -- Used for the closures allocated to hold the result -- of a CAF. We want the target of the update frame to @@ -175,7 +175,7 @@ data StandardFormInfo -- case x of -- con a1,..,an -> ak -- and the constructor is from a single-constr type. - WordOff -- 0-origin offset of ak within the "goods" of + WordOff -- 0-origin offset of ak within the "goods" of -- constructor (Recall that the a1,...,an may be laid -- out in the heap in a non-obvious order.) @@ -205,9 +205,9 @@ mkLFLetNoEscape :: LambdaFormInfo mkLFLetNoEscape = LFLetNoEscape ------------- -mkLFReEntrant :: TopLevelFlag -- True of top level - -> [Id] -- Free vars - -> [Id] -- Args +mkLFReEntrant :: TopLevelFlag -- True of top level + -> [Id] -- Free vars + -> [Id] -- Args -> ArgDescr -- Argument descriptor -> LambdaFormInfo @@ -256,7 +256,7 @@ mkLFImported :: Id -> LambdaFormInfo mkLFImported id | Just con <- isDataConWorkId_maybe id , isNullaryRepDataCon con - = LFCon con -- An imported nullary constructor + = LFCon con -- An imported nullary constructor -- We assume that the constructor is evaluated so that -- the id really does point directly to the constructor @@ -680,7 +680,6 @@ mkCmmInfo ClosureInfo {..} , cit_prof = closureProf , cit_srt = NoC_SRT } - -------------------------------------- -- Building ClosureInfos -------------------------------------- diff --git a/compiler/codeGen/StgCmmMonad.hs b/compiler/codeGen/StgCmmMonad.hs index d5e893afd9..ddb677a49e 100644 --- a/compiler/codeGen/StgCmmMonad.hs +++ b/compiler/codeGen/StgCmmMonad.hs @@ -216,12 +216,12 @@ instance Outputable CgLoc where -- Sequel tells what to do with the result of this expression data Sequel - = Return Bool -- Return result(s) to continuation found on the stack - -- True <=> the continuation is update code (???) + = Return Bool -- Return result(s) to continuation found on the stack. + -- True <=> the continuation is update code (???) | AssignTo - [LocalReg] -- Put result(s) in these regs and fall through - -- NB: no void arguments here + [LocalReg] -- Put result(s) in these regs and fall through + -- NB: no void arguments here -- Bool -- Should we adjust the heap pointer back to -- recover space that's unused on this path? @@ -338,10 +338,10 @@ data CgState data HeapUsage = HeapUsage { - virtHp :: VirtualHpOffset, -- Virtual offset of highest-allocated word - -- Incremented whenever we allocate + virtHp :: VirtualHpOffset, -- Virtual offset of highest-allocated word + -- Incremented whenever we allocate realHp :: VirtualHpOffset -- realHp: Virtual offset of real heap ptr - -- Used in instruction addressing modes + -- Used in instruction addressing modes } type VirtualHpOffset = WordOff @@ -571,10 +571,10 @@ codeOnly :: FCode () -> FCode () -- Used in almost-circular code to prevent false loop dependencies codeOnly body_code = do { info_down <- getInfoDown - ; us <- newUniqSupply - ; state <- getState - ; let fork_state_in = (initCgState us) { cgs_binds = cgs_binds state, - cgs_hp_usg = cgs_hp_usg state } + ; us <- newUniqSupply + ; state <- getState + ; let fork_state_in = (initCgState us) { cgs_binds = cgs_binds state + , cgs_hp_usg = cgs_hp_usg state } ((), fork_state_out) = doFCode body_code info_down fork_state_in ; setState $ state `addCodeBlocksFrom` fork_state_out } @@ -593,9 +593,8 @@ forkAlts branch_fcodes where (us1,us2) = splitUniqSupply us branch_state = (initCgState us1) { - cgs_binds = cgs_binds state, - cgs_hp_usg = cgs_hp_usg state } - + cgs_binds = cgs_binds state + , cgs_hp_usg = cgs_hp_usg state } (_us, results) = mapAccumL compile us branch_fcodes (branch_results, branch_out_states) = unzip results ; setState $ foldl stateIncUsage state branch_out_states |