summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-04-13 23:12:13 +0000
committerReid Kleckner <rnk@google.com>2017-04-13 23:12:13 +0000
commitf021fab2afdc3d9534dbddcccecf892986b9654b (patch)
treecd67c5baeda9bf396894c99f325324a735cbf066 /llvm/lib/IR/Attributes.cpp
parent9a016602e9246c5e76e7b8443ba968f35e7b0b88 (diff)
downloadbcm5719-llvm-f021fab2afdc3d9534dbddcccecf892986b9654b.tar.gz
bcm5719-llvm-f021fab2afdc3d9534dbddcccecf892986b9654b.zip
[IR] Make getParamAttributes take argument numbers, not ArgNo+1
Add hasParamAttribute() and use it instead of hasAttribute(ArgNo+1, Kind) everywhere. The fact that the AttributeList index for an argument is ArgNo+1 should be a hidden implementation detail. NFC llvm-svn: 300272
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 2e3d7bdf709..2b7359dab80 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -1170,8 +1170,8 @@ AttributeList::addAllocSizeAttr(LLVMContext &C, unsigned Index,
LLVMContext &AttributeList::getContext() const { return pImpl->getContext(); }
-AttributeSet AttributeList::getParamAttributes(unsigned Index) const {
- return getAttributes(Index);
+AttributeSet AttributeList::getParamAttributes(unsigned ArgNo) const {
+ return getAttributes(ArgNo + 1);
}
AttributeSet AttributeList::getRetAttributes() const {
@@ -1203,6 +1203,11 @@ bool AttributeList::hasFnAttribute(StringRef Kind) const {
return hasAttribute(AttributeList::FunctionIndex, Kind);
}
+bool AttributeList::hasParamAttribute(unsigned ArgNo,
+ Attribute::AttrKind Kind) const {
+ return hasAttribute(ArgNo + 1, Kind);
+}
+
bool AttributeList::hasAttrSomewhere(Attribute::AttrKind Attr,
unsigned *Index) const {
if (!pImpl) return false;
OpenPOWER on IntegriCloud