LLVM: Add a literal NULL value to binding
[ghc-hetmet.git] / compiler / llvmGen / Llvm / AbsSyn.hs
index 1b8527b..7a5b700 100644 (file)
@@ -28,9 +28,6 @@ data LlvmModule = LlvmModule  {
     -- | 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],
 
@@ -44,13 +41,19 @@ data LlvmModule = LlvmModule  {
 -- | 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]
@@ -168,12 +171,13 @@ data LlvmExpression
 
   {- |
     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