summaryrefslogtreecommitdiff
path: root/compiler/GHC/Llvm.hs
blob: 64aba78c3afe8b2f9d3b4c1fac02b496e6a42d01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
-- ----------------------------------------------------------------------------
-- | This module supplies bindings to generate Llvm IR from Haskell
-- (<http://www.llvm.org/docs/LangRef.html>).
--
-- Note: this module is developed in a demand driven way. It is no complete
-- LLVM binding library in Haskell, but enough to generate code for GHC.
--
-- This code is derived from code taken from the Essential Haskell Compiler
-- (EHC) project (<http://www.cs.uu.nl/wiki/Ehc/WebHome>).
--

module GHC.Llvm (
        LlvmOpts (..),
        initLlvmOpts,

        -- * Modules, Functions and Blocks
        LlvmModule(..),

        LlvmFunction(..), LlvmFunctionDecl(..),
        LlvmFunctions, LlvmFunctionDecls,
        LlvmStatement(..), LlvmExpression(..),
        LlvmBlocks, LlvmBlock(..), LlvmBlockId,
        LlvmParamAttr(..), LlvmParameter,

        -- * Atomic operations
        LlvmAtomicOp(..),

        -- * Fence synchronization
        LlvmSyncOrdering(..),

        -- * Call Handling
        LlvmCallConvention(..), LlvmCallType(..), LlvmParameterListType(..),
        LlvmLinkageType(..), LlvmFuncAttr(..),

        -- * Operations and Comparisons
        LlvmCmpOp(..), LlvmMachOp(..), LlvmCastOp(..),

        -- * Variables and Type System
        LlvmVar(..), LlvmStatic(..), LlvmLit(..), LlvmType(..),
        LlvmAlias, LMGlobal(..), LMString, LMSection, LMAlign,
        LMConst(..),

        -- ** Some basic types
        i64, i32, i16, i8, i1, i8Ptr, llvmWord, llvmWordPtr,

        -- ** Metadata types
        MetaExpr(..), MetaAnnot(..), MetaDecl(..), MetaId(..),

        -- ** Operations on the type system.
        isGlobal, getLitType, getVarType,
        getLink, getStatType, pVarLift, pVarLower,
        pLift, pLower, isInt, isFloat, isPointer, isVector, llvmWidthInBits,

        -- * Pretty Printing
        ppVar, ppLit, ppTypeLit, ppName, ppPlainName,
        ppLlvmModule, ppLlvmComments, ppLlvmComment, ppLlvmGlobals,
        ppLlvmGlobal, ppLlvmFunctionDecls, ppLlvmFunctionDecl, ppLlvmFunctions,
        ppLlvmFunction, ppLlvmAlias, ppLlvmAliases, ppLlvmMetas, ppLlvmMeta,

    ) where

import GHC.Llvm.Syntax
import GHC.Llvm.MetaData
import GHC.Llvm.Ppr
import GHC.Llvm.Types