ghc-7.0.1: The GHC API



Base LLVM Code Generation module

Contains functions useful through out the code generator.



type LlvmUnresData = (CLabel, Section, LlvmType, [UnresStatic])Source

Unresolved code. Of the form: (data label, data type, unresolved data)

type LlvmData = ([LMGlobal], [LlvmType])Source

Top level LLVM Data (globals and type aliases)

type UnresLabel = CmmLitSource

An unresolved Label.

Labels are unresolved when we haven't yet determined if they are defined in the module we are currently compiling, or an external one.

type LlvmEnv = (LlvmEnvMap, LlvmEnvMap)Source

initLlvmEnv :: LlvmEnvSource

Get initial Llvm environment.

clearVars :: LlvmEnv -> LlvmEnvSource

Clear variables from the environment.

funLookup :: Uniquable key => key -> LlvmEnv -> Maybe LlvmTypeSource

Lookup functions in the environment.

funInsert :: Uniquable key => key -> LlvmType -> LlvmEnv -> LlvmEnvSource

Insert functions into the environment.

cmmToLlvmType :: CmmType -> LlvmTypeSource

Translate a basic CmmType to an LlvmType.

widthToLlvmFloat :: Width -> LlvmTypeSource

Translate a Cmm Float Width to a LlvmType.

widthToLlvmInt :: Width -> LlvmTypeSource

Translate a Cmm Bit Width to a LlvmType.

llvmFunTy :: LlvmTypeSource

Llvm Function type for Cmm function

llvmFunSig :: CLabel -> LlvmLinkageType -> LlvmFunctionDeclSource

Llvm Function signature

llvmStdFunAttrs :: [LlvmFuncAttr]Source

Llvm standard fun attributes

llvmFunAlign :: LMAlignSource

Alignment to use for functions

llvmInfAlign :: LMAlignSource

Alignment to use for into tables

llvmPtrBits :: IntSource

Pointer width

mkLlvmFunc :: CLabel -> LlvmLinkageType -> LMSection -> LlvmBlocks -> LlvmFunctionSource

Create a Haskell function in LLVM.

tysToParams :: [LlvmType] -> [LlvmParameter]Source

Convert a list of types to a list of function parameters (each with no parameter attributes)

genCmmLabelRef :: CLabel -> LMGlobalSource

Create an external definition for a CLabel defined in another module.