14 #ifndef LLVM_EXECUTIONENGINE_JITSYMBOL_H
15 #define LLVM_EXECUTIONENGINE_JITSYMBOL_H
105 : Address(Address), Flags(Flags) {}
108 explicit operator bool()
const {
return Address != 0; }
154 : GetAddress(std::move(GetAddress)),
CachedAddr(0), Flags(Flags) {}
160 : GetAddress(std::move(
Other.GetAddress)), Flags(std::move(
Other.Flags)) {
168 GetAddress = std::move(
Other.GetAddress);
169 Flags = std::move(
Other.Flags);
185 explicit operator bool()
const {
192 return std::move(
Err);
201 if (
auto CachedAddrOrErr = GetAddress()) {
202 GetAddress =
nullptr;
206 return CachedAddrOrErr.takeError();
250 virtual void anchor();
255 #endif // LLVM_EXECUTIONENGINE_JITSYMBOL_H
virtual JITSymbol findSymbolInLogicalDylib(const std::string &Name)=0
This method returns the address of the specified symbol if it exists within the logical dynamic libra...
static JITSymbolFlags fromGlobalValue(const GlobalValue &GV)
Construct a JITSymbolFlags value based on the flags of the given global value.
Represents a symbol in the JIT.
JITSymbol & operator=(const JITSymbol &)=delete
JITSymbol & operator=(JITSymbol &&Other)
Tagged union holding either a T or a Error.
uint64_t JITTargetAddress
Represents an address in the target process's address space.
JITSymbol(Error Err)
Create a JITSymbol representing an error in the symbol lookup process (e.g.
JITSymbolFlags()=default
Default-construct a JITSymbolFlags instance.
bool hasError() const
Return true if there was an error retrieving this symbol.
virtual JITSymbol findSymbol(const std::string &Name)=0
This method returns the address of the specified function or variable.
JITEvaluatedSymbol(std::nullptr_t)
Create a 'null' symbol.
JITSymbolFlags(FlagNames Flags)
Construct a JITSymbolFlags instance from the given flags.
Flags for symbols in the JIT.
static JITSymbolFlags fromObjectSymbol(const object::BasicSymbolRef &Symbol)
Construct a JITSymbolFlags value based on the flags of the given libobject symbol.
JITSymbol(JITEvaluatedSymbol Sym)
Construct a JITSymbol from a JITEvaluatedSymbol.
JITEvaluatedSymbol(JITTargetAddress Address, JITSymbolFlags Flags)
Create a symbol for the given address and flags.
virtual ~JITSymbolResolver()=default
static ErrorSuccess success()
Create a success value.
JITSymbol(JITSymbol &&Other)
Expected< JITTargetAddress > getAddress()
Get the address of the symbol in the target address space.
bool isCommon() const
Returns true is the Weak flag is set.
JITSymbol(std::nullptr_t)
Create a 'null' symbol, used to represent a "symbol not found" result from a successful (non-erroneou...
Represents a symbol that has been evaluated to an address already.
std::function< Expected< JITTargetAddress >()> GetAddressFtor
JITTargetAddress getAddress() const
Return the address of this symbol.
bool isExported() const
Returns true is the Weak flag is set.
JITSymbol(JITTargetAddress Addr, JITSymbolFlags Flags)
Create a symbol for a definition with a known address.
This is a value type class that represents a single symbol in the list of symbols in the object file...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isWeak() const
Returns true is the Weak flag is set.
Lightweight error class with error context and mandatory checking.
JITSymbolFlags getFlags() const
Return the flags for this symbol.
JITSymbolFlags getFlags() const
JITSymbol(GetAddressFtor GetAddress, JITSymbolFlags Flags)
Create a symbol for a definition that doesn't have a known address yet.
Error takeError()
Move the error field value out of this JITSymbol.
JITTargetAddress CachedAddr
bool isStrongDefinition() const