|
LLVM
10.0.0
|
#include "llvm/ExecutionEngine/JITLink/JITLink.h"
Classes | |
| class | nested_collection_iterator |
Public Types | |
| using | external_symbol_iterator = ExternalSymbolSet::iterator |
| using | section_iterator = pointee_iterator< SectionList::iterator > |
| using | const_section_iterator = pointee_iterator< SectionList::const_iterator > |
| using | defined_symbol_iterator = nested_collection_iterator< const_section_iterator, Section::symbol_iterator, Symbol *, getSectionSymbols > |
| using | const_defined_symbol_iterator = nested_collection_iterator< const_section_iterator, Section::const_symbol_iterator, const Symbol *, getSectionConstSymbols > |
| using | block_iterator = nested_collection_iterator< const_section_iterator, Section::block_iterator, Block *, getSectionBlocks > |
| using | const_block_iterator = nested_collection_iterator< const_section_iterator, Section::const_block_iterator, const Block *, getSectionConstBlocks > |
| using | SplitBlockCache = Optional< SmallVector< Symbol *, 8 > > |
| Cache type for the splitBlock function. More... | |
Public Member Functions | |
| LinkGraph (std::string Name, unsigned PointerSize, support::endianness Endianness) | |
| const std::string & | getName () |
| Returns the name of this graph (usually the name of the original underlying MemoryBuffer). More... | |
| unsigned | getPointerSize () const |
| Returns the pointer size for use in this graph. More... | |
| support::endianness | getEndianness () const |
| Returns the endianness of content in this graph. More... | |
| Section & | createSection (StringRef Name, sys::Memory::ProtectionFlags Prot) |
| Create a section with the given name, protection flags, and alignment. More... | |
| Block & | createContentBlock (Section &Parent, StringRef Content, uint64_t Address, uint64_t Alignment, uint64_t AlignmentOffset) |
| Create a content block. More... | |
| Block & | createZeroFillBlock (Section &Parent, uint64_t Size, uint64_t Address, uint64_t Alignment, uint64_t AlignmentOffset) |
| Create a zero-fill block. More... | |
| Block & | splitBlock (Block &B, size_t SplitIndex, SplitBlockCache *Cache=nullptr) |
| Splits block B at the given index which must be greater than zero. More... | |
| Symbol & | addExternalSymbol (StringRef Name, uint64_t Size, Linkage L) |
| Add an external symbol. More... | |
| Symbol & | addAbsoluteSymbol (StringRef Name, JITTargetAddress Address, uint64_t Size, Linkage L, Scope S, bool IsLive) |
| Add an absolute symbol. More... | |
| Symbol & | addCommonSymbol (StringRef Name, Scope S, Section &Section, JITTargetAddress Address, uint64_t Size, uint64_t Alignment, bool IsLive) |
| Convenience method for adding a weak zero-fill symbol. More... | |
| Symbol & | addAnonymousSymbol (Block &Content, JITTargetAddress Offset, JITTargetAddress Size, bool IsCallable, bool IsLive) |
| Add an anonymous symbol. More... | |
| Symbol & | addDefinedSymbol (Block &Content, JITTargetAddress Offset, StringRef Name, JITTargetAddress Size, Linkage L, Scope S, bool IsCallable, bool IsLive) |
| Add a named symbol. More... | |
| iterator_range< section_iterator > | sections () |
| Section * | findSectionByName (StringRef Name) |
| Returns the section with the given name if it exists, otherwise returns null. More... | |
| iterator_range< block_iterator > | blocks () |
| iterator_range< const_block_iterator > | blocks () const |
| iterator_range< external_symbol_iterator > | external_symbols () |
| iterator_range< external_symbol_iterator > | absolute_symbols () |
| iterator_range< defined_symbol_iterator > | defined_symbols () |
| iterator_range< const_defined_symbol_iterator > | defined_symbols () const |
| void | makeExternal (Symbol &Sym) |
| Turn a defined symbol into an external one. More... | |
| void | removeExternalSymbol (Symbol &Sym) |
| Removes an external symbol. Also removes the underlying Addressable. More... | |
| void | removeAbsoluteSymbol (Symbol &Sym) |
| Remove an absolute symbol. Also removes the underlying Addressable. More... | |
| void | removeDefinedSymbol (Symbol &Sym) |
| Removes defined symbols. Does not remove the underlying block. More... | |
| void | removeBlock (Block &B) |
| Remove a block. More... | |
| void | dump (raw_ostream &OS, std::function< StringRef(Edge::Kind)> EdegKindToName=std::function< StringRef(Edge::Kind)>()) |
| Dump the graph. More... | |
| using llvm::jitlink::LinkGraph::block_iterator = nested_collection_iterator<const_section_iterator, Section::block_iterator, Block *, getSectionBlocks> |
| using llvm::jitlink::LinkGraph::const_block_iterator = nested_collection_iterator<const_section_iterator, Section::const_block_iterator, const Block *, getSectionConstBlocks> |
| using llvm::jitlink::LinkGraph::const_defined_symbol_iterator = nested_collection_iterator<const_section_iterator, Section::const_symbol_iterator, const Symbol *, getSectionConstSymbols> |
| using llvm::jitlink::LinkGraph::const_section_iterator = pointee_iterator<SectionList::const_iterator> |
| using llvm::jitlink::LinkGraph::defined_symbol_iterator = nested_collection_iterator<const_section_iterator, Section::symbol_iterator, Symbol *, getSectionSymbols> |
| using llvm::jitlink::LinkGraph::section_iterator = pointee_iterator<SectionList::iterator> |
| using llvm::jitlink::LinkGraph::SplitBlockCache = Optional<SmallVector<Symbol *, 8> > |
|
inline |
|
inline |
Definition at line 931 of file JITLink.h.
References llvm::make_range().
Referenced by llvm::orc::ObjectLinkingLayerJITLinkContext::modifyPassConfig(), and llvm::orc::ObjectLinkingLayerJITLinkContext::notifyResolved().
|
inline |
Add an anonymous symbol.
Definition at line 883 of file JITLink.h.
References Allocator, and llvm::jitlink::Block::getSection().
|
inline |
Add a named symbol.
Definition at line 893 of file JITLink.h.
References Allocator, and llvm::jitlink::Block::getSection().
|
inline |
Add an external symbol.
Some formats (e.g. ELF) allow Symbols to have sizes. For Symbols whose size is not known, you should substitute '0'. For external symbols Linkage determines whether the symbol must be present during lookup: Externals with strong linkage must be found or an error will be emitted. Externals with weak linkage are permitted to be undefined, in which case they are assigned a value of 0.
Definition at line 852 of file JITLink.h.
References Allocator.
|
inline |
Definition at line 917 of file JITLink.h.
References llvm::make_range().
Referenced by llvm::jitlink::prune(), and llvm::jitlink::BasicGOTAndStubsBuilder< BuilderImpl >::run().
|
inline |
Definition at line 922 of file JITLink.h.
References llvm::make_range().
|
inline |
Create a section with the given name, protection flags, and alignment.
Definition at line 796 of file JITLink.h.
References llvm::ARMBuildAttrs::Section, and llvm::StringRef::size().
|
inline |
Definition at line 935 of file JITLink.h.
References llvm::make_range().
Referenced by llvm::jitlink::markAllSymbolsLive(), llvm::orc::ObjectLinkingLayerJITLinkContext::modifyPassConfig(), llvm::orc::ObjectLinkingLayerJITLinkContext::notifyResolved(), and llvm::jitlink::prune().
|
inline |
Definition at line 940 of file JITLink.h.
References llvm::make_range().
| void llvm::jitlink::LinkGraph::dump | ( | raw_ostream & | OS, |
| std::function< StringRef(Edge::Kind)> | EdegKindToName = std::function<StringRef(Edge::Kind)>() |
||
| ) |
Dump the graph.
If supplied, the EdgeKindToName function will be used to name edge kinds in the debug output. Otherwise raw edge kind numbers will be displayed.
Definition at line 231 of file JITLink.cpp.
References E, llvm::StringRef::empty(), llvm::format(), llvm::jitlink::getGenericEdgeKindName(), llvm::jitlink::printEdge(), and llvm::to_string().
|
inline |
Definition at line 927 of file JITLink.h.
References llvm::make_range().
Returns the section with the given name if it exists, otherwise returns null.
Definition at line 910 of file JITLink.h.
References llvm::jitlink::Section::getName(), and Name.
Referenced by llvm::jitlink::createEHFrameRecorderPass(), llvm::jitlink::EHFrameSplitter::operator()(), and llvm::jitlink::EHFrameEdgeFixer::operator()().
|
inline |
Returns the endianness of content in this graph.
Definition at line 793 of file JITLink.h.
References llvm::msgpack::Endianness.
|
inline |
Returns the name of this graph (usually the name of the original underlying MemoryBuffer).
Definition at line 787 of file JITLink.h.
References Name.
|
inline |
|
inline |
Turn a defined symbol into an external one.
Definition at line 947 of file JITLink.h.
References assert(), llvm::jitlink::Symbol::getAddressable(), llvm::jitlink::Symbol::getBlock(), llvm::jitlink::Block::getSection(), llvm::jitlink::Addressable::isAbsolute(), and llvm::jitlink::Symbol::isDefined().
Referenced by llvm::orc::ObjectLinkingLayerJITLinkContext::modifyPassConfig().
|
inline |
Remove an absolute symbol. Also removes the underlying Addressable.
Definition at line 973 of file JITLink.h.
References assert(), llvm::jitlink::Symbol::isAbsolute(), and llvm::jitlink::Symbol::isDefined().
|
inline |
Remove a block.
Definition at line 992 of file JITLink.h.
References Allocator, llvm::dump(), llvm::msgpack::Endianness, function, llvm::jitlink::Block::getSection(), and Name.
Referenced by llvm::jitlink::prune().
|
inline |
Removes defined symbols. Does not remove the underlying block.
Definition at line 985 of file JITLink.h.
References assert(), llvm::jitlink::Symbol::getBlock(), llvm::jitlink::Block::getSection(), and llvm::jitlink::Symbol::isDefined().
Referenced by llvm::jitlink::prune().
|
inline |
Removes an external symbol. Also removes the underlying Addressable.
Definition at line 962 of file JITLink.h.
References assert(), llvm::jitlink::Symbol::isAbsolute(), and llvm::jitlink::Symbol::isDefined().
|
inline |
Definition at line 903 of file JITLink.h.
References llvm::make_range().
Referenced by llvm::jitlink::EHFrameEdgeFixer::operator()().
| Block & llvm::jitlink::LinkGraph::splitBlock | ( | Block & | B, |
| size_t | SplitIndex, | ||
| SplitBlockCache * | Cache = nullptr |
||
| ) |
Splits block B at the given index which must be greater than zero.
If SplitIndex == B.getSize() then this function is a no-op and returns B. If SplitIndex < B.getSize() then this function returns a new block covering the range [ 0, SplitIndex ), and B is modified to cover the range [ SplitIndex, B.size() ).
The optional Cache parameter can be used to speed up repeated calls to splitBlock for a single block. If the value is None the cache will be treated as uninitialized and splitBlock will populate it. Otherwise it is assumed to contain the list of Symbols pointing at B, sorted in descending order of offset.
Notes:
Definition at line 152 of file JITLink.cpp.
References assert(), B, E, llvm::jitlink::Block::edges(), llvm::jitlink::Addressable::getAddress(), llvm::jitlink::Block::getAlignment(), llvm::jitlink::Block::getAlignmentOffset(), llvm::jitlink::Block::getContent(), llvm::jitlink::Symbol::getOffset(), llvm::jitlink::Block::getSection(), llvm::jitlink::Block::getSize(), I, llvm::jitlink::Block::isZeroFill(), llvm::None, llvm::jitlink::Block::removeEdge(), llvm::jitlink::Addressable::setAddress(), llvm::jitlink::Block::setAlignmentOffset(), llvm::jitlink::Block::setContent(), llvm::sort(), llvm::StringRef::substr(), and llvm::jitlink::Section::symbols().
1.8.13