LLVM 20.0.0git
Classes | Public Member Functions | List of all members
llvm::jitlink::BasicLayout Class Reference

BasicLayout simplifies the implementation of JITLinkMemoryManagers. More...

#include "llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"

Classes

struct  ContiguousPageBasedLayoutSizes
 A convenience class that further groups segments based on memory deallocation policy. More...
 
class  Segment
 The Alignment, ContentSize and ZeroFillSize of each segment will be pre-filled from the Graph. More...
 

Public Member Functions

 BasicLayout (LinkGraph &G)
 
LinkGraphgetGraph ()
 Return a reference to the graph this allocation was created from.
 
Expected< ContiguousPageBasedLayoutSizesgetContiguousPageBasedLayoutSizes (uint64_t PageSize)
 Returns the total number of required to allocate all segments (with each segment padded out to page size) for all standard segments, and all finalize segments.
 
iterator_range< SegmentMap::iteratorsegments ()
 Returns an iterator over the segments of the layout.
 
Error apply ()
 Apply the layout to the graph.
 
orc::shared::AllocActionsgraphAllocActions ()
 Returns a reference to the AllocActions in the graph.
 

Detailed Description

BasicLayout simplifies the implementation of JITLinkMemoryManagers.

BasicLayout groups Sections into Segments based on their memory protection and deallocation policies. JITLinkMemoryManagers can construct a BasicLayout from a Graph, and then assign working memory and addresses to each of the Segments. These addreses will be mapped back onto the Graph blocks in the apply method.

Definition at line 210 of file JITLinkMemoryManager.h.

Constructor & Destructor Documentation

◆ BasicLayout()

llvm::jitlink::BasicLayout::BasicLayout ( LinkGraph G)

Member Function Documentation

◆ apply()

Error llvm::jitlink::BasicLayout::apply ( )

Apply the layout to the graph.

Definition at line 102 of file JITLinkMemoryManager.cpp.

References llvm::jitlink::alignToBlock(), assert(), B, and llvm::Error::success().

◆ getContiguousPageBasedLayoutSizes()

Expected< BasicLayout::ContiguousPageBasedLayoutSizes > llvm::jitlink::BasicLayout::getContiguousPageBasedLayoutSizes ( uint64_t  PageSize)

Returns the total number of required to allocate all segments (with each segment padded out to page size) for all standard segments, and all finalize segments.

This is a convenience function for the common case where the segments will be allocated contiguously.

This function will return an error if any segment has an alignment that is higher than a page.

Definition at line 81 of file JITLinkMemoryManager.cpp.

References llvm::alignTo(), llvm::jitlink::BasicLayout::ContiguousPageBasedLayoutSizes::FinalizeSegs, llvm::inconvertibleErrorCode(), PageSize, segments(), llvm::orc::Standard, and llvm::jitlink::BasicLayout::ContiguousPageBasedLayoutSizes::StandardSegs.

◆ getGraph()

LinkGraph & llvm::jitlink::BasicLayout::getGraph ( )
inline

Return a reference to the graph this allocation was created from.

Definition at line 255 of file JITLinkMemoryManager.h.

◆ graphAllocActions()

orc::shared::AllocActions & llvm::jitlink::BasicLayout::graphAllocActions ( )

Returns a reference to the AllocActions in the graph.

This convenience function saves callers from having to #include LinkGraph.h if all they need are allocation actions.

Definition at line 142 of file JITLinkMemoryManager.cpp.

References llvm::jitlink::LinkGraph::allocActions().

◆ segments()

iterator_range< SegmentMap::iterator > llvm::jitlink::BasicLayout::segments ( )
inline

Returns an iterator over the segments of the layout.

Definition at line 270 of file JITLinkMemoryManager.h.

References llvm::orc::AllocGroupSmallMap< T >::begin(), and llvm::orc::AllocGroupSmallMap< T >::end().

Referenced by getContiguousPageBasedLayoutSizes().


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