LLVM 22.0.0git
|
Multimap-like storage for metadata attachments. More...
#include "IR/LLVMContextImpl.h"
Classes | |
struct | Attachment |
Public Member Functions | |
bool | empty () const |
size_t | size () const |
MDNode * | lookup (unsigned ID) const |
Returns the first attachment with the given ID or nullptr if no such attachment exists. | |
void | get (unsigned ID, SmallVectorImpl< MDNode * > &Result) const |
Appends all attachments with the given ID to Result in insertion order. | |
void | getAll (SmallVectorImpl< std::pair< unsigned, MDNode * > > &Result) const |
Appends all attachments for the global to Result , sorting by attachment ID. | |
void | set (unsigned ID, MDNode *MD) |
Set an attachment to a particular node. | |
void | insert (unsigned ID, MDNode &MD) |
Adds an attachment to a particular node. | |
bool | erase (unsigned ID) |
Remove attachments with the given ID. | |
template<class PredTy> | |
void | remove_if (PredTy shouldRemove) |
Erase matching attachments. |
Multimap-like storage for metadata attachments.
Definition at line 1567 of file LLVMContextImpl.h.
|
inline |
Definition at line 1578 of file LLVMContextImpl.h.
Referenced by erase().
Remove attachments with the given ID.
Remove the attachments at ID
, if any.
Definition at line 1521 of file Metadata.cpp.
References A(), empty(), and llvm::erase_if().
Referenced by set().
void MDAttachments::get | ( | unsigned | ID, |
SmallVectorImpl< MDNode * > & | Result ) const |
void MDAttachments::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 1500 of file Metadata.cpp.
References A(), and llvm::stable_sort().
Adds an attachment to a particular node.
Definition at line 1517 of file Metadata.cpp.
Referenced by set().
Returns the first attachment with the given ID or nullptr if no such attachment exists.
Definition at line 1487 of file Metadata.cpp.
References A().
Referenced by llvm::Value::getMetadataImpl().
|
inline |
Erase matching attachments.
Erases all attachments matching the shouldRemove
predicate.
Definition at line 1612 of file LLVMContextImpl.h.
References llvm::erase_if().
|
inline |
Definition at line 1579 of file LLVMContextImpl.h.