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

A utility class to expose symbols from a static library. More...

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

Inheritance diagram for llvm::orc::StaticLibraryDefinitionGenerator:
[legend]
Collaboration diagram for llvm::orc::StaticLibraryDefinitionGenerator:
[legend]

Public Member Functions

Error tryToGenerate (LookupKind K, JITDylib &JD, JITDylibLookupFlags JDLookupFlags, const SymbolLookupSet &Symbols) override
 DefinitionGenerators should override this method to insert new definitions into the parent JITDylib. More...
 
- Public Member Functions inherited from llvm::orc::JITDylib::DefinitionGenerator
virtual ~DefinitionGenerator ()
 

Static Public Member Functions

static Expected< std::unique_ptr< StaticLibraryDefinitionGenerator > > Load (ObjectLayer &L, const char *FileName)
 Try to create a StaticLibraryDefinitionGenerator from the given path. More...
 
static Expected< std::unique_ptr< StaticLibraryDefinitionGenerator > > Create (ObjectLayer &L, std::unique_ptr< MemoryBuffer > ArchiveBuffer)
 Try to create a StaticLibrarySearchGenerator from the given memory buffer. More...
 

Detailed Description

A utility class to expose symbols from a static library.

If an instance of this class is attached to a JITDylib as a fallback definition generator, then any symbol found in the archive will result in the containing object being added to the JITDylib.

Definition at line 297 of file ExecutionUtils.h.

Member Function Documentation

◆ Create()

Expected< std::unique_ptr< StaticLibraryDefinitionGenerator > > llvm::orc::StaticLibraryDefinitionGenerator::Create ( ObjectLayer &  L,
std::unique_ptr< MemoryBuffer >  ArchiveBuffer 
)
static

Try to create a StaticLibrarySearchGenerator from the given memory buffer.

This call will succeed if the buffer contains a valid archive, otherwise it will return an error.

Definition at line 262 of file ExecutionUtils.cpp.

◆ Load()

Expected< std::unique_ptr< StaticLibraryDefinitionGenerator > > llvm::orc::StaticLibraryDefinitionGenerator::Load ( ObjectLayer &  L,
const char *  FileName 
)
static

Try to create a StaticLibraryDefinitionGenerator from the given path.

This call will succeed if the file at the given path is a static library is a valid archive, otherwise it will return an error.

Definition at line 252 of file ExecutionUtils.cpp.

References llvm::errorOrToExpected(), and llvm::MemoryBuffer::getFile().

◆ tryToGenerate()

Error llvm::orc::StaticLibraryDefinitionGenerator::tryToGenerate ( LookupKind  K,
JITDylib &  JD,
JITDylibLookupFlags  JDLookupFlags,
const SymbolLookupSet &  LookupSet 
)
overridevirtual

DefinitionGenerators should override this method to insert new definitions into the parent JITDylib.

K specifies the kind of this lookup. JD specifies the target JITDylib being searched, and JDLookupFlags specifies whether the search should match against hidden symbols. Finally, Symbols describes the set of unresolved symbols and their associated lookup flags.

Implements llvm::orc::JITDylib::DefinitionGenerator.

Definition at line 275 of file ExecutionUtils.cpp.

References llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, ValueInfoT, detail::DenseSetPair< ValueT > >, ValueInfoT >::insert(), Name, llvm::None, llvm::orc::Static, and llvm::Error::success().


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