ghc-7.4.2: The GHC API

Safe HaskellNone

CgUtils

Synopsis

Documentation

addIdReps :: [Id] -> [(CgRep, Id)]Source

emitRtsCallSource

Arguments

:: PackageId

package the function is in

-> FastString

name of function

-> [CmmHinted CmmExpr]

function args

-> Code

cmm code

Emit code to call a Cmm function.

assignTemp :: CmmExpr -> FCode CmmExprSource

If the expression is trivial, return it. Otherwise, assign the expression to a temporary register and return an expression referring to this register.

assignTemp_ :: CmmExpr -> FCode CmmExprSource

If the expression is trivial and doesn't refer to a global register, return it. Otherwise, assign the expression to a temporary register and return an expression referring to this register.

callerSaves :: GlobalReg -> BoolSource

Returns True if this global register is stored in a caller-saves machine register.

get_GlobalReg_addr :: GlobalReg -> CmmExprSource

We map STG registers onto appropriate CmmExprs. Either they map to real machine registers or stored as offsets from BaseReg. Given a GlobalReg, get_GlobalReg_addr always produces the register table address for it.

activeStgRegs :: [GlobalReg]Source

Here is where the STG register map is defined for each target arch. The order matters (for the llvm backend anyway)! We must make sure to maintain the order here with the order used in the LLVM calling conventions. Note that also, this isn't all registers, just the ones that are currently possbily mapped to real registers.

fixStgRegisters :: RawCmmDecl -> RawCmmDeclSource

Fixup global registers so that they assign to locations within the RegTable if they aren't pinned for the current target.