[llvm-commits] [llvm] r173109 - in /llvm/trunk: include/llvm/IR/Attributes.h lib/IR/Attributes.cpp
Bill Wendling
isanbard at gmail.com
Mon Jan 21 16:53:13 PST 2013
Author: void
Date: Mon Jan 21 18:53:12 2013
New Revision: 173109
URL: http://llvm.org/viewvc/llvm-project?rev=173109&view=rev
Log:
Add a new method that adds the AttributeSet at the given index. No functional change.
Modified:
llvm/trunk/include/llvm/IR/Attributes.h
llvm/trunk/lib/IR/Attributes.cpp
Modified: llvm/trunk/include/llvm/IR/Attributes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Attributes.h?rev=173109&r1=173108&r2=173109&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Attributes.h (original)
+++ llvm/trunk/include/llvm/IR/Attributes.h Mon Jan 21 18:53:12 2013
@@ -231,13 +231,22 @@
/// list.
AttributeSet addAttr(LLVMContext &C, unsigned Idx, Attribute Attrs) const;
+ /// \brief Add attributes to the attribute set at the given index. Since
+ /// attribute sets are immutable, this returns a new set.
+ AttributeSet addAttributes(LLVMContext &C, unsigned Idx,
+ AttributeSet Attrs) const;
+
/// \brief Add return attributes to this attribute set. Since attribute sets
/// are immutable, this returns a new set.
- AttributeSet addRetAttributes(LLVMContext &C, AttributeSet Attrs) const;
+ AttributeSet addRetAttributes(LLVMContext &C, AttributeSet Attrs) const {
+ return addAttributes(C, ReturnIndex, Attrs);
+ }
/// \brief Add function attributes to this attribute set. Since attribute sets
/// are immutable, this returns a new set.
- AttributeSet addFnAttributes(LLVMContext &C, AttributeSet Attrs) const;
+ AttributeSet addFnAttributes(LLVMContext &C, AttributeSet Attrs) const {
+ return addAttributes(C, FunctionIndex, Attrs);
+ }
/// \brief Remove the specified attribute at the specified index from this
/// attribute list. Since attribute lists are immutable, this returns the new
Modified: llvm/trunk/lib/IR/Attributes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Attributes.cpp?rev=173109&r1=173108&r2=173109&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Attributes.cpp (original)
+++ llvm/trunk/lib/IR/Attributes.cpp Mon Jan 21 18:53:12 2013
@@ -691,14 +691,9 @@
return false;
}
-AttributeSet AttributeSet::addRetAttributes(LLVMContext &C,
- AttributeSet Attrs) const {
- return addAttr(C, ReturnIndex, Attrs.getAttributes(ReturnIndex));
-}
-
-AttributeSet AttributeSet::addFnAttributes(LLVMContext &C,
- AttributeSet Attrs) const {
- return addAttr(C, FunctionIndex, Attrs.getAttributes(FunctionIndex));
+AttributeSet AttributeSet::addAttributes(LLVMContext &C, unsigned Idx,
+ AttributeSet Attrs) const {
+ return addAttr(C, Idx, Attrs.getAttributes(Idx));
}
AttributeSet AttributeSet::addAttr(LLVMContext &C, unsigned Idx,
More information about the llvm-commits
mailing list