Remove Function::getParamAttributes and use the AttributeSet accessor methods instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171255 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2012-12-30 12:45:13 +00:00
parent 831737d329
commit 39cd0c8e47
6 changed files with 31 additions and 34 deletions
+6 -9
View File
@@ -189,17 +189,11 @@ public:
void setGC(const char *Str);
void clearGC();
/// getRetAttributes - Return the return attributes for querying.
Attribute getRetAttributes() const {
return AttributeList.getRetAttributes();
}
/// getParamAttributes - Return the parameter attributes for querying.
Attribute getParamAttributes(unsigned Idx) const {
return AttributeList.getParamAttributes(Idx);
}
/// addAttribute - adds the attribute to the list of attributes.
void addAttribute(unsigned i, Attribute attr);
@@ -275,13 +269,15 @@ public:
/// @brief Determine if the function returns a structure through first
/// pointer argument.
bool hasStructRetAttr() const {
return getParamAttributes(1).hasAttribute(Attribute::StructRet);
return AttributeList.getParamAttributes(1).
hasAttribute(Attribute::StructRet);
}
/// @brief Determine if the parameter does not alias other parameters.
/// @param n The parameter to check. 1 is the first parameter, 0 is the return
bool doesNotAlias(unsigned n) const {
return getParamAttributes(n).hasAttribute(Attribute::NoAlias);
return AttributeList.getParamAttributes(n).
hasAttribute(Attribute::NoAlias);
}
void setDoesNotAlias(unsigned n) {
addAttribute(n, Attribute::get(getContext(), Attribute::NoAlias));
@@ -290,7 +286,8 @@ public:
/// @brief Determine if the parameter can be captured.
/// @param n The parameter to check. 1 is the first parameter, 0 is the return
bool doesNotCapture(unsigned n) const {
return getParamAttributes(n).hasAttribute(Attribute::NoCapture);
return AttributeList.getParamAttributes(n).
hasAttribute(Attribute::NoCapture);
}
void setDoesNotCapture(unsigned n) {
addAttribute(n, Attribute::get(getContext(), Attribute::NoCapture));