class StaticLibraryDefinitionGenerator

Declaration

class StaticLibraryDefinitionGenerator : public DefinitionGenerator { /* full declaration omitted */ };

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.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h:259

Inherits from: DefinitionGenerator

Member Variables

private llvm::orc::ObjectLayer& L
private llvm::orc::StaticLibraryDefinitionGenerator:: GetObjectFileInterface GetObjFileInterface
private std::unique_ptr<MemoryBuffer> ArchiveBuffer
private std::unique_ptr<object::Archive> Archive

Method Overview

  • public static Expected<std::unique_ptr<StaticLibraryDefinitionGenerator>> Create(llvm::orc::ObjectLayer & L, std::unique_ptr<MemoryBuffer> ArchiveBuffer, llvm::orc::StaticLibraryDefinitionGenerator::GetObjectFileInterface GetObjFileInterface = llvm::unique_function<llvm::Expected<llvm::orc::MaterializationUnit::Interface> (llvm::orc::ExecutionSession &, llvm::MemoryBufferRef)>())
  • public static Expected<std::unique_ptr<StaticLibraryDefinitionGenerator>> Load(llvm::orc::ObjectLayer & L, const char * FileName, llvm::orc::StaticLibraryDefinitionGenerator::GetObjectFileInterface GetObjFileInterface = llvm::unique_function<llvm::Expected<llvm::orc::MaterializationUnit::Interface> (llvm::orc::ExecutionSession &, llvm::MemoryBufferRef)>())
  • public static Expected<std::unique_ptr<StaticLibraryDefinitionGenerator>> Load(llvm::orc::ObjectLayer & L, const char * FileName, const llvm::Triple & TT, llvm::orc::StaticLibraryDefinitionGenerator::GetObjectFileInterface GetObjFileInterface = llvm::unique_function<llvm::Expected<llvm::orc::MaterializationUnit::Interface> (llvm::orc::ExecutionSession &, llvm::MemoryBufferRef)>())
  • private StaticLibraryDefinitionGenerator(llvm::orc::ObjectLayer & L, std::unique_ptr<MemoryBuffer> ArchiveBuffer, llvm::orc::StaticLibraryDefinitionGenerator::GetObjectFileInterface GetObjFileInterface, llvm::Error & Err)
  • public llvm::Error tryToGenerate(llvm::orc::LookupState & LS, llvm::orc::LookupKind K, llvm::orc::JITDylib & JD, llvm::orc::JITDylibLookupFlags JDLookupFlags, const llvm::orc::SymbolLookupSet & Symbols)

Inherited from DefinitionGenerator:

Methods

static Expected<std::unique_ptr<
    StaticLibraryDefinitionGenerator>>
Create(
    llvm::orc::ObjectLayer& L,
    std::unique_ptr<MemoryBuffer> ArchiveBuffer,
    llvm::orc::StaticLibraryDefinitionGenerator::
        GetObjectFileInterface
            GetObjFileInterface = llvm::
                unique_function<llvm::Expected<
                    llvm::orc::
                        MaterializationUnit::
                            Interface>(
                    llvm::orc::ExecutionSession&,
                    llvm::MemoryBufferRef)>())

Description

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.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h:287

Parameters

llvm::orc::ObjectLayer& L
std::unique_ptr<MemoryBuffer> ArchiveBuffer
llvm::orc::StaticLibraryDefinitionGenerator:: GetObjectFileInterface GetObjFileInterface = llvm::unique_function<llvm::Expected<llvm::orc::MaterializationUnit::Interface> (llvm::orc::ExecutionSession &, llvm::MemoryBufferRef)>()

static Expected<std::unique_ptr<
    StaticLibraryDefinitionGenerator>>
Load(llvm::orc::ObjectLayer& L,
     const char* FileName,
     llvm::orc::StaticLibraryDefinitionGenerator::
         GetObjectFileInterface
             GetObjFileInterface = llvm::
                 unique_function<llvm::Expected<
                     llvm::orc::
                         MaterializationUnit::
                             Interface>(
                     llvm::orc::ExecutionSession&,
                     llvm::MemoryBufferRef)>())

Description

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.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h:271

Parameters

llvm::orc::ObjectLayer& L
const char* FileName
llvm::orc::StaticLibraryDefinitionGenerator:: GetObjectFileInterface GetObjFileInterface = llvm::unique_function<llvm::Expected<llvm::orc::MaterializationUnit::Interface> (llvm::orc::ExecutionSession &, llvm::MemoryBufferRef)>()

static Expected<std::unique_ptr<
    StaticLibraryDefinitionGenerator>>
Load(llvm::orc::ObjectLayer& L,
     const char* FileName,
     const llvm::Triple& TT,
     llvm::orc::StaticLibraryDefinitionGenerator::
         GetObjectFileInterface
             GetObjFileInterface = llvm::
                 unique_function<llvm::Expected<
                     llvm::orc::
                         MaterializationUnit::
                             Interface>(
                     llvm::orc::ExecutionSession&,
                     llvm::MemoryBufferRef)>())

Description

Try to create a StaticLibraryDefinitionGenerator from the given path. This call will succeed if the file at the given path is a static library or a MachO universal binary containing a static library that is compatible with the given triple. Otherwise it will return an error.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h:280

Parameters

llvm::orc::ObjectLayer& L
const char* FileName
const llvm::Triple& TT
llvm::orc::StaticLibraryDefinitionGenerator:: GetObjectFileInterface GetObjFileInterface = llvm::unique_function<llvm::Expected<llvm::orc::MaterializationUnit::Interface> (llvm::orc::ExecutionSession &, llvm::MemoryBufferRef)>()

StaticLibraryDefinitionGenerator(
    llvm::orc::ObjectLayer& L,
    std::unique_ptr<MemoryBuffer> ArchiveBuffer,
    llvm::orc::StaticLibraryDefinitionGenerator::
        GetObjectFileInterface
            GetObjFileInterface,
    llvm::Error& Err)

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h:295

Parameters

llvm::orc::ObjectLayer& L
std::unique_ptr<MemoryBuffer> ArchiveBuffer
llvm::orc::StaticLibraryDefinitionGenerator:: GetObjectFileInterface GetObjFileInterface
llvm::Error& Err

llvm::Error tryToGenerate(
    llvm::orc::LookupState& LS,
    llvm::orc::LookupKind K,
    llvm::orc::JITDylib& JD,
    llvm::orc::JITDylibLookupFlags JDLookupFlags,
    const llvm::orc::SymbolLookupSet& Symbols)

Description

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.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h:290

Parameters

llvm::orc::LookupState& LS
llvm::orc::LookupKind K
llvm::orc::JITDylib& JD
llvm::orc::JITDylibLookupFlags JDLookupFlags
const llvm::orc::SymbolLookupSet& Symbols