Safe Haskell | None |
---|
A Module
holds a C++ LLVM IR module. Module
s may be converted to or from strings or Haskell ASTs, or
added to an ExecutionEngine
and so JIT compiled to get function pointers.
- data Module
- withModuleFromAST :: Context -> Module -> (Module -> IO a) -> ErrorT String IO a
- moduleAST :: Module -> IO Module
- withModuleFromString :: Context -> String -> (Module -> IO a) -> ErrorT (Either String Diagnostic) IO a
- moduleString :: Module -> IO String
- moduleAssembly :: TargetMachine -> Module -> ErrorT String IO String
- moduleObject :: TargetMachine -> Module -> ErrorT String IO ByteString
- writeBitcodeToFile :: FilePath -> Module -> ErrorT String IO ()
- writeAssemblyToFile :: TargetMachine -> FilePath -> Module -> ErrorT String IO ()
- writeObjectToFile :: TargetMachine -> FilePath -> Module -> ErrorT String IO ()
Documentation
withModuleFromString :: Context -> String -> (Module -> IO a) -> ErrorT (Either String Diagnostic) IO a
parse Module
from LLVM assembly
moduleString :: Module -> IO String
generate LLVM assembly from a Module
moduleAssembly :: TargetMachine -> Module -> ErrorT String IO String
produce target-specific assembly as a String
moduleObject :: TargetMachine -> Module -> ErrorT String IO ByteString
produce target-specific object code as a ByteString
writeAssemblyToFile :: TargetMachine -> FilePath -> Module -> ErrorT String IO ()
write target-specific assembly directly into a file
writeObjectToFile :: TargetMachine -> FilePath -> Module -> ErrorT String IO ()
write target-specific object code directly into a file