aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/CloneFunction.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/Transforms/Utils/CloneFunction.cpp
parent9a016602e9246c5e76e7b8443ba968f35e7b0b88 (diff)
downloadllvm-f021fab2afdc3d9534dbddcccecf892986b9654b.zip
llvm-f021fab2afdc3d9534dbddcccecf892986b9654b.tar.gz
llvm-f021fab2afdc3d9534dbddcccecf892986b9654b.tar.bz2
[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/Transforms/Utils/CloneFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CloneFunction.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index 0577026..385c123 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -110,7 +110,7 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
for (const Argument &OldArg : OldFunc->args()) {
if (Argument *NewArg = dyn_cast<Argument>(VMap[&OldArg])) {
NewArgAttrs[NewArg->getArgNo()] =
- OldAttrs.getParamAttributes(OldArg.getArgNo() + 1);
+ OldAttrs.getParamAttributes(OldArg.getArgNo());
}
}