LLVM 17.0.0git
Classes | Public Types | Public Member Functions | List of all members
llvm::DIEValueList Class Reference

A list of DIE values. More...

#include "llvm/CodeGen/DIE.h"

Inheritance diagram for llvm::DIEValueList:
Inheritance graph


class  const_value_iterator
class  value_iterator

Public Types

using value_range = iterator_range< value_iterator >
using const_value_range = iterator_range< const_value_iterator >

Public Member Functions

value_iterator addValue (BumpPtrAllocator &Alloc, const DIEValue &V)
template<class T >
value_iterator addValue (BumpPtrAllocator &Alloc, dwarf::Attribute Attribute, dwarf::Form Form, T &&Value)
void takeValues (DIEValueList &Other)
 Take ownership of the nodes in Other, and append them to the back of the list.
value_range values ()
const_value_range values () const

Detailed Description

A list of DIE values.

This is a singly-linked list, but instead of reversing the order of insertion, we keep a pointer to the back of the list so we can push in order.

There are two main reasons to choose a linked list over a customized vector-like data structure.

  1. For teardown efficiency, we want DIEs to be BumpPtrAllocated. Using a linked list here makes this way easier to accomplish.
  2. Carrying an extra pointer per DIEValue isn't expensive. 45% of DIEs have 2 or fewer values, and 90% have 5 or fewer. A vector would be over-allocated by 50% on average anyway, the same cost as the linked-list node.

Definition at line 669 of file DIE.h.

Member Typedef Documentation

◆ const_value_range

Definition at line 718 of file DIE.h.

◆ value_range

Definition at line 717 of file DIE.h.

Member Function Documentation

◆ addValue() [1/2]

value_iterator llvm::DIEValueList::addValue ( BumpPtrAllocator Alloc,
const DIEValue V 

Definition at line 720 of file DIE.h.

References llvm::Alloc, List, and llvm::IntrusiveBackList< Node >::toIterator().

Referenced by llvm::DwarfUnit::addAttribute(), and addValue().

◆ addValue() [2/2]

template<class T >
value_iterator llvm::DIEValueList::addValue ( BumpPtrAllocator Alloc,
dwarf::Attribute  Attribute,
dwarf::Form  Form,
T &&  Value 

Definition at line 725 of file DIE.h.

References addValue(), and llvm::Alloc.

◆ takeValues()

void llvm::DIEValueList::takeValues ( DIEValueList Other)

Take ownership of the nodes in Other, and append them to the back of the list.

Definition at line 732 of file DIE.h.

References List, and llvm::Other.

◆ values() [1/2]

value_range llvm::DIEValueList::values ( )

◆ values() [2/2]

const_value_range llvm::DIEValueList::values ( ) const

Definition at line 737 of file DIE.h.

References List, and llvm::make_range().

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