diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-27 21:32:11 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-27 21:32:11 +0000 |
commit | 893eac1648151ca42e3d0f9e9da092d817c9f8ba (patch) | |
tree | 78df0f3a2e1b34861d292d57991de64fcd5aea48 /lib/IR | |
parent | b719d8b1007f6b31ae6d1a66258a26e6a91749bc (diff) | |
download | external_llvm-893eac1648151ca42e3d0f9e9da092d817c9f8ba.zip external_llvm-893eac1648151ca42e3d0f9e9da092d817c9f8ba.tar.gz external_llvm-893eac1648151ca42e3d0f9e9da092d817c9f8ba.tar.bz2 |
Add some helpful comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173631 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR')
-rw-r--r-- | lib/IR/AttributeImpl.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/IR/AttributeImpl.h b/lib/IR/AttributeImpl.h index 2aba3c4..c565364 100644 --- a/lib/IR/AttributeImpl.h +++ b/lib/IR/AttributeImpl.h @@ -117,14 +117,23 @@ class AttributeSetImpl : public FoldingSetNode { public: AttributeSetImpl(LLVMContext &C, ArrayRef<AttributeWithIndex> attrs); + /// \brief Get the context that created this AttributeSetImpl. LLVMContext &getContext() { return Context; } + ArrayRef<AttributeWithIndex> 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]); |