LLVM 22.0.0git
TargetMachine.h File Reference
#include "llvm-c/ExternC.h"
#include "llvm-c/Target.h"
#include "llvm-c/Types.h"
#include "llvm-c/Visibility.h"

Go to the source code of this file.

Typedefs

typedef struct LLVMOpaqueTargetMachineOptions * LLVMTargetMachineOptionsRef
typedef struct LLVMOpaqueTargetMachine * LLVMTargetMachineRef
typedef struct LLVMTarget * LLVMTargetRef

Enumerations

enum  LLVMCodeGenOptLevel { LLVMCodeGenLevelNone , LLVMCodeGenLevelLess , LLVMCodeGenLevelDefault , LLVMCodeGenLevelAggressive }
enum  LLVMRelocMode {
  LLVMRelocDefault , LLVMRelocStatic , LLVMRelocPIC , LLVMRelocDynamicNoPic ,
  LLVMRelocROPI , LLVMRelocRWPI , LLVMRelocROPI_RWPI
}
enum  LLVMCodeModel {
  LLVMCodeModelDefault , LLVMCodeModelJITDefault , LLVMCodeModelTiny , LLVMCodeModelSmall ,
  LLVMCodeModelKernel , LLVMCodeModelMedium , LLVMCodeModelLarge
}
enum  LLVMCodeGenFileType { LLVMAssemblyFile , LLVMObjectFile }
enum  LLVMGlobalISelAbortMode { LLVMGlobalISelAbortEnable , LLVMGlobalISelAbortDisable , LLVMGlobalISelAbortDisableWithDiag }

Functions

LLVM_C_ABI LLVMTargetRef LLVMGetFirstTarget (void)
 Returns the first llvm::Target in the registered targets list.
LLVM_C_ABI LLVMTargetRef LLVMGetNextTarget (LLVMTargetRef T)
 Returns the next llvm::Target given a previous one (or null if there's none)
LLVM_C_ABI LLVMTargetRef LLVMGetTargetFromName (const char *Name)
 Finds the target corresponding to the given name and stores it in T.
LLVM_C_ABI LLVMBool LLVMGetTargetFromTriple (const char *Triple, LLVMTargetRef *T, char **ErrorMessage)
 Finds the target corresponding to the given triple and stores it in T.
LLVM_C_ABI const charLLVMGetTargetName (LLVMTargetRef T)
 Returns the name of a target.
LLVM_C_ABI const charLLVMGetTargetDescription (LLVMTargetRef T)
 Returns the description of a target.
LLVM_C_ABI LLVMBool LLVMTargetHasJIT (LLVMTargetRef T)
 Returns if the target has a JIT.
LLVM_C_ABI LLVMBool LLVMTargetHasTargetMachine (LLVMTargetRef T)
 Returns if the target has a TargetMachine associated.
LLVM_C_ABI LLVMBool LLVMTargetHasAsmBackend (LLVMTargetRef T)
 Returns if the target as an ASM backend (required for emitting output)
LLVM_C_ABI LLVMTargetMachineOptionsRef LLVMCreateTargetMachineOptions (void)
 Create a new set of options for an llvm::TargetMachine.
LLVM_C_ABI void LLVMDisposeTargetMachineOptions (LLVMTargetMachineOptionsRef Options)
 Dispose of an LLVMTargetMachineOptionsRef instance.
LLVM_C_ABI void LLVMTargetMachineOptionsSetCPU (LLVMTargetMachineOptionsRef Options, const char *CPU)
LLVM_C_ABI void LLVMTargetMachineOptionsSetFeatures (LLVMTargetMachineOptionsRef Options, const char *Features)
 Set the list of features for the target machine.
LLVM_C_ABI void LLVMTargetMachineOptionsSetABI (LLVMTargetMachineOptionsRef Options, const char *ABI)
LLVM_C_ABI void LLVMTargetMachineOptionsSetCodeGenOptLevel (LLVMTargetMachineOptionsRef Options, LLVMCodeGenOptLevel Level)
LLVM_C_ABI void LLVMTargetMachineOptionsSetRelocMode (LLVMTargetMachineOptionsRef Options, LLVMRelocMode Reloc)
LLVM_C_ABI void LLVMTargetMachineOptionsSetCodeModel (LLVMTargetMachineOptionsRef Options, LLVMCodeModel CodeModel)
LLVM_C_ABI LLVMTargetMachineRef LLVMCreateTargetMachineWithOptions (LLVMTargetRef T, const char *Triple, LLVMTargetMachineOptionsRef Options)
 Create a new llvm::TargetMachine.
LLVM_C_ABI LLVMTargetMachineRef LLVMCreateTargetMachine (LLVMTargetRef T, const char *Triple, const char *CPU, const char *Features, LLVMCodeGenOptLevel Level, LLVMRelocMode Reloc, LLVMCodeModel CodeModel)
 Creates a new llvm::TargetMachine.
LLVM_C_ABI void LLVMDisposeTargetMachine (LLVMTargetMachineRef T)
 Dispose the LLVMTargetMachineRef instance generated by LLVMCreateTargetMachine.
LLVM_C_ABI LLVMTargetRef LLVMGetTargetMachineTarget (LLVMTargetMachineRef T)
 Returns the Target used in a TargetMachine.
LLVM_C_ABI charLLVMGetTargetMachineTriple (LLVMTargetMachineRef T)
 Returns the triple used creating this target machine.
LLVM_C_ABI charLLVMGetTargetMachineCPU (LLVMTargetMachineRef T)
 Returns the cpu used creating this target machine.
LLVM_C_ABI charLLVMGetTargetMachineFeatureString (LLVMTargetMachineRef T)
 Returns the feature string used creating this target machine.
LLVM_C_ABI LLVMTargetDataRef LLVMCreateTargetDataLayout (LLVMTargetMachineRef T)
 Create a DataLayout based on the targetMachine.
LLVM_C_ABI void LLVMSetTargetMachineAsmVerbosity (LLVMTargetMachineRef T, LLVMBool VerboseAsm)
 Set the target machine's ASM verbosity.
LLVM_C_ABI void LLVMSetTargetMachineFastISel (LLVMTargetMachineRef T, LLVMBool Enable)
 Enable fast-path instruction selection.
LLVM_C_ABI void LLVMSetTargetMachineGlobalISel (LLVMTargetMachineRef T, LLVMBool Enable)
 Enable global instruction selection.
LLVM_C_ABI void LLVMSetTargetMachineGlobalISelAbort (LLVMTargetMachineRef T, LLVMGlobalISelAbortMode Mode)
 Set abort behaviour when global instruction selection fails to lower/select an instruction.
LLVM_C_ABI void LLVMSetTargetMachineMachineOutliner (LLVMTargetMachineRef T, LLVMBool Enable)
 Enable the MachineOutliner pass.
LLVM_C_ABI LLVMBool LLVMTargetMachineEmitToFile (LLVMTargetMachineRef T, LLVMModuleRef M, const char *Filename, LLVMCodeGenFileType codegen, char **ErrorMessage)
 Emits an asm or object file for the given module to the filename.
LLVM_C_ABI LLVMBool LLVMTargetMachineEmitToMemoryBuffer (LLVMTargetMachineRef T, LLVMModuleRef M, LLVMCodeGenFileType codegen, char **ErrorMessage, LLVMMemoryBufferRef *OutMemBuf)
 Compile the LLVM IR stored in M and store the result in OutMemBuf.
LLVM_C_ABI charLLVMGetDefaultTargetTriple (void)
 Get a triple for the host machine as a string.
LLVM_C_ABI charLLVMNormalizeTargetTriple (const char *triple)
 Normalize a target triple.
LLVM_C_ABI charLLVMGetHostCPUName (void)
 Get the host CPU as a string.
LLVM_C_ABI charLLVMGetHostCPUFeatures (void)
 Get the host CPU's features as a string.
LLVM_C_ABI void LLVMAddAnalysisPasses (LLVMTargetMachineRef T, LLVMPassManagerRef PM)
 Adds the target-specific analysis passes to the pass manager.