LLVM  10.0.0svn
Public Member Functions | List of all members
llvm::MDAttachmentMap Class Reference

Map-like storage for metadata attachments. More...

#include "IR/LLVMContextImpl.h"

Public Member Functions

bool empty () const
size_t size () const
MDNodelookup (unsigned ID) const
 Get a particular attachment (if any). More...
void set (unsigned ID, MDNode &MD)
 Set an attachment to a particular node. More...
bool erase (unsigned ID)
 Remove an attachment. More...
void getAll (SmallVectorImpl< std::pair< unsigned, MDNode *>> &Result) const
 Copy out all the attachments. More...
template<class PredTy >
void remove_if (PredTy shouldRemove)
 Erase matching attachments. More...

Detailed Description

Map-like storage for metadata attachments.

Definition at line 1175 of file LLVMContextImpl.h.

Member Function Documentation

◆ empty()

bool llvm::MDAttachmentMap::empty ( ) const

Definition at line 1179 of file LLVMContextImpl.h.

References llvm::SmallVectorBase::empty().

◆ erase()

bool MDAttachmentMap::erase ( unsigned  ID)

Remove an attachment.

Remove the attachment at ID, if any.

Definition at line 1112 of file Metadata.cpp.

References E, llvm::empty(), and I.

◆ getAll()

void MDAttachmentMap::getAll ( SmallVectorImpl< std::pair< unsigned, MDNode *>> &  Result) const

Copy out all the attachments.

Copies all the current attachments into Result, sorting by attachment ID. This function does not clear Result.

Definition at line 1140 of file Metadata.cpp.

References llvm::array_pod_sort().

◆ lookup()

MDNode * MDAttachmentMap::lookup ( unsigned  ID) const

Get a particular attachment (if any).

Definition at line 1133 of file Metadata.cpp.

References I.

◆ remove_if()

template<class PredTy >
void llvm::MDAttachmentMap::remove_if ( PredTy  shouldRemove)

Erase matching attachments.

Erases all attachments matching the shouldRemove predicate.

Definition at line 1205 of file LLVMContextImpl.h.

References llvm::SmallVectorTemplateCommon< T >::end(), llvm::SmallVectorImpl< T >::erase(), and llvm::remove_if().

◆ set()

void MDAttachmentMap::set ( unsigned  ID,
MDNode MD 

Set an attachment to a particular node.

Set the ID attachment to MD, replacing the current attachment at ID (if anyway).

Definition at line 1102 of file Metadata.cpp.

References I.

◆ size()

size_t llvm::MDAttachmentMap::size ( ) const

Definition at line 1180 of file LLVMContextImpl.h.

References lookup(), and llvm::SmallVectorBase::size().

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