-- | Comments to include at the start of the module.
modComments :: [LMString],
- -- | Constants to include in the module.
- modConstants :: [LMConstant],
-
-- | Global variables to include in the module.
modGlobals :: [LMGlobal],
-- | An LLVM Function
data LlvmFunction = LlvmFunction {
-- | The signature of this declared function.
- funcDecl :: LlvmFunctionDecl,
+ funcDecl :: LlvmFunctionDecl,
+
+ -- | The functions arguments
+ funcArgs :: [LMString],
-- | The function attributes.
- funcAttrs :: [LlvmFuncAttr],
+ funcAttrs :: [LlvmFuncAttr],
+
+ -- | The section to put the function into,
+ funcSect :: LMSection,
-- | The body of the functions.
- funcBody :: LlvmBlocks
+ funcBody :: LlvmBlocks
}
type LlvmFunctions = [LlvmFunction]
{- |
Navigate in an structure, selecting elements
+ * inbound: Is the pointer inbounds? (computed pointer doesn't overflow)
* ptr: Location of the structure
* indexes: A list of indexes to select the correct value. For example
the first element of the third element of the structure ptr
is selected with [3,1] (zero indexed)
-}
- | GetElemPtr LlvmVar [Int]
+ | GetElemPtr Bool LlvmVar [Int]
{- |
Cast the variable from to the to type. This is an abstraction of three