class MDAttachments
Declaration
class MDAttachments { /* full declaration omitted */ };
Description
Multimap-like storage for metadata attachments.
Declared at: llvm/lib/IR/LLVMContextImpl.h:1304
Member Variables
- private SmallVector<llvm::MDAttachments::Attachment, 1> Attachments
Method Overview
- public bool empty() const
- public bool erase(unsigned int ID)
- public void get(unsigned int ID, SmallVectorImpl<llvm::MDNode *> & Result) const
- public void getAll(SmallVectorImpl<std::pair<unsigned int, MDNode *>> & Result) const
- public void insert(unsigned int ID, llvm::MDNode & MD)
- public llvm::MDNode * lookup(unsigned int ID) const
- public template <class PredTy>void remove_if(PredTy shouldRemove)
- public void set(unsigned int ID, llvm::MDNode * MD)
- public size_t size() const
Methods
¶bool empty() const
bool empty() const
Declared at: llvm/lib/IR/LLVMContextImpl.h:1315
¶bool erase(unsigned int ID)
bool erase(unsigned int ID)
Description
Remove attachments with the given ID. Remove the attachments at \c ID, if any.
Declared at: llvm/lib/IR/LLVMContextImpl.h:1344
Parameters
- unsigned int ID
¶void get(
unsigned int ID,
SmallVectorImpl<llvm::MDNode*>& Result) const
void get(
unsigned int ID,
SmallVectorImpl<llvm::MDNode*>& Result) const
Description
Appends all attachments with the given ID to \c Result in insertion order. If the global has no attachments with the given ID, or if ID is invalid, leaves Result unchanged.
Declared at: llvm/lib/IR/LLVMContextImpl.h:1325
Parameters
- unsigned int ID
- SmallVectorImpl<llvm::MDNode*>& Result
¶void getAll(SmallVectorImpl<
std::pair<unsigned int, MDNode*>>&
Result) const
void getAll(SmallVectorImpl<
std::pair<unsigned int, MDNode*>>&
Result) const
Description
Appends all attachments for the global to \c Result, sorting by attachment ID. Attachments with the same ID appear in insertion order. This function does \em not clear \c Result.
Declared at: llvm/lib/IR/LLVMContextImpl.h:1330
Parameters
- SmallVectorImpl<std::pair<unsigned int, MDNode*>>& Result
¶void insert(unsigned int ID, llvm::MDNode& MD)
void insert(unsigned int ID, llvm::MDNode& MD)
Description
Adds an attachment to a particular node.
Declared at: llvm/lib/IR/LLVMContextImpl.h:1339
Parameters
- unsigned int ID
- llvm::MDNode& MD
¶llvm::MDNode* lookup(unsigned int ID) const
llvm::MDNode* lookup(unsigned int ID) const
Description
Returns the first attachment with the given ID or nullptr if no such attachment exists.
Declared at: llvm/lib/IR/LLVMContextImpl.h:1320
Parameters
- unsigned int ID
¶template <class PredTy>
void remove_if(PredTy shouldRemove)
template <class PredTy>
void remove_if(PredTy shouldRemove)
Description
Erase matching attachments. Erases all attachments matching the \c shouldRemove predicate.
Declared at: llvm/lib/IR/LLVMContextImpl.h:1349
Templates
- PredTy
Parameters
- PredTy shouldRemove
¶void set(unsigned int ID, llvm::MDNode* MD)
void set(unsigned int ID, llvm::MDNode* MD)
Description
Set an attachment to a particular node. Set the \c ID attachment to \c MD, replacing the current attachments at \c ID (if anyway).
Declared at: llvm/lib/IR/LLVMContextImpl.h:1336
Parameters
- unsigned int ID
- llvm::MDNode* MD
¶size_t size() const
size_t size() const
Declared at: llvm/lib/IR/LLVMContextImpl.h:1316