pstore2
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
pstore::repo::linked_definitions Class Reference

Represents the definitions linked to a fragment. More...

#include <linked_definitions_section.hpp>

Inheritance diagram for pstore::repo::linked_definitions:
Inheritance graph
[legend]
Collaboration diagram for pstore::repo::linked_definitions:
Collaboration graph
[legend]

Classes

struct  value_type
 

Public Types

using iterator = value_type *
 
using const_iterator = value_type const *
 

Public Member Functions

template<typename Iterator , typename = typename std::enable_if_t<std::is_same< typename std::iterator_traits<Iterator>::value_type, value_type>::value>>
 linked_definitions (Iterator begin, Iterator end)
 
 linked_definitions (linked_definitions const &)=delete
 
linked_definitionsoperator= (linked_definitions const &)=delete
 
Element access
value_type const & operator[] (std::size_t const i) const
 
value_typeoperator[] (std::size_t const i)
 
Iterators
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
const_iterator cbegin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
const_iterator cend () const noexcept
 
Capacity
bool empty () const noexcept
 Checks whether the container is empty.
 
std::size_t size () const noexcept
 Returns the number of elements.
 

Static Public Member Functions

static auto load (database const &db, typed_address< linked_definitions > const ld) -> std::shared_ptr< linked_definitions const >
 Returns a pointer to the linked_definitions instance. More...
 

Storage

std::size_t size_bytes () const noexcept
 Returns the number of bytes of storage required for the linked_definitions instance.
 
static std::size_t size_bytes (std::uint64_t size) noexcept
 Returns the number of bytes of storage required for an instance of this class with 'size' children. More...
 

Detailed Description

Represents the definitions linked to a fragment.

When a new global object is generated by an LLVM optimisation pass after the repository hash-generation pass has run, the digest for those objects will be generated by the repository back-end (object writer) code. If a fragment has an external fixup referencing this global object, we link the two with a record in the linked-definitions section.

When a fragment is pruned, its linked definitions need to be recorded in the repo.tickets metadata to guarantee that they are present in the final compilation record.

Member Function Documentation

◆ load()

std::shared_ptr< linked_definitions const > pstore::repo::linked_definitions::load ( database const &  db,
typed_address< linked_definitions > const  ld 
) -> std::shared_ptr<linked_definitions const>
static

Returns a pointer to the linked_definitions instance.

Parameters
dbThe database from which the linked_definitions should be loaded.
ldAddress of the linked definitions record in the store.
Returns
A pointer to the linked_definitions in-store memory.

◆ size_bytes()

std::size_t pstore::repo::linked_definitions::size_bytes ( std::uint64_t  size)
staticnoexcept

Returns the number of bytes of storage required for an instance of this class with 'size' children.


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