Use Argument::hasAttribute and AttributeList::ReturnIndex more
authorReid Kleckner <rnk@google.com>
Fri, 28 Apr 2017 18:37:16 +0000 (18:37 +0000)
committerReid Kleckner <rnk@google.com>
Fri, 28 Apr 2017 18:37:16 +0000 (18:37 +0000)
commit6652a52e2b208ad593ff562667142affaec4a7df
treeebe7acaa879d7da22a73b4c7d6b4150c5349686d
parent06d6096edc78c6a7aa6ddad2fe81c74d5661e631
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
15 files changed:
llvm/include/llvm/IR/CallSite.h
llvm/include/llvm/IR/Function.h
llvm/lib/Analysis/CFLGraph.h
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/IR/AsmWriter.cpp
llvm/lib/IR/Attributes.cpp
llvm/lib/IR/Instructions.cpp
llvm/lib/IR/Value.cpp
llvm/lib/Target/AArch64/AArch64FastISel.cpp
llvm/lib/Target/ARM/ARMFastISel.cpp
llvm/lib/Target/Hexagon/HexagonBitTracker.cpp
llvm/lib/Target/Mips/MipsFastISel.cpp
llvm/lib/Target/X86/X86FastISel.cpp
llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
llvm/lib/Transforms/IPO/FunctionAttrs.cpp