summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-04-28 18:37:16 +0000
committerReid Kleckner <rnk@google.com>2017-04-28 18:37:16 +0000
commit6652a52e2b208ad593ff562667142affaec4a7df (patch)
treeebe7acaa879d7da22a73b4c7d6b4150c5349686d /llvm/lib/Transforms/IPO/FunctionAttrs.cpp
parent06d6096edc78c6a7aa6ddad2fe81c74d5661e631 (diff)
downloadbcm5719-llvm-6652a52e2b208ad593ff562667142affaec4a7df.tar.gz
bcm5719-llvm-6652a52e2b208ad593ff562667142affaec4a7df.zip
Use Argument::hasAttribute and AttributeList::ReturnIndex more
This eliminates many extra 'Idx' induction variables in loops over arguments in CodeGen/ and Target/. It also reduces the number of places where we assume that ReturnIndex is 0 and that we should add one to argument numbers to get the corresponding attribute list index. NFC llvm-svn: 301666
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionAttrs.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/FunctionAttrs.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
index 9648883b7f2..031c3d8a9eb 100644
--- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
@@ -855,10 +855,11 @@ static bool addNoAliasAttrs(const SCCNodeSet &SCCNodes) {
bool MadeChange = false;
for (Function *F : SCCNodes) {
- if (F->doesNotAlias(0) || !F->getReturnType()->isPointerTy())
+ if (F->doesNotAlias(AttributeList::ReturnIndex) ||
+ !F->getReturnType()->isPointerTy())
continue;
- F->setDoesNotAlias(0);
+ F->setDoesNotAlias(AttributeList::ReturnIndex);
++NumNoAlias;
MadeChange = true;
}
OpenPOWER on IntegriCloud