LLVM 20.0.0git
Classes | Namespaces | Functions
TargetMachineC.cpp File Reference
#include "llvm-c/Core.h"
#include "llvm-c/TargetMachine.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/CBindingWrapping.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/CodeGenCWrappers.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/TargetParser/Host.h"
#include "llvm/TargetParser/SubtargetFeature.h"
#include <cstring>
#include <optional>

Go to the source code of this file.

Classes

struct  llvm::LLVMTargetMachineOptions
 Options for LLVMCreateTargetMachine(). More...
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Functions

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

Function Documentation

◆ DEFINE_SIMPLE_CONVERSION_FUNCTIONS()

DEFINE_SIMPLE_CONVERSION_FUNCTIONS ( LLVMTargetMachineOptions  ,
LLVMTargetMachineOptionsRef   
)

Definition at line 47 of file TargetMachineC.cpp.

References P.

◆ LLVMTargetMachineEmit()

static LLVMBool LLVMTargetMachineEmit ( LLVMTargetMachineRef  T,
LLVMModuleRef  M,
raw_pwrite_stream OS,
LLVMCodeGenFileType  codegen,
char **  ErrorMessage 
)
static

◆ unwrap()

static Target * unwrap ( LLVMTargetRef  P)
static

◆ wrap() [1/2]

static LLVMTargetRef wrap ( const Target P)
static

Definition at line 59 of file TargetMachineC.cpp.

References P.

◆ wrap() [2/2]

static LLVMTargetMachineRef wrap ( const TargetMachine P)
static