Package org.lwjgl.llvm
Class LLVMTargetMachine
- java.lang.Object
-
- org.lwjgl.llvm.LLVMTargetMachine
-
public class LLVMTargetMachine extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LLVMTargetMachine.Functions
Contains the function pointers loaded fromLLVMCore.getLibrary()
.
-
Field Summary
Fields Modifier and Type Field Description static int
LLVMAssemblyFile
LLVMCodeGenFileType
static int
LLVMCodeGenLevelAggressive
LLVMCodeGenLevelDefault
LLVMCodeGenLevelLess
LLVMCodeGenLevelNoneLLVMCodeGenOptLevel
static int
LLVMCodeModelDefault
LLVMCodeModelJITDefault
LLVMCodeModelKernel
LLVMCodeModelLarge
LLVMCodeModelMedium
LLVMCodeModelSmall
LLVMCodeModelTinyLLVMCodeModel
static int
LLVMObjectFile
LLVMCodeGenFileType
static int
LLVMRelocDefault
LLVMRelocDynamicNoPic
LLVMRelocPIC
LLVMRelocROPI
LLVMRelocROPI_RWPI
LLVMRelocRWPI
LLVMRelocStaticLLVMRelocMode
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
LLVMAddAnalysisPasses(long T, long PM)
Adds the target-specific analysis passes to the pass manager.static long
LLVMCreateTargetDataLayout(long T)
Create aDataLayout
based on the target machine.static long
LLVMCreateTargetMachine(long T, java.lang.CharSequence Triple, java.lang.CharSequence CPU, java.lang.CharSequence Features, int Level, int Reloc, int CodeModel)
Creates a newllvm::TargetMachine
.static long
LLVMCreateTargetMachine(long T, java.nio.ByteBuffer Triple, java.nio.ByteBuffer CPU, java.nio.ByteBuffer Features, int Level, int Reloc, int CodeModel)
Creates a newllvm::TargetMachine
.static void
LLVMDisposeTargetMachine(long T)
Dispose theLLVMTargetMachineRef
instance generated byCreateTargetMachine
.static java.lang.String
LLVMGetDefaultTargetTriple()
Get a triple for the host machine as a string.static long
LLVMGetFirstTarget()
Returns the firstllvm::Target
in the registered targets list.static java.lang.String
LLVMGetHostCPUFeatures()
Get the host CPU's features as a string.static java.lang.String
LLVMGetHostCPUName()
Get the host CPU as a string.static long
LLVMGetNextTarget(long T)
Returns the nextllvm::Target
given a previous one (or null if there's none)static java.lang.String
LLVMGetTargetDescription(long T)
Returns the description of a target.static long
LLVMGetTargetFromName(java.lang.CharSequence Name)
Finds the target corresponding to the given name and stores it inT
.static long
LLVMGetTargetFromName(java.nio.ByteBuffer Name)
Finds the target corresponding to the given name and stores it inT
.static boolean
LLVMGetTargetFromTriple(java.lang.CharSequence Triple, org.lwjgl.PointerBuffer T, org.lwjgl.PointerBuffer ErrorMessage)
Finds the target corresponding to the given triple and stores it inT
.static boolean
LLVMGetTargetFromTriple(java.nio.ByteBuffer Triple, org.lwjgl.PointerBuffer T, org.lwjgl.PointerBuffer ErrorMessage)
Finds the target corresponding to the given triple and stores it inT
.static java.lang.String
LLVMGetTargetMachineCPU(long T)
Returns the cpu used creating this target machine.static java.lang.String
LLVMGetTargetMachineFeatureString(long T)
Returns the feature string used creating this target machine.static long
LLVMGetTargetMachineTarget(long T)
Returns theTarget
used in aTargetMachine
static java.lang.String
LLVMGetTargetMachineTriple(long T)
Returns the triple used creating this target machine.static java.lang.String
LLVMGetTargetName(long T)
Returns the name of a target.static java.lang.String
LLVMNormalizeTargetTriple(java.lang.CharSequence triple)
Normalize a target triple.static java.lang.String
LLVMNormalizeTargetTriple(java.nio.ByteBuffer triple)
Normalize a target triple.static void
LLVMSetTargetMachineAsmVerbosity(long T, boolean VerboseAsm)
Set the target machine's ASM verbosity.static boolean
LLVMTargetHasAsmBackend(long T)
Returns if the target as an ASM backend (required for emitting output)static boolean
LLVMTargetHasJIT(long T)
Returns if the target has a JITstatic boolean
LLVMTargetHasTargetMachine(long T)
Returns if the target has aTargetMachine
associatedstatic boolean
LLVMTargetMachineEmitToFile(long T, long M, java.nio.ByteBuffer Filename, int codegen, org.lwjgl.PointerBuffer ErrorMessage)
Emits an asm or object file for the given module to the filename.static boolean
LLVMTargetMachineEmitToMemoryBuffer(long T, long M, int codegen, org.lwjgl.PointerBuffer ErrorMessage, org.lwjgl.PointerBuffer OutMemBuf)
Compile the LLVM IR stored inM
and store the result inOutMemBuf
.static long
nLLVMCreateTargetMachine(long T, long Triple, long CPU, long Features, int Level, int Reloc, int CodeModel)
Unsafe version of:CreateTargetMachine
static long
nLLVMGetDefaultTargetTriple()
Unsafe version of:GetDefaultTargetTriple
static long
nLLVMGetHostCPUFeatures()
Unsafe version of:GetHostCPUFeatures
static long
nLLVMGetHostCPUName()
Unsafe version of:GetHostCPUName
static long
nLLVMGetTargetDescription(long T)
Unsafe version of:GetTargetDescription
static long
nLLVMGetTargetFromName(long Name)
Unsafe version of:GetTargetFromName
static int
nLLVMGetTargetFromTriple(long Triple, long T, long ErrorMessage)
Unsafe version of:GetTargetFromTriple
static long
nLLVMGetTargetMachineCPU(long T)
Unsafe version of:GetTargetMachineCPU
static long
nLLVMGetTargetMachineFeatureString(long T)
Unsafe version of:GetTargetMachineFeatureString
static long
nLLVMGetTargetMachineTriple(long T)
Unsafe version of:GetTargetMachineTriple
static long
nLLVMGetTargetName(long T)
Unsafe version of:GetTargetName
static long
nLLVMNormalizeTargetTriple(long triple)
Unsafe version of:NormalizeTargetTriple
static int
nLLVMTargetMachineEmitToFile(long T, long M, long Filename, int codegen, long ErrorMessage)
Unsafe version of:TargetMachineEmitToFile
static int
nLLVMTargetMachineEmitToMemoryBuffer(long T, long M, int codegen, long ErrorMessage, long OutMemBuf)
Unsafe version of:TargetMachineEmitToMemoryBuffer
-
-
-
Field Detail
-
LLVMCodeGenLevelNone, LLVMCodeGenLevelLess, LLVMCodeGenLevelDefault, LLVMCodeGenLevelAggressive
LLVMCodeGenOptLevel
Enum values:
-
LLVMRelocDefault, LLVMRelocStatic, LLVMRelocPIC, LLVMRelocDynamicNoPic, LLVMRelocROPI, LLVMRelocRWPI, LLVMRelocROPI_RWPI
LLVMRelocMode
Enum values:
-
LLVMCodeModelDefault, LLVMCodeModelJITDefault, LLVMCodeModelTiny, LLVMCodeModelSmall, LLVMCodeModelKernel, LLVMCodeModelMedium, LLVMCodeModelLarge
LLVMCodeModel
Enum values:
-
-
Method Detail
-
LLVMGetFirstTarget
public static long LLVMGetFirstTarget()
Returns the firstllvm::Target
in the registered targets list.
-
LLVMGetNextTarget
public static long LLVMGetNextTarget(long T)
Returns the nextllvm::Target
given a previous one (or null if there's none)
-
nLLVMGetTargetFromName
public static long nLLVMGetTargetFromName(long Name)
Unsafe version of:GetTargetFromName
-
LLVMGetTargetFromName
public static long LLVMGetTargetFromName(java.nio.ByteBuffer Name) public static long LLVMGetTargetFromName(java.lang.CharSequence Name)
Finds the target corresponding to the given name and stores it inT
. Returns 0 on success.
-
nLLVMGetTargetFromTriple
public static int nLLVMGetTargetFromTriple(long Triple, long T, long ErrorMessage)
Unsafe version of:GetTargetFromTriple
-
LLVMGetTargetFromTriple
public static boolean LLVMGetTargetFromTriple(java.nio.ByteBuffer Triple, org.lwjgl.PointerBuffer T, org.lwjgl.PointerBuffer ErrorMessage) public static boolean LLVMGetTargetFromTriple(java.lang.CharSequence Triple, org.lwjgl.PointerBuffer T, org.lwjgl.PointerBuffer ErrorMessage)
Finds the target corresponding to the given triple and stores it inT
. Returns 0 on success. Optionally returns any error inErrorMessage
. UseDisposeMessage
to dispose the message.
-
nLLVMGetTargetName
public static long nLLVMGetTargetName(long T)
Unsafe version of:GetTargetName
-
LLVMGetTargetName
@Nullable public static java.lang.String LLVMGetTargetName(long T)
Returns the name of a target. Seellvm::Target::getName
-
nLLVMGetTargetDescription
public static long nLLVMGetTargetDescription(long T)
Unsafe version of:GetTargetDescription
-
LLVMGetTargetDescription
@Nullable public static java.lang.String LLVMGetTargetDescription(long T)
Returns the description of a target. Seellvm::Target::getDescription
-
LLVMTargetHasJIT
public static boolean LLVMTargetHasJIT(long T)
Returns if the target has a JIT
-
LLVMTargetHasTargetMachine
public static boolean LLVMTargetHasTargetMachine(long T)
Returns if the target has aTargetMachine
associated
-
LLVMTargetHasAsmBackend
public static boolean LLVMTargetHasAsmBackend(long T)
Returns if the target as an ASM backend (required for emitting output)
-
nLLVMCreateTargetMachine
public static long nLLVMCreateTargetMachine(long T, long Triple, long CPU, long Features, int Level, int Reloc, int CodeModel)
Unsafe version of:CreateTargetMachine
-
LLVMCreateTargetMachine
public static long LLVMCreateTargetMachine(long T, java.nio.ByteBuffer Triple, java.nio.ByteBuffer CPU, java.nio.ByteBuffer Features, int Level, int Reloc, int CodeModel) public static long LLVMCreateTargetMachine(long T, java.lang.CharSequence Triple, java.lang.CharSequence CPU, java.lang.CharSequence Features, int Level, int Reloc, int CodeModel)
Creates a newllvm::TargetMachine
. Seellvm::Target::createTargetMachine
-
LLVMDisposeTargetMachine
public static void LLVMDisposeTargetMachine(long T)
Dispose theLLVMTargetMachineRef
instance generated byCreateTargetMachine
.
-
LLVMGetTargetMachineTarget
public static long LLVMGetTargetMachineTarget(long T)
Returns theTarget
used in aTargetMachine
-
nLLVMGetTargetMachineTriple
public static long nLLVMGetTargetMachineTriple(long T)
Unsafe version of:GetTargetMachineTriple
-
LLVMGetTargetMachineTriple
@Nullable public static java.lang.String LLVMGetTargetMachineTriple(long T)
Returns the triple used creating this target machine. Seellvm::TargetMachine::getTriple
. The result needs to be disposed withDisposeMessage
.
-
nLLVMGetTargetMachineCPU
public static long nLLVMGetTargetMachineCPU(long T)
Unsafe version of:GetTargetMachineCPU
-
LLVMGetTargetMachineCPU
@Nullable public static java.lang.String LLVMGetTargetMachineCPU(long T)
Returns the cpu used creating this target machine. Seellvm::TargetMachine::getCPU
. The result needs to be disposed withDisposeMessage
.
-
nLLVMGetTargetMachineFeatureString
public static long nLLVMGetTargetMachineFeatureString(long T)
Unsafe version of:GetTargetMachineFeatureString
-
LLVMGetTargetMachineFeatureString
@Nullable public static java.lang.String LLVMGetTargetMachineFeatureString(long T)
Returns the feature string used creating this target machine. Seellvm::TargetMachine::getFeatureString
. The result needs to be disposed withDisposeMessage
.
-
LLVMCreateTargetDataLayout
public static long LLVMCreateTargetDataLayout(long T)
Create aDataLayout
based on the target machine.
-
LLVMSetTargetMachineAsmVerbosity
public static void LLVMSetTargetMachineAsmVerbosity(long T, boolean VerboseAsm)
Set the target machine's ASM verbosity.
-
nLLVMTargetMachineEmitToFile
public static int nLLVMTargetMachineEmitToFile(long T, long M, long Filename, int codegen, long ErrorMessage)
Unsafe version of:TargetMachineEmitToFile
-
LLVMTargetMachineEmitToFile
public static boolean LLVMTargetMachineEmitToFile(long T, long M, java.nio.ByteBuffer Filename, int codegen, org.lwjgl.PointerBuffer ErrorMessage)
Emits an asm or object file for the given module to the filename. This wraps several c++ only classes (among them a file stream). Returns any error inErrorMessage
. UseDisposeMessage
to dispose the message.
-
nLLVMTargetMachineEmitToMemoryBuffer
public static int nLLVMTargetMachineEmitToMemoryBuffer(long T, long M, int codegen, long ErrorMessage, long OutMemBuf)
Unsafe version of:TargetMachineEmitToMemoryBuffer
-
LLVMTargetMachineEmitToMemoryBuffer
public static boolean LLVMTargetMachineEmitToMemoryBuffer(long T, long M, int codegen, org.lwjgl.PointerBuffer ErrorMessage, org.lwjgl.PointerBuffer OutMemBuf)
Compile the LLVM IR stored inM
and store the result inOutMemBuf
.
-
nLLVMGetDefaultTargetTriple
public static long nLLVMGetDefaultTargetTriple()
Unsafe version of:GetDefaultTargetTriple
-
LLVMGetDefaultTargetTriple
@Nullable public static java.lang.String LLVMGetDefaultTargetTriple()
Get a triple for the host machine as a string. The result needs to be disposed withDisposeMessage
.
-
nLLVMNormalizeTargetTriple
public static long nLLVMNormalizeTargetTriple(long triple)
Unsafe version of:NormalizeTargetTriple
-
LLVMNormalizeTargetTriple
@Nullable public static java.lang.String LLVMNormalizeTargetTriple(java.nio.ByteBuffer triple) @Nullable public static java.lang.String LLVMNormalizeTargetTriple(java.lang.CharSequence triple)
Normalize a target triple. The result needs to be disposed withDisposeMessage
.
-
nLLVMGetHostCPUName
public static long nLLVMGetHostCPUName()
Unsafe version of:GetHostCPUName
-
LLVMGetHostCPUName
@Nullable public static java.lang.String LLVMGetHostCPUName()
Get the host CPU as a string. The result needs to be disposed withDisposeMessage
.
-
nLLVMGetHostCPUFeatures
public static long nLLVMGetHostCPUFeatures()
Unsafe version of:GetHostCPUFeatures
-
LLVMGetHostCPUFeatures
@Nullable public static java.lang.String LLVMGetHostCPUFeatures()
Get the host CPU's features as a string. The result needs to be disposed withDisposeMessage
.
-
LLVMAddAnalysisPasses
public static void LLVMAddAnalysisPasses(long T, long PM)
Adds the target-specific analysis passes to the pass manager.
-
-