LLVM 20.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 1405 of file LLVMContextImpl.h.
|
inline |
Definition at line 1416 of file LLVMContextImpl.h.
References llvm::SmallVectorBase< Size_T >::empty().
Referenced by erase().
Remove attachments with the given ID.
Remove the attachments at ID
, if any.
Definition at line 1445 of file Metadata.cpp.
References A, empty(), and llvm::erase_if().
Referenced by set().
void MDAttachments::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 1418 of file Metadata.cpp.
References A.
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 1424 of file Metadata.cpp.
References A, and llvm::stable_sort().
Adds an attachment to a particular node.
Definition at line 1441 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 1411 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 1450 of file LLVMContextImpl.h.
References llvm::erase_if().
Set an attachment to a particular node.
Set the ID
attachment to MD
, replacing the current attachments at ID
(if anyway).
Definition at line 1435 of file Metadata.cpp.
|
inline |
Definition at line 1417 of file LLVMContextImpl.h.
References llvm::SmallVectorBase< Size_T >::size().