aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Function.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-10-10 06:13:42 +0000
committerBill Wendling <isanbard@gmail.com>2012-10-10 06:13:42 +0000
commit11d00420e42ba88c3b48cab997965a7be79315e2 (patch)
tree355c521bd3bafcb4e69ea7f47f61472782a831dd /include/llvm/Function.h
parent82d46aec62f127856f4bfeb30f80aa12dd74bae0 (diff)
downloadexternal_llvm-11d00420e42ba88c3b48cab997965a7be79315e2.zip
external_llvm-11d00420e42ba88c3b48cab997965a7be79315e2.tar.gz
external_llvm-11d00420e42ba88c3b48cab997965a7be79315e2.tar.bz2
Pass into the AttributeWithIndex::get method an ArrayRef of attribute
enums. These are then created via the correct Attributes creation method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Function.h')
-rw-r--r--include/llvm/Function.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h
index 2781959..855c926 100644
--- a/include/llvm/Function.h
+++ b/include/llvm/Function.h
@@ -277,9 +277,10 @@ public:
bool doesNotAlias(unsigned n) const {
return getParamAttributes(n).hasAttribute(Attributes::NoAlias);
}
- void setDoesNotAlias(unsigned n, bool DoesNotAlias = true) {
- if (DoesNotAlias) addAttribute(n, Attribute::NoAlias);
- else removeAttribute(n, Attribute::NoAlias);
+ void setDoesNotAlias(unsigned n) {
+ Attributes::Builder B;
+ B.addAttribute(Attributes::NoAlias);
+ addAttribute(n, Attributes::get(B));
}
/// @brief Determine if the parameter can be captured.
@@ -287,9 +288,10 @@ public:
bool doesNotCapture(unsigned n) const {
return getParamAttributes(n).hasAttribute(Attributes::NoCapture);
}
- void setDoesNotCapture(unsigned n, bool DoesNotCapture = true) {
- if (DoesNotCapture) addAttribute(n, Attribute::NoCapture);
- else removeAttribute(n, Attribute::NoCapture);
+ void setDoesNotCapture(unsigned n) {
+ Attributes::Builder B;
+ B.addAttribute(Attributes::NoCapture);
+ addAttribute(n, Attributes::get(B));
}
/// copyAttributesFrom - copy all additional attributes (those not needed to