LLVM  10.0.0svn
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::orc::DynamicLibrarySearchGenerator Class Reference

A utility class to expose symbols found via dlsym to the JIT. More...

#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"

Inheritance diagram for llvm::orc::DynamicLibrarySearchGenerator:
Inheritance graph
[legend]
Collaboration diagram for llvm::orc::DynamicLibrarySearchGenerator:
Collaboration graph
[legend]

Public Types

using SymbolPredicate = std::function< bool(SymbolStringPtr)>
 

Public Member Functions

 DynamicLibrarySearchGenerator (sys::DynamicLibrary Dylib, char GlobalPrefix, SymbolPredicate Allow=SymbolPredicate())
 Create a DynamicLibrarySearchGenerator that searches for symbols in the given sys::DynamicLibrary. More...
 
Expected< SymbolNameSettryToGenerate (JITDylib &JD, const SymbolNameSet &Names) override
 
- Public Member Functions inherited from llvm::orc::JITDylib::DefinitionGenerator
virtual ~DefinitionGenerator ()
 

Static Public Member Functions

static Expected< std::unique_ptr< DynamicLibrarySearchGenerator > > Load (const char *FileName, char GlobalPrefix, SymbolPredicate Allow=SymbolPredicate())
 Permanently loads the library at the given path and, on success, returns a DynamicLibrarySearchGenerator that will search it for symbol definitions in the library. More...
 
static Expected< std::unique_ptr< DynamicLibrarySearchGenerator > > GetForCurrentProcess (char GlobalPrefix, SymbolPredicate Allow=SymbolPredicate())
 Creates a DynamicLibrarySearchGenerator that searches for symbols in the current process. More...
 

Detailed Description

A utility class to expose symbols found via dlsym to the JIT.

If an instance of this class is attached to a JITDylib as a fallback definition generator, then any symbol found in the given DynamicLibrary that passes the 'Allow' predicate will be added to the JITDylib.

Definition at line 243 of file ExecutionUtils.h.

Member Typedef Documentation

◆ SymbolPredicate

Definition at line 245 of file ExecutionUtils.h.

Constructor & Destructor Documentation

◆ DynamicLibrarySearchGenerator()

llvm::orc::DynamicLibrarySearchGenerator::DynamicLibrarySearchGenerator ( sys::DynamicLibrary  Dylib,
char  GlobalPrefix,
SymbolPredicate  Allow = SymbolPredicate() 
)

Create a DynamicLibrarySearchGenerator that searches for symbols in the given sys::DynamicLibrary.

If the Allow predicate is given then only symbols matching the predicate will be searched for. If the predicate is not given then all symbols will be searched for.

Definition at line 177 of file ExecutionUtils.cpp.

Member Function Documentation

◆ GetForCurrentProcess()

static Expected<std::unique_ptr<DynamicLibrarySearchGenerator> > llvm::orc::DynamicLibrarySearchGenerator::GetForCurrentProcess ( char  GlobalPrefix,
SymbolPredicate  Allow = SymbolPredicate() 
)
inlinestatic

Creates a DynamicLibrarySearchGenerator that searches for symbols in the current process.

Definition at line 266 of file ExecutionUtils.h.

References GlobalPrefix, and llvm::SPII::Load.

◆ Load()

Expected< std::unique_ptr< DynamicLibrarySearchGenerator > > llvm::orc::DynamicLibrarySearchGenerator::Load ( const char FileName,
char  GlobalPrefix,
SymbolPredicate  Allow = SymbolPredicate() 
)
static

Permanently loads the library at the given path and, on success, returns a DynamicLibrarySearchGenerator that will search it for symbol definitions in the library.

On failure returns the reason the library failed to load.

Definition at line 183 of file ExecutionUtils.cpp.

References llvm::sys::DynamicLibrary::getPermanentLibrary(), and llvm::inconvertibleErrorCode().

◆ tryToGenerate()

Expected< SymbolNameSet > llvm::orc::DynamicLibrarySearchGenerator::tryToGenerate ( JITDylib JD,
const SymbolNameSet Names 
)
overridevirtual

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