llvm-general-3.3.4.5: General purpose LLVM bindings

Safe HaskellNone

LLVM.General.Module

Description

A Module holds a C++ LLVM IR module. Modules may be converted to or from strings or Haskell ASTs, or added to an ExecutionEngine and so JIT compiled to get function pointers.

Synopsis

Documentation

withModuleFromAST :: Context -> Module -> (Module -> IO a) -> ErrorT String IO a

Build an LLVM.General.Module from a LLVM.General.AST.Module - i.e. lower an AST from Haskell into C++ objects.

moduleAST :: Module -> IO Module

Get an LLVM.General.AST.Module from a LLVM.General.Module - i.e. raise C++ objects into an Haskell AST.

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

writeBitcodeToFile :: FilePath -> Module -> ErrorT String IO ()

generate LLVM bitcode from a Module

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