From 5c8b2dff4d56b2a05ec5d424b5025cd5f9cf4657 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Sun, 27 Jan 2013 21:32:11 +0000 Subject: [PATCH] Add some helpful comments. llvm-svn: 173631 --- llvm/lib/IR/AttributeImpl.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/llvm/lib/IR/AttributeImpl.h b/llvm/lib/IR/AttributeImpl.h index 2aba3c4..c565364 100644 --- a/llvm/lib/IR/AttributeImpl.h +++ b/llvm/lib/IR/AttributeImpl.h @@ -117,14 +117,23 @@ class AttributeSetImpl : public FoldingSetNode { public: AttributeSetImpl(LLVMContext &C, ArrayRef attrs); + /// \brief Get the context that created this AttributeSetImpl. LLVMContext &getContext() { return Context; } + ArrayRef getAttributes() const { return AttrList; } - unsigned getNumAttributes() const { - return AttrNodes.size(); - } - unsigned getSlotIndex(unsigned Slot) const { - return AttrNodes[Slot].first; - } + + /// \brief Return the number of attributes this AttributeSet contains. + unsigned getNumAttributes() const { return AttrNodes.size(); } + + /// \brief Get the index of the given "slot" in the AttrNodes list. This index + /// is the index of the return, parameter, or function object that the + /// attributes are applied to, not the index into the AttrNodes list where the + /// attributes reside. + unsigned getSlotIndex(unsigned Slot) const { return AttrNodes[Slot].first; } + + /// \brief Retrieve the attributes for the given "slot" in the AttrNode list. + /// \p Slot is an index into the AttrNodes list, not the index of the return / + /// parameter/ function which the attributes apply to. AttributeSet getSlotAttributes(unsigned Slot) const { // FIXME: This needs to use AttrNodes instead. return AttributeSet::get(Context, AttrList[Slot]); -- 2.7.4