+llvmFunSig lbl link = llvmFunSig' (strCLabel_llvm lbl) link
+
+llvmFunSig' :: LMString -> LlvmLinkageType -> LlvmFunctionDecl
+llvmFunSig' lbl link
+ = let toParams x | isPointer x = (x, [NoAlias, NoCapture])
+ | otherwise = (x, [])
+ in LlvmFunctionDecl lbl link llvmGhcCC LMVoid FixedArgs
+ (map (toParams . getVarType) llvmFunArgs) llvmFunAlign
+
+-- | Create a Haskell function in LLVM.
+mkLlvmFunc :: CLabel -> LlvmLinkageType -> LMSection -> LlvmBlocks
+ -> LlvmFunction
+mkLlvmFunc lbl link sec blks
+ = let funDec = llvmFunSig lbl link
+ funArgs = map (fsLit . getPlainName) llvmFunArgs
+ in LlvmFunction funDec funArgs llvmStdFunAttrs sec blks
+
+-- | Alignment to use for functions
+llvmFunAlign :: LMAlign
+llvmFunAlign = Just wORD_SIZE
+
+-- | Alignment to use for into tables
+llvmInfAlign :: LMAlign
+llvmInfAlign = Just wORD_SIZE