LLVM 19.0.0git
Public Member Functions | List of all members
llvm::LinkingSymbolResolver Class Reference

#include "ExecutionEngine/MCJIT/MCJIT.h"

Inheritance diagram for llvm::LinkingSymbolResolver:
Inheritance graph
[legend]

Public Member Functions

 LinkingSymbolResolver (MCJIT &Parent, std::shared_ptr< LegacyJITSymbolResolver > Resolver)
 
JITSymbol findSymbol (const std::string &Name) override
 This method returns the address of the specified function or variable.
 
JITSymbol findSymbolInLogicalDylib (const std::string &Name) override
 This method returns the address of the specified symbol if it exists within the logical dynamic library represented by this JITSymbolResolver.
 
- Public Member Functions inherited from llvm::LegacyJITSymbolResolver
void lookup (const LookupSet &Symbols, OnResolvedFunction OnResolved) final
 Performs lookup by, for each symbol, first calling findSymbolInLogicalDylib and if that fails calling findSymbol.
 
Expected< LookupSetgetResponsibilitySet (const LookupSet &Symbols) final
 Performs flags lookup by calling findSymbolInLogicalDylib and returning the flags value for that symbol.
 
virtual JITSymbol findSymbolInLogicalDylib (const std::string &Name)=0
 This method returns the address of the specified symbol if it exists within the logical dynamic library represented by this JITSymbolResolver.
 
virtual JITSymbol findSymbol (const std::string &Name)=0
 This method returns the address of the specified function or variable.
 
- Public Member Functions inherited from llvm::JITSymbolResolver
virtual ~JITSymbolResolver ()=default
 
virtual void lookup (const LookupSet &Symbols, OnResolvedFunction OnResolved)=0
 Returns the fully resolved address and flags for each of the given symbols.
 
virtual Expected< LookupSetgetResponsibilitySet (const LookupSet &Symbols)=0
 Returns the subset of the given symbols that should be materialized by the caller.
 
virtual bool allowsZeroSymbols ()
 Specify if this resolver can return valid symbols with zero value.
 

Additional Inherited Members

- Public Types inherited from llvm::JITSymbolResolver
using LookupSet = std::set< StringRef >
 
using LookupResult = std::map< StringRef, JITEvaluatedSymbol >
 
using OnResolvedFunction = unique_function< void(Expected< LookupResult >)>
 

Detailed Description

Definition at line 27 of file MCJIT.h.

Constructor & Destructor Documentation

◆ LinkingSymbolResolver()

llvm::LinkingSymbolResolver::LinkingSymbolResolver ( MCJIT Parent,
std::shared_ptr< LegacyJITSymbolResolver Resolver 
)
inline

Definition at line 29 of file MCJIT.h.

Member Function Documentation

◆ findSymbol()

JITSymbol LinkingSymbolResolver::findSymbol ( const std::string &  Name)
overridevirtual

This method returns the address of the specified function or variable.

It is used to resolve symbols during module linking.

If the returned symbol's address is equal to ~0ULL then RuntimeDyld will skip all relocations for that symbol, and the client will be responsible for handling them manually.

Implements llvm::LegacyJITSymbolResolver.

Definition at line 675 of file MCJIT.cpp.

References llvm::MCJIT::findSymbol(), llvm::ExecutionEngine::isSymbolSearchingDisabled(), and Name.

◆ findSymbolInLogicalDylib()

JITSymbol llvm::LinkingSymbolResolver::findSymbolInLogicalDylib ( const std::string &  Name)
inlineoverridevirtual

This method returns the address of the specified symbol if it exists within the logical dynamic library represented by this JITSymbolResolver.

Unlike findSymbol, queries through this interface should return addresses for hidden symbols.

This is of particular importance for the Orc JIT APIs, which support lazy compilation by breaking up modules: Each of those broken out modules must be able to resolve hidden symbols provided by the others. Clients writing memory managers for MCJIT can usually ignore this method.

This method will be queried by RuntimeDyld when checking for previous definitions of common symbols.

Implements llvm::LegacyJITSymbolResolver.

Definition at line 36 of file MCJIT.h.


The documentation for this class was generated from the following files: