llvm.org GIT mirror llvm / 893eac1
Add some helpful comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173631 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 7 years ago
1 changed file(s) with 15 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
116116 public:
117117 AttributeSetImpl(LLVMContext &C, ArrayRef attrs);
118118
119 /// \brief Get the context that created this AttributeSetImpl.
119120 LLVMContext &getContext() { return Context; }
121
120122 ArrayRef getAttributes() const { return AttrList; }
121 unsigned getNumAttributes() const {
122 return AttrNodes.size();
123 }
124 unsigned getSlotIndex(unsigned Slot) const {
125 return AttrNodes[Slot].first;
126 }
123
124 /// \brief Return the number of attributes this AttributeSet contains.
125 unsigned getNumAttributes() const { return AttrNodes.size(); }
126
127 /// \brief Get the index of the given "slot" in the AttrNodes list. This index
128 /// is the index of the return, parameter, or function object that the
129 /// attributes are applied to, not the index into the AttrNodes list where the
130 /// attributes reside.
131 unsigned getSlotIndex(unsigned Slot) const { return AttrNodes[Slot].first; }
132
133 /// \brief Retrieve the attributes for the given "slot" in the AttrNode list.
134 /// \p Slot is an index into the AttrNodes list, not the index of the return /
135 /// parameter/ function which the attributes apply to.
127136 AttributeSet getSlotAttributes(unsigned Slot) const {
128137 // FIXME: This needs to use AttrNodes instead.
129138 return AttributeSet::get(Context, AttrList[Slot]);