LLVM  7.0.0svn
Classes | Public Member Functions | List of all members
llvm::MDGlobalAttachmentMap Class Reference

Multimap-like storage for metadata attachments for globals. More...

#include "IR/LLVMContextImpl.h"

Public Member Functions

bool empty () const
 
void get (unsigned ID, SmallVectorImpl< MDNode *> &Result) const
 Appends all attachments with the given ID to Result in insertion order. More...
 
MDNodelookup (unsigned ID) const
 Returns the first attachment with the given ID or nullptr if no such attachment exists. More...
 
void insert (unsigned ID, MDNode &MD)
 
bool erase (unsigned ID)
 
void getAll (SmallVectorImpl< std::pair< unsigned, MDNode *>> &Result) const
 Appends all attachments for the global to Result, sorting by attachment ID. More...
 

Detailed Description

Multimap-like storage for metadata attachments for globals.

This differs from MDAttachmentMap in that it allows multiple attachments per metadata kind.

Definition at line 1187 of file LLVMContextImpl.h.

Member Function Documentation

◆ empty()

bool llvm::MDGlobalAttachmentMap::empty ( ) const
inline

Definition at line 1195 of file LLVMContextImpl.h.

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

◆ erase()

bool MDGlobalAttachmentMap::erase ( unsigned  ID)

Definition at line 1168 of file Metadata.cpp.

References I, and llvm::remove_if().

◆ get()

void MDGlobalAttachmentMap::get ( unsigned  ID,
SmallVectorImpl< MDNode *> &  Result 
) const

Appends all attachments with the given ID to Result in insertion order.

If the global has no attachments with the given ID, or if ID is invalid, leaves Result unchanged.

Definition at line 1161 of file Metadata.cpp.

References llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().

◆ getAll()

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

Appends all attachments for the global to Result, sorting by attachment ID.

Attachments with the same ID appear in insertion order. This function does not clear Result.

Definition at line 1176 of file Metadata.cpp.

References B.

◆ insert()

void MDGlobalAttachmentMap::insert ( unsigned  ID,
MDNode MD 
)

Definition at line 1150 of file Metadata.cpp.

◆ lookup()

MDNode * MDGlobalAttachmentMap::lookup ( unsigned  ID) const

Returns the first attachment with the given ID or nullptr if no such attachment exists.

Definition at line 1154 of file Metadata.cpp.


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