LLVM  7.0.0svn
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::orc::VSO Class Reference

Represents a dynamic linkage unit in a JIT process. More...

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

Classes

struct  LookupResult
 

Public Types

enum  RelativeLinkageStrength { NewDefinitionIsStronger, DuplicateDefinition, ExistingDefinitionIsStronger }
 
using SetDefinitionsResult = std::map< SymbolStringPtr, RelativeLinkageStrength >
 
using SourceWorkMap = std::map< std::shared_ptr< SymbolSource >, SymbolNameSet >
 

Public Member Functions

 VSO ()=default
 
 VSO (const VSO &)=delete
 
VSOoperator= (const VSO &)=delete
 
 VSO (VSO &&)=delete
 
VSOoperator= (VSO &&)=delete
 
RelativeLinkageStrength compareLinkage (SymbolStringPtr Name, JITSymbolFlags NewFlags) const
 Compare new linkage with an existing symbol's linkage. More...
 
Error define (SymbolMap NewSymbols)
 Adds the given symbols to the mapping as resolved, finalized symbols. More...
 
Error defineLazy (const SymbolFlagsMap &NewSymbols, std::shared_ptr< SymbolSource > Source)
 Adds the given symbols to the mapping as lazy symbols. More...
 
void resolve (SymbolMap SymbolValues)
 Add the given symbol/address mappings to the dylib, but do not mark the symbols as finalized yet. More...
 
void finalize (SymbolNameSet SymbolsToFinalize)
 Finalize the given symbols. More...
 
SymbolNameSet lookupFlags (SymbolFlagsMap &Flags, SymbolNameSet Symbols)
 Look up the flags for the given symbols. More...
 
LookupResult lookup (std::shared_ptr< AsynchronousSymbolQuery > Query, SymbolNameSet Symbols)
 Apply the given query to the given symbols in this VSO. More...
 

Static Public Member Functions

static RelativeLinkageStrength compareLinkage (Optional< JITSymbolFlags > OldFlags, JITSymbolFlags NewFlags)
 Compare new linkage with existing linkage. More...
 

Friends

class ExecutionSession
 

Detailed Description

Represents a dynamic linkage unit in a JIT process.

VSO acts as a symbol table (symbol definitions can be set and the dylib queried to find symbol addresses) and as a key for tracking resources (since a VSO's address is fixed).

Definition at line 192 of file Core.h.

Member Typedef Documentation

◆ SetDefinitionsResult

Definition at line 203 of file Core.h.

◆ SourceWorkMap

using llvm::orc::VSO::SourceWorkMap = std::map<std::shared_ptr<SymbolSource>, SymbolNameSet>

Definition at line 204 of file Core.h.

Member Enumeration Documentation

◆ RelativeLinkageStrength

Enumerator
NewDefinitionIsStronger 
DuplicateDefinition 
ExistingDefinitionIsStronger 

Definition at line 196 of file Core.h.

Constructor & Destructor Documentation

◆ VSO() [1/3]

llvm::orc::VSO::VSO ( )
default

◆ VSO() [2/3]

llvm::orc::VSO::VSO ( const VSO )
delete

◆ VSO() [3/3]

llvm::orc::VSO::VSO ( VSO &&  )
delete

Member Function Documentation

◆ compareLinkage() [1/2]

VSO::RelativeLinkageStrength llvm::orc::VSO::compareLinkage ( Optional< JITSymbolFlags OldFlags,
JITSymbolFlags  NewFlags 
)
static

Compare new linkage with existing linkage.

Definition at line 200 of file Core.cpp.

References DuplicateDefinition, ExistingDefinitionIsStronger, llvm::JITSymbolFlags::isStrong(), NewDefinitionIsStronger, and llvm::None.

◆ compareLinkage() [2/2]

VSO::RelativeLinkageStrength llvm::orc::VSO::compareLinkage ( SymbolStringPtr  Name,
JITSymbolFlags  NewFlags 
) const

Compare new linkage with an existing symbol's linkage.

Definition at line 219 of file Core.cpp.

References I, and llvm::None.

◆ define()

Error llvm::orc::VSO::define ( SymbolMap  NewSymbols)

Adds the given symbols to the mapping as resolved, finalized symbols.

FIXME: We can take this by const-ref once symbol-based laziness is removed.

Definition at line 227 of file Core.cpp.

References I, llvm::joinErrors(), llvm::None, and llvm::Error::success().

◆ defineLazy()

Error llvm::orc::VSO::defineLazy ( const SymbolFlagsMap NewSymbols,
std::shared_ptr< SymbolSource Source 
)

Adds the given symbols to the mapping as lazy symbols.

Definition at line 256 of file Core.cpp.

References I, llvm::joinErrors(), llvm::None, and llvm::Error::success().

◆ finalize()

void llvm::orc::VSO::finalize ( SymbolNameSet  SymbolsToFinalize)

Finalize the given symbols.

Definition at line 295 of file Core.cpp.

References assert(), and I.

◆ lookup()

VSO::LookupResult llvm::orc::VSO::lookup ( std::shared_ptr< AsynchronousSymbolQuery Query,
SymbolNameSet  Symbols 
)

Apply the given query to the given symbols in this VSO.

For symbols in this VSO that have already been materialized, their address will be set in the query immediately.

For symbols in this VSO that have not been materialized, the query will be recorded and the source for those symbols (plus the set of symbols to be materialized by that source) will be returned as the MaterializationWork field of the LookupResult.

Any symbols not found in this VSO will be returned in the UnresolvedSymbols field of the LookupResult.

Definition at line 322 of file Core.cpp.

References E, and I.

◆ lookupFlags()

SymbolNameSet llvm::orc::VSO::lookupFlags ( SymbolFlagsMap Flags,
SymbolNameSet  Symbols 
)

Look up the flags for the given symbols.

Returns the flags for the give symbols, together with the set of symbols not found.

Definition at line 303 of file Core.cpp.

References E, I, and llvm::JITSymbolFlags::stripTransientFlags().

◆ operator=() [1/2]

VSO& llvm::orc::VSO::operator= ( const VSO )
delete

◆ operator=() [2/2]

VSO& llvm::orc::VSO::operator= ( VSO &&  )
delete

◆ resolve()

void llvm::orc::VSO::resolve ( SymbolMap  SymbolValues)

Add the given symbol/address mappings to the dylib, but do not mark the symbols as finalized yet.

Definition at line 287 of file Core.cpp.

References assert(), and I.

Friends And Related Function Documentation

◆ ExecutionSession

friend class ExecutionSession
friend

Definition at line 193 of file Core.h.


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