LLVM  7.0.0svn
Public Member Functions | List of all members
llvm::LegacyJITSymbolResolver Class Referenceabstract

Legacy symbol resolution interface. More...

#include "llvm/ExecutionEngine/JITSymbol.h"

Inheritance diagram for llvm::LegacyJITSymbolResolver:
Inheritance graph
[legend]
Collaboration diagram for llvm::LegacyJITSymbolResolver:
Collaboration graph
[legend]

Public Member Functions

Expected< LookupResultlookup (const LookupSet &Symbols) final
 Performs lookup by, for each symbol, first calling findSymbolInLogicalDylib and if that fails calling findSymbol. More...
 
Expected< LookupFlagsResultlookupFlags (const LookupSet &Symbols) final
 Performs flags lookup by calling findSymbolInLogicalDylib and returning the flags value for that symbol. More...
 
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. More...
 
virtual JITSymbol findSymbol (const std::string &Name)=0
 This method returns the address of the specified function or variable. More...
 
- Public Member Functions inherited from llvm::JITSymbolResolver
virtual ~JITSymbolResolver ()=default
 

Additional Inherited Members

- Public Types inherited from llvm::JITSymbolResolver
using LookupSet = std::set< StringRef >
 
using LookupResult = std::map< StringRef, JITEvaluatedSymbol >
 
using LookupFlagsResult = std::map< StringRef, JITSymbolFlags >
 

Detailed Description

Legacy symbol resolution interface.

Definition at line 318 of file JITSymbol.h.

Member Function Documentation

◆ findSymbol()

virtual JITSymbol llvm::LegacyJITSymbolResolver::findSymbol ( const std::string &  Name)
pure virtual

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.

Implemented in llvm::RTDyldMemoryManager, llvm::orc::LambdaResolver< DylibLookupFtorT, ExternalLookupFtorT >, llvm::orc::NullLegacyResolver, and llvm::LinkingSymbolResolver.

Referenced by lookup().

◆ findSymbolInLogicalDylib()

virtual JITSymbol llvm::LegacyJITSymbolResolver::findSymbolInLogicalDylib ( const std::string &  Name)
pure virtual

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.

Implemented in llvm::RTDyldMemoryManager, llvm::orc::NullLegacyResolver, llvm::LinkingSymbolResolver, and llvm::orc::LambdaResolver< DylibLookupFtorT, ExternalLookupFtorT >.

Referenced by lookup(), and lookupFlags().

◆ lookup()

Expected< JITSymbolResolver::LookupResult > LegacyJITSymbolResolver::lookup ( const LookupSet Symbols)
finalvirtual

Performs lookup by, for each symbol, first calling findSymbolInLogicalDylib and if that fails calling findSymbol.

Implements llvm::JITSymbolResolver.

Definition at line 55 of file JITSymbol.cpp.

References findSymbol(), findSymbolInLogicalDylib(), llvm::inconvertibleErrorCode(), and llvm::ARMBuildAttrs::Symbol.

◆ lookupFlags()

Expected< JITSymbolResolver::LookupFlagsResult > LegacyJITSymbolResolver::lookupFlags ( const LookupSet Symbols)
finalvirtual

Performs flags lookup by calling findSymbolInLogicalDylib and returning the flags value for that symbol.

Implements llvm::JITSymbolResolver.

Definition at line 87 of file JITSymbol.cpp.

References findSymbolInLogicalDylib(), and llvm::ARMBuildAttrs::Symbol.


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