diff options
| author | Bill Wendling <isanbard@gmail.com> | 2013-01-23 00:20:53 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2013-01-23 00:20:53 +0000 |
| commit | 70d2ca0725b05a2d372e4dc3336e8ea350093e98 (patch) | |
| tree | 2249ebb9f544a38c5ed721ded4957a66bb1b5917 /include | |
| parent | bdd4e1311830bea92c8b8c09f0644cba15421241 (diff) | |
Use the AttributeSet when adding multiple attributes and an Attribute::AttrKind
when adding a single attribute to the function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
| -rw-r--r-- | include/llvm/IR/Function.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/include/llvm/IR/Function.h b/include/llvm/IR/Function.h index 956d3ed2e2..46feb8ba28 100644 --- a/include/llvm/IR/Function.h +++ b/include/llvm/IR/Function.h @@ -171,7 +171,8 @@ public: /// addFnAttr - Add function attributes to this function. /// void addFnAttr(Attribute::AttrKind N) { - addAttribute(AttributeSet::FunctionIndex, Attribute::get(getContext(), N)); + setAttributes(AttributeList.addAttribute(getContext(), + AttributeSet::FunctionIndex, N)); } /// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm @@ -181,10 +182,13 @@ public: void setGC(const char *Str); void clearGC(); - /// addAttribute - adds the attribute to the list of attributes. - void addAttribute(unsigned i, Attribute attr); + /// @brief adds the attribute to the list of attributes. + void addAttribute(unsigned i, Attribute::AttrKind attr); - /// removeAttribute - removes the attribute from the list of attributes. + /// @brief adds the attributes to the list of attributes. + void addAttributes(unsigned i, AttributeSet attrs); + + /// @brief removes the attributes from the list of attributes. void removeAttribute(unsigned i, Attribute attr); /// @brief Extract the alignment for a call or parameter (0=unknown). @@ -265,7 +269,7 @@ public: return AttributeList.hasAttribute(n, Attribute::NoAlias); } void setDoesNotAlias(unsigned n) { - addAttribute(n, Attribute::get(getContext(), Attribute::NoAlias)); + addAttribute(n, Attribute::NoAlias); } /// @brief Determine if the parameter can be captured. @@ -274,7 +278,7 @@ public: return AttributeList.hasAttribute(n, Attribute::NoCapture); } void setDoesNotCapture(unsigned n) { - addAttribute(n, Attribute::get(getContext(), Attribute::NoCapture)); + addAttribute(n, Attribute::NoCapture); } /// copyAttributesFrom - copy all additional attributes (those not needed to |
