[llvm-commits] [llvm] r173631 - Add some helpful comments.
Bill Wendling
isanbard at gmail.com
Sun Jan 27 13:32:11 PST 2013
Author: void
Date: Sun Jan 27 15:32:11 2013
New Revision: 173631
URL: http://llvm.org/viewvc/llvm-project?rev=173631&view=rev
Log:
Add some helpful comments.
Modified:
llvm/trunk/lib/IR/AttributeImpl.h
Modified: llvm/trunk/lib/IR/AttributeImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AttributeImpl.h?rev=173631&r1=173630&r2=173631&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AttributeImpl.h (original)
+++ llvm/trunk/lib/IR/AttributeImpl.h Sun Jan 27 15:32:11 2013
@@ -117,14 +117,23 @@ class AttributeSetImpl : public FoldingS
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]);
More information about the llvm-commits
mailing list