Add new LLVM code generator to GHC. (Version 2)
[ghc-hetmet.git] / compiler / llvmGen / Llvm.hs
1 -- ----------------------------------------------------------------------------
2 -- | This module supplies bindings to generate Llvm IR from Haskell
3 -- (<http://www.llvm.org/docs/LangRef.html>).
4 --
5 -- Note: this module is developed in a demand driven way. It is no complete
6 -- LLVM binding library in Haskell, but enough to generate code for GHC.
7 --
8 -- This code is derived from code taken from the Essential Haskell Compiler
9 -- (EHC) project (<http://www.cs.uu.nl/wiki/Ehc/WebHome>).
10 --
11
12 module Llvm (
13
14         -- * Modules, Functions and Blocks
15         LlvmModule(..),
16
17         LlvmFunction(..), LlvmFunctionDecl(..),
18         LlvmFunctions, LlvmFunctionDecls,
19         LlvmStatement(..), LlvmExpression(..),
20         LlvmBlocks, LlvmBlock(..), LlvmBlockId,
21
22         -- * Call Handling
23         LlvmCallConvention(..), LlvmCallType(..), LlvmParameterListType(..),
24         LlvmLinkageType(..), LlvmFuncAttr(..),
25
26         -- * Operations and Comparisons
27         LlvmCmpOp(..), LlvmMachOp(..), LlvmCastOp(..),
28
29         -- * Variables and Type System
30         LlvmVar(..), LlvmStatic(..), LlvmLit(..), LlvmType(..),
31         LMGlobal, LMString, LMConstant,
32
33         -- ** Some basic types
34         i64, i32, i16, i8, i1, llvmWord, llvmWordPtr,
35
36         -- ** Operations on the type system.
37         isGlobal, getLitType, getLit, getName, getPlainName, getVarType,
38         getStatType, getGlobalVar, getGlobalType, pVarLower, pLift, pLower,
39         isInt, isFloat, isPointer, llvmWidthInBits,
40
41         -- * Pretty Printing
42         ppLlvmModule, ppLlvmComments, ppLlvmComment, ppLlvmConstants,
43         ppLlvmConstant, ppLlvmGlobals, ppLlvmGlobal, ppLlvmFunctionDecls,
44         ppLlvmFunctionDecl, ppLlvmFunctions, ppLlvmFunction, ppLlvmType,
45         ppLlvmTypes, llvmSDoc
46
47     ) where
48
49 import Llvm.AbsSyn
50 import Llvm.PpLlvm
51 import Llvm.Types
52