LLVM 20.0.0git
|
Contexts are execution states for the core LLVM IR system. More...
Typedefs | |
typedef void(* | LLVMDiagnosticHandler) (LLVMDiagnosticInfoRef, void *) |
typedef void(* | LLVMYieldCallback) (LLVMContextRef, void *) |
Contexts are execution states for the core LLVM IR system.
Most types are tied to a context instance. Multiple contexts can exist simultaneously. A single context is not thread safe. However, different contexts can execute on different threads simultaneously.
typedef void(* LLVMDiagnosticHandler) (LLVMDiagnosticInfoRef, void *) |
typedef void(* LLVMYieldCallback) (LLVMContextRef, void *) |
LLVMContextRef LLVMContextCreate | ( | void | ) |
Create a new context.
Every call to this function should be paired with a call to LLVMContextDispose() or the context will leak memory.
Definition at line 100 of file Core.cpp.
References llvm::wrap().
void LLVMContextDispose | ( | LLVMContextRef | C | ) |
Destroy a context instance.
This should be called for every call to LLVMContextCreate() or memory will be leaked.
Definition at line 139 of file Core.cpp.
References llvm::CallingConv::C, and unwrap().
void * LLVMContextGetDiagnosticContext | ( | LLVMContextRef | C | ) |
Get the diagnostic context of this context.
Definition at line 120 of file Core.cpp.
References llvm::CallingConv::C, and unwrap().
LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler | ( | LLVMContextRef | C | ) |
Get the diagnostic handler of this context.
Definition at line 115 of file Core.cpp.
References llvm::CallingConv::C, LLVM_EXTENSION, and unwrap().
void LLVMContextSetDiagnosticHandler | ( | LLVMContextRef | C, |
LLVMDiagnosticHandler | Handler, | ||
void * | DiagnosticContext | ||
) |
Set the diagnostic handler for this context.
Definition at line 106 of file Core.cpp.
References llvm::CallingConv::C, LLVM_EXTENSION, and unwrap().
void LLVMContextSetDiscardValueNames | ( | LLVMContextRef | C, |
LLVMBool | Discard | ||
) |
Set whether the given context discards all value names.
If true, only the names of GlobalValue objects will be available in the IR. This can be used to save memory and runtime, especially in release mode.
Definition at line 135 of file Core.cpp.
References llvm::CallingConv::C, and unwrap().
void LLVMContextSetYieldCallback | ( | LLVMContextRef | C, |
LLVMYieldCallback | Callback, | ||
void * | OpaqueHandle | ||
) |
Set the yield callback function for this context.
Definition at line 124 of file Core.cpp.
References llvm::CallingConv::C, LLVM_EXTENSION, and unwrap().
LLVMBool LLVMContextShouldDiscardValueNames | ( | LLVMContextRef | C | ) |
Retrieve whether the given context is set to discard all value names.
Definition at line 131 of file Core.cpp.
References llvm::CallingConv::C, and unwrap().
LLVMAttributeRef LLVMCreateConstantRangeAttribute | ( | LLVMContextRef | C, |
unsigned | KindID, | ||
unsigned | NumBits, | ||
const uint64_t | LowerWords[], | ||
const uint64_t | UpperWords[] | ||
) |
Create a ConstantRange attribute.
LowerWords and UpperWords need to be NumBits divided by 64 rounded up elements long.
Definition at line 194 of file Core.cpp.
References llvm::CallingConv::C, llvm::divideCeil(), llvm::Attribute::get(), unwrap(), and llvm::wrap().
LLVMAttributeRef LLVMCreateEnumAttribute | ( | LLVMContextRef | C, |
unsigned | KindID, | ||
uint64_t | Val | ||
) |
Create an enum attribute.
Definition at line 164 of file Core.cpp.
References llvm::CallingConv::C, llvm::Attribute::get(), unwrap(), and llvm::wrap().
LLVMAttributeRef LLVMCreateStringAttribute | ( | LLVMContextRef | C, |
const char * | K, | ||
unsigned | KLength, | ||
const char * | V, | ||
unsigned | VLength | ||
) |
Create a string attribute.
Definition at line 208 of file Core.cpp.
References llvm::CallingConv::C, llvm::Attribute::get(), unwrap(), and llvm::wrap().
LLVMAttributeRef LLVMCreateTypeAttribute | ( | LLVMContextRef | C, |
unsigned | KindID, | ||
LLVMTypeRef | type_ref | ||
) |
Create a type attribute.
Definition at line 182 of file Core.cpp.
References llvm::CallingConv::C, llvm::Attribute::get(), unwrap(), and llvm::wrap().
char * LLVMGetDiagInfoDescription | ( | LLVMDiagnosticInfoRef | DI | ) |
Return a string representation of the DiagnosticInfo.
Use LLVMDisposeMessage to free the string.
Definition at line 242 of file Core.cpp.
References llvm::raw_ostream::flush(), LLVMCreateMessage(), llvm::BasicBlock::print(), and unwrap().
LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity | ( | LLVMDiagnosticInfoRef | DI | ) |
Return an enum LLVMDiagnosticSeverity.
Definition at line 253 of file Core.cpp.
References llvm::DS_Note, llvm::DS_Remark, llvm::DS_Warning, LLVMDSError, LLVMDSNote, LLVMDSRemark, LLVMDSWarning, and unwrap().
unsigned LLVMGetEnumAttributeKind | ( | LLVMAttributeRef | A | ) |
Return an unique id given the name of a enum attribute, or 0 if no attribute by that name exists.
See http://llvm.org/docs/LangRef.html#parameter-attributes and http://llvm.org/docs/LangRef.html#function-attributes for the list of available attributes.
NB: Attribute names and/or id are subject to change without going through the C API deprecation cycle.
Definition at line 156 of file Core.cpp.
References llvm::Attribute::getAttrKindFromName(), and Name.
uint64_t LLVMGetEnumAttributeValue | ( | LLVMAttributeRef | A | ) |
LLVMContextRef LLVMGetGlobalContext | ( | void | ) |
Obtain the global context instance.
Definition at line 104 of file Core.cpp.
References getGlobalContext(), and llvm::wrap().
Referenced by LLVMGetBitcodeModule(), LLVMGetBitcodeModule2(), LLVMParseBitcode(), and LLVMParseBitcode2().
Definition at line 148 of file Core.cpp.
References LLVMGetGlobalContext(), LLVMGetMDKindIDInContext(), and Name.
unsigned LLVMGetMDKindIDInContext | ( | LLVMContextRef | C, |
const char * | Name, | ||
unsigned | SLen | ||
) |
Definition at line 143 of file Core.cpp.
References llvm::CallingConv::C, Name, and unwrap().
Referenced by LLVMGetMDKindID().
const char * LLVMGetStringAttributeKind | ( | LLVMAttributeRef | A, |
unsigned * | Length | ||
) |
Get the string attribute's kind.
Definition at line 215 of file Core.cpp.
References A, llvm::Length, and unwrap().
const char * LLVMGetStringAttributeValue | ( | LLVMAttributeRef | A, |
unsigned * | Length | ||
) |
Get the string attribute's value.
Definition at line 222 of file Core.cpp.
References A, llvm::Length, and unwrap().
unsigned LLVMGetSyncScopeID | ( | LLVMContextRef | C, |
const char * | Name, | ||
size_t | SLen | ||
) |
Maps a synchronization scope name to a ID unique within this context.
Definition at line 152 of file Core.cpp.
References llvm::CallingConv::C, Name, and unwrap().
LLVMTypeRef LLVMGetTypeAttributeValue | ( | LLVMAttributeRef | A | ) |
Get the type attribute's value.
Definition at line 189 of file Core.cpp.
References A, unwrap(), and llvm::wrap().
LLVMTypeRef LLVMGetTypeByName2 | ( | LLVMContextRef | C, |
const char * | Name | ||
) |
Obtain a Type from a context by its registered name.
Definition at line 853 of file Core.cpp.
References llvm::CallingConv::C, llvm::StructType::getTypeByName(), Name, unwrap(), and llvm::wrap().
LLVMBool LLVMIsEnumAttribute | ( | LLVMAttributeRef | A | ) |
LLVMBool LLVMIsStringAttribute | ( | LLVMAttributeRef | A | ) |