Safe Haskell | None |
---|
A Target
describes that for which code may be intended. Targets are used both during actual
| lowering of LLVM IR to machine code and by some optimization passes which use the target to
| judge costs.
- lookupTarget :: Maybe String -> String -> ErrorT String IO (Target, String)
- data TargetOptions
- data Target
- data TargetMachine
- data TargetLowering
- newtype CPUFeature = CPUFeature String
- withTargetOptions :: (TargetOptions -> IO a) -> IO a
- peekTargetOptions :: TargetOptions -> IO Options
- pokeTargetOptions :: Options -> TargetOptions -> IO ()
- withTargetMachine :: Target -> String -> String -> Set CPUFeature -> TargetOptions -> Model -> Model -> Level -> (TargetMachine -> IO a) -> IO a
- withDefaultTargetMachine :: (TargetMachine -> IO a) -> ErrorT String IO a
- getTargetLowering :: TargetMachine -> IO TargetLowering
- getDefaultTargetTriple :: IO String
- getProcessTargetTriple :: IO String
- getHostCPUName :: IO String
- getHostCPUFeatures :: IO (Set CPUFeature)
- getTargetMachineDataLayout :: TargetMachine -> IO DataLayout
- initializeNativeTarget :: IO ()
- initializeAllTargets :: IO ()
- data TargetLibraryInfo
- getLibraryFunction :: TargetLibraryInfo -> String -> IO (Maybe LibraryFunction)
- getLibraryFunctionName :: TargetLibraryInfo -> LibraryFunction -> IO String
- setLibraryFunctionAvailableWithName :: TargetLibraryInfo -> LibraryFunction -> String -> IO ()
- withTargetLibraryInfo :: String -> (TargetLibraryInfo -> IO a) -> IO a
Documentation
:: Maybe String | arch |
-> String | "triple" - e.g. x86_64-unknown-linux-gnu |
-> ErrorT String IO (Target, String) |
Find a Target
given an architecture and/or a "triple".
| http://llvm.org/doxygen/structllvm_1_1TargetRegistry.html#a3105b45e546c9cc3cf78d0f2ec18ad89
| Be sure to run either initializeAllTargets
or initializeNativeTarget
before expecting this to succeed, depending on what target(s) you want to use.
newtype CPUFeature
e.g. an instruction set extension
withTargetOptions :: (TargetOptions -> IO a) -> IO a
bracket creation and destruction of a TargetOptions
object
peekTargetOptions :: TargetOptions -> IO Options
get all target options
pokeTargetOptions :: Options -> TargetOptions -> IO ()
set all target options
:: Target | |
-> String | triple |
-> String | cpu |
-> Set CPUFeature | features |
-> TargetOptions | |
-> Model | |
-> Model | |
-> Level | |
-> (TargetMachine -> IO a) | |
-> IO a |
bracket creation and destruction of a TargetMachine
withDefaultTargetMachine :: (TargetMachine -> IO a) -> ErrorT String IO a
Bracket creation and destruction of a TargetMachine
configured for the host
getTargetLowering :: TargetMachine -> IO TargetLowering
get the TargetLowering
of a TargetMachine
getDefaultTargetTriple :: IO String
the default target triple that LLVM has been configured to produce code for
getProcessTargetTriple :: IO String
a target triple suitable for loading code into the current process
the LLVM name for the host CPU
getHostCPUFeatures :: IO (Set CPUFeature)
a space-separated list of LLVM feature names supported by the host CPU
getTargetMachineDataLayout :: TargetMachine -> IO DataLayout
DataLayout
to use for the given TargetMachine
initializeNativeTarget :: IO ()
Initialize the native target. This function is called automatically in these Haskell bindings
when creating an ExecutionEngine
which will require it, and so it should
not be necessary to call it separately.
initializeAllTargets :: IO ()
Initialize all targets so they can be found by lookupTarget
getLibraryFunction :: TargetLibraryInfo -> String -> IO (Maybe LibraryFunction)
Look up a LibraryFunction
by its standard name
getLibraryFunctionName :: TargetLibraryInfo -> LibraryFunction -> IO String
Get a the current name to be emitted for a LibraryFunction
setLibraryFunctionAvailableWithName
:: TargetLibraryInfo | |
-> LibraryFunction | |
-> String | The function name to be emitted |
-> IO () |
Set the name of the function on the target platform that corresponds to funcName
:: String | triple |
-> (TargetLibraryInfo -> IO a) | |
-> IO a |
look up information about the library functions available on a given platform