diff options
author | Reid Kleckner <rnk@google.com> | 2017-04-28 18:37:16 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2017-04-28 18:37:16 +0000 |
commit | 6652a52e2b208ad593ff562667142affaec4a7df (patch) | |
tree | ebe7acaa879d7da22a73b4c7d6b4150c5349686d /llvm/lib/IR/Instructions.cpp | |
parent | 06d6096edc78c6a7aa6ddad2fe81c74d5661e631 (diff) | |
download | bcm5719-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/IR/Instructions.cpp')
-rw-r--r-- | llvm/lib/IR/Instructions.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index 76582e334d1..59500992abb 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -501,7 +501,8 @@ static Instruction *createMalloc(Instruction *InsertBefore, MCall->setTailCall(); if (Function *F = dyn_cast<Function>(MallocFunc)) { MCall->setCallingConv(F->getCallingConv()); - if (!F->doesNotAlias(0)) F->setDoesNotAlias(0); + if (!F->doesNotAlias(AttributeList::ReturnIndex)) + F->setDoesNotAlias(AttributeList::ReturnIndex); } assert(!MCall->getType()->isVoidTy() && "Malloc has void return type"); |