LLVM 20.0.0git
|
Flags for symbols in the JIT. More...
#include "llvm/ExecutionEngine/JITSymbol.h"
Public Types | |
enum | FlagNames : UnderlyingType { None = 0 , HasError = 1U << 0 , Weak = 1U << 1 , Common = 1U << 2 , Absolute = 1U << 3 , Exported = 1U << 4 , Callable = 1U << 5 , MaterializationSideEffectsOnly = 1U << 6 , LLVM_MARK_AS_BITMASK_ENUM } |
using | UnderlyingType = uint8_t |
using | TargetFlagsType = uint8_t |
Public Member Functions | |
JITSymbolFlags ()=default | |
Default-construct a JITSymbolFlags instance. | |
JITSymbolFlags (FlagNames Flags) | |
Construct a JITSymbolFlags instance from the given flags. | |
JITSymbolFlags (FlagNames Flags, TargetFlagsType TargetFlags) | |
Construct a JITSymbolFlags instance from the given flags and target flags. | |
operator bool () const | |
Implicitly convert to bool. Returns true if any flag is set. | |
bool | operator== (const JITSymbolFlags &RHS) const |
Compare for equality. | |
JITSymbolFlags & | operator&= (const FlagNames &RHS) |
Bitwise AND-assignment for FlagNames. | |
JITSymbolFlags & | operator|= (const FlagNames &RHS) |
Bitwise OR-assignment for FlagNames. | |
bool | hasError () const |
Return true if there was an error retrieving this symbol. | |
bool | isWeak () const |
Returns true if the Weak flag is set. | |
bool | isCommon () const |
Returns true if the Common flag is set. | |
bool | isStrong () const |
Returns true if the symbol isn't weak or common. | |
bool | isExported () const |
Returns true if the Exported flag is set. | |
bool | isCallable () const |
Returns true if the given symbol is known to be callable. | |
bool | hasMaterializationSideEffectsOnly () const |
Returns true if this symbol is a materialization-side-effects-only symbol. | |
UnderlyingType | getRawFlagsValue () const |
Get the underlying flags value as an integer. | |
TargetFlagsType & | getTargetFlags () |
Return a reference to the target-specific flags. | |
const TargetFlagsType & | getTargetFlags () const |
Return a reference to the target-specific flags. | |
Static Public Member Functions | |
static JITSymbolFlags | fromGlobalValue (const GlobalValue &GV) |
Construct a JITSymbolFlags value based on the flags of the given global value. | |
static JITSymbolFlags | fromSummary (GlobalValueSummary *S) |
Construct a JITSymbolFlags value based on the flags of the given global value summary. | |
static Expected< JITSymbolFlags > | fromObjectSymbol (const object::SymbolRef &Symbol) |
Construct a JITSymbolFlags value based on the flags of the given libobject symbol. | |
Flags for symbols in the JIT.
Definition at line 74 of file JITSymbol.h.
using llvm::JITSymbolFlags::TargetFlagsType = uint8_t |
Definition at line 77 of file JITSymbol.h.
using llvm::JITSymbolFlags::UnderlyingType = uint8_t |
Definition at line 76 of file JITSymbol.h.
Enumerator | |
---|---|
None | |
HasError | |
Weak | |
Common | |
Absolute | |
Exported | |
Callable | |
MaterializationSideEffectsOnly | |
LLVM_MARK_AS_BITMASK_ENUM |
Definition at line 79 of file JITSymbol.h.
|
default |
Default-construct a JITSymbolFlags instance.
|
inline |
Construct a JITSymbolFlags instance from the given flags.
Definition at line 96 of file JITSymbol.h.
|
inline |
Construct a JITSymbolFlags instance from the given flags and target flags.
Definition at line 100 of file JITSymbol.h.
|
static |
Construct a JITSymbolFlags value based on the flags of the given global value.
Definition at line 22 of file JITSymbol.cpp.
References assert(), Callable, Common, DL, llvm::StringRef::empty(), Exported, llvm::StringRef::front(), llvm::Value::getName(), llvm::GlobalValue::getParent(), llvm::GlobalValue::hasCommonLinkage(), llvm::GlobalValue::hasHiddenVisibility(), llvm::GlobalValue::hasLinkOnceLinkage(), llvm::GlobalValue::hasLocalLinkage(), llvm::Value::hasName(), llvm::GlobalValue::hasWeakLinkage(), None, llvm::StringRef::starts_with(), llvm::StringRef::substr(), and Weak.
Referenced by llvm::orc::IRSymbolMapper::add(), and llvm::orc::IRMaterializationUnit::IRMaterializationUnit().
|
static |
Construct a JITSymbolFlags value based on the flags of the given libobject symbol.
Definition at line 69 of file JITSymbol.cpp.
References Callable, Common, Exported, None, llvm::object::BasicSymbolRef::SF_Common, llvm::object::BasicSymbolRef::SF_Exported, llvm::object::BasicSymbolRef::SF_Weak, llvm::object::SymbolRef::ST_Function, llvm::Expected< T >::takeError(), and Weak.
Referenced by llvm::orc::RTDyldObjectLinkingLayer::emit(), llvm::orc::getCOFFObjectFileSymbolInfo(), llvm::orc::getELFObjectFileSymbolInfo(), llvm::orc::getGenericObjectFileSymbolInfo(), llvm::RuntimeDyldImpl::getJITSymbolFlags(), and llvm::orc::getMachOObjectFileSymbolInfo().
|
static |
Construct a JITSymbolFlags value based on the flags of the given global value summary.
Definition at line 52 of file JITSymbol.cpp.
References Callable, Common, Exported, llvm::GlobalValue::isCommonLinkage(), llvm::GlobalValue::isExternalLinkage(), llvm::GlobalValue::isExternalWeakLinkage(), llvm::GlobalValue::isLinkOnceLinkage(), llvm::GlobalValue::isWeakLinkage(), llvm::GlobalValueSummary::linkage(), None, and Weak.
|
inline |
Get the underlying flags value as an integer.
Definition at line 167 of file JITSymbol.h.
|
inline |
Return a reference to the target-specific flags.
Definition at line 172 of file JITSymbol.h.
Referenced by LLVMOrcLazyCallThroughManagerRef::fromJITSymbolFlags(), and LLVMOrcLazyCallThroughManagerRef::toJITSymbolFlags().
|
inline |
Return a reference to the target-specific flags.
Definition at line 175 of file JITSymbol.h.
|
inline |
Return true if there was an error retrieving this symbol.
Definition at line 124 of file JITSymbol.h.
References HasError.
Referenced by llvm::JITSymbol::getAddress(), llvm::JITSymbol::JITSymbol(), llvm::JITSymbol::operator bool(), llvm::JITSymbol::operator=(), llvm::JITSymbol::takeError(), and llvm::JITSymbol::~JITSymbol().
|
inline |
Returns true if this symbol is a materialization-side-effects-only symbol.
Such symbols do not have a real address. They exist to trigger and support synchronization of materialization side effects, e.g. for collecting initialization information. These symbols will vanish from the symbol table immediately upon reaching the ready state, and will appear to queries as if they were never defined (except that query callback execution will be delayed until they reach the ready state). MaterializationSideEffectOnly symbols should only be queried using the SymbolLookupFlags::WeaklyReferencedSymbol flag (see llvm/include/llvm/ExecutionEngine/Orc/Core.h).
Definition at line 161 of file JITSymbol.h.
References MaterializationSideEffectsOnly.
|
inline |
Returns true if the given symbol is known to be callable.
Definition at line 149 of file JITSymbol.h.
References Callable.
|
inline |
Returns true if the Common flag is set.
Definition at line 134 of file JITSymbol.h.
References Common.
Referenced by isStrong().
|
inline |
Returns true if the Exported flag is set.
Definition at line 144 of file JITSymbol.h.
References Exported.
|
inline |
Returns true if the symbol isn't weak or common.
Definition at line 139 of file JITSymbol.h.
References isCommon(), and isWeak().
|
inline |
Returns true if the Weak flag is set.
Definition at line 129 of file JITSymbol.h.
References Weak.
Referenced by isStrong().
|
inlineexplicit |
Implicitly convert to bool. Returns true if any flag is set.
Definition at line 104 of file JITSymbol.h.
References None.
|
inline |
|
inline |
|
inline |