This is an important class for using LLVM in a threaded context. It (opaquely) owns and manages the core "global" data of LLVM's core infrastructure, including the type and constant uniquing tables. LLVMContext itself provides no locking guarantees, so you should be careful to have one context per thread.
Synopsis
Declared in <llvm/IR/LLVMContext.h>
class LLVMContext;
Type Aliases
Name |
Description |
Defines the type of a yield callback. |
Enums
Name |
Description |
Fixed metadata kind IDs that are always available in every context. |
|
Known operand bundle tag IDs with fixed numeric values. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this context and release all associated global state. |
|
Copy assignment is deleted; LLVMContext is non‐copyable. |
Remove the GC for a function. |
|
Report a message to the currently installed diagnostic handler. |
|
Disable ODR‐based uniquing of debug type identifiers in this context. |
|
|
|
Enable ODR‐based uniquing of debug type identifiers in this context. |
|
Get a unique number for a MachineFunction associated with |
|
Get the current default target CPU (target‐cpu function attribute). |
|
Similar to {get,set}DefaultTargetCPU() but for default target‐features. |
|
getDiagHandlerPtr ‐ Returns const raw pointer of DiagnosticHandler set by setDiagnosticHandler. |
|
getDiagnosticContext ‐ Return the diagnostic context set by setDiagnosticContext. |
|
getDiagnosticHandler ‐ transfers ownership of DiagnosticHandler unique_ptr to caller. |
|
getDiagnosticHandlerCallBack ‐ Return the diagnostic handler call back set by setDiagnosticHandlerCallBack. |
|
Return if a code hotness metric should be included in optimization diagnostics. |
|
Return the minimum hotness value a diagnostic would need in order to be included in optimization diagnostics. |
|
Return the tolerance used when diagnosing misexpect warnings. |
|
Return the GC for a function. |
|
|
|
Return a unique non‐zero ID for the specified metadata kind. |
|
Populate |
|
|
|
Return whether misexpect (branch‐weight mismatch) warnings are enabled. |
|
Map a bundle tag name to its integer ID. |
|
Populate |
|
Access the object which can disable optional passes and individual optimizations at compile time. |
|
Return the tag entry to use for an operand bundle named |
|
Map a synchronization scope name to its synchronization scope ID. |
|
Return the name of a SyncScope::ID registered with LLVMContext, if any. |
|
Populate |
|
Key Instructions: get the next free atom group number and increment the global tracker. |
|
Return if hotness threshold is requested from PSI. |
|
Whether there is a string map for uniquing debug info identifiers across the context. Off by default. |
|
Set the current default target CPU (target‐cpu function attribute). |
|
Set the default target‐features string for newly created functions. |
|
Install a DiagnosticHandler object for custom diagnostic handling. |
|
Set a diagnostic handler callback invoked when the backend reports to the user. |
|
Set if a code hotness metric should be included in optimization diagnostics. |
|
Set the minimum hotness value a diagnostic needs in order to be included in optimization diagnostics. |
|
Set the tolerance used when diagnosing misexpect warnings. |
|
Configure whether non‐GlobalValue value names are discarded. |
|
Define the GC for a function. |
|
Set the LLVM remark streamer used to serialize IR/MIR remark diagnostics. |
|
Set the main remark streamer used by specialized remark streamers. |
|
Enable or disable misexpect (branch‐weight mismatch) warnings. |
|
Set the object which can disable optional passes and individual optimizations at compile time. |
|
Registers a yield callback with the given context. |
|
Return true if the Context runtime configuration is set to discard all value names. When true, only GlobalValue names will be available in the IR. |
|
Key Instructions: update the highest number atom group emitted for any function. |
|
Calls the yield callback (if applicable). |
Static Member Functions
Name |
Description |
Get the prefix that should be printed in front of a diagnostic of the given |
Data Members
Name |
Description |
Pointer to the private implementation of this context. |
Friends
Name |
Description |
Top‐level container for LLVM IR objects in a translation unit. |
Non-Member Functions
Name |
Description |
Create a development‐mode ML eviction advisor provider. |
|
Create a development‐mode ML priority advisor provider. |
|
Create a release‐mode ML eviction advisor provider. |
|
Construct the appropriate MLModelRunner for release mode. |
|
Convert |
|
Convert |
|
Finalize optimization remarks and deregister the RemarkStreamer from the Context. |
|
Construct a TensorSpec from a JSON dictionary describing the tensor. |
|
Create a new LoopID after the loop has been transformed. |
|
Set up optimization remarks that output directly to a raw_ostream. |
|
Set up optimization remarks that output to a file. |
|
Opaque C API conversions for |
|
Unwrap an array of opaque |
|
Wrap an array of |
|
Wrap a |
|
Return the attributes for an intrinsic. |
|
Return the function attributes for an intrinsic. |
|
Return the function type for an intrinsic. |
|
Setup optimization remarks. |
Derived Classes
Name |
Description |
LLVMContext initialized from an LTO Config. |
Created with MrDocs