31 if (isa<Function>(GV))
33 else if (isa<GlobalAlias>(GV) &&
34 isa<Function>(cast<GlobalAlias>(GV).getAliasee()))
50 auto SymbolType = Symbol.
getType();
52 return SymbolType.takeError();
74 for (
auto &
Symbol : Symbols) {
75 std::string SymName =
Symbol.str();
77 if (
auto AddrOrErr = Sym.getAddress())
80 OnResolved(AddrOrErr.takeError());
83 }
else if (
auto Err = Sym.takeError()) {
84 OnResolved(std::move(Err));
89 if (
auto AddrOrErr = Sym.getAddress())
92 OnResolved(AddrOrErr.takeError());
95 }
else if (
auto Err = Sym.takeError()) {
96 OnResolved(std::move(Err));
99 OnResolved(make_error<StringError>(
"Symbol not found: " +
Symbol,
106 OnResolved(std::move(Result));
115 for (
auto &
Symbol : Symbols) {
116 std::string SymName =
Symbol.str();
120 if (!Sym.getFlags().isStrong())
122 }
else if (
auto Err = Sym.takeError())
123 return std::move(Err);
131 return std::move(Result);
std::function< void(Expected< LookupResult >)> OnResolvedFunction
bool hasLocalLinkage() const
static JITSymbolFlags fromGlobalValue(const GlobalValue &GV)
Construct a JITSymbolFlags value based on the flags of the given global value.
This class represents lattice values for constants.
Expected< LookupSet > getResponsibilitySet(const LookupSet &Symbols) final
Performs flags lookup by calling findSymbolInLogicalDylib and returning the flags value for that symb...
static Expected< JITSymbolFlags > fromObjectSymbol(const object::SymbolRef &Symbol)
Construct a JITSymbolFlags value based on the flags of the given libobject symbol.
std::set< StringRef > LookupSet
virtual JITSymbol findSymbol(const std::string &Name)=0
This method returns the address of the specified function or variable.
Tagged union holding either a T or a Error.
bool hasCommonLinkage() const
bool hasLinkOnceLinkage() const
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...
Flags for symbols in the JIT.
bool hasWeakLinkage() const
Expected< SymbolRef::Type > getType() const
Represents a symbol that has been evaluated to an address already.
bool hasHiddenVisibility() const
This is a value type class that represents a single symbol in the list of symbols in the object file...
uint32_t getFlags() const
Get symbol flags (bitwise OR of SymbolRef::Flags)
std::map< StringRef, JITEvaluatedSymbol > LookupResult
ARM-specific JIT symbol flags.
static ARMJITSymbolFlags fromObjectSymbol(const object::SymbolRef &Symbol)
void lookup(const LookupSet &Symbols, OnResolvedFunction OnResolved) final
Performs lookup by, for each symbol, first calling findSymbolInLogicalDylib and if that fails calling...
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...