summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-c-test
diff options
context:
space:
mode:
authorAmaury Sechet <deadalnix@gmail.com>2016-02-10 00:09:37 +0000
committerAmaury Sechet <deadalnix@gmail.com>2016-02-10 00:09:37 +0000
commit5c7b3af5a129b2c475f13b677fcb5783f9ed9204 (patch)
tree7d559c40f1844ef67da33c80d29b6c6ca0ead678 /llvm/tools/llvm-c-test
parente286b8d652e453424e0edfac5164d065b3129a7a (diff)
downloadbcm5719-llvm-5c7b3af5a129b2c475f13b677fcb5783f9ed9204.tar.gz
bcm5719-llvm-5c7b3af5a129b2c475f13b677fcb5783f9ed9204.zip
Add binding for counting argument and find called value of call and invoke instruction from the C API.
Summary: As per title. This remove the need to rely on internal knowledge of call and invoke instruction to find called value and argument count. Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker Differential Revision: http://reviews.llvm.org/D17054 llvm-svn: 260332
Diffstat (limited to 'llvm/tools/llvm-c-test')
-rw-r--r--llvm/tools/llvm-c-test/echo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/llvm-c-test/echo.cpp b/llvm/tools/llvm-c-test/echo.cpp
index 4e4841b8ed8..cbacec09bbc 100644
--- a/llvm/tools/llvm-c-test/echo.cpp
+++ b/llvm/tools/llvm-c-test/echo.cpp
@@ -336,10 +336,10 @@ struct FunCloner {
}
case LLVMCall: {
SmallVector<LLVMValueRef, 8> Args;
- int ArgCount = LLVMGetNumOperands(Src) - 1;
+ int ArgCount = LLVMGetNumArgOperands(Src);
for (int i = 0; i < ArgCount; i++)
Args.push_back(CloneValue(LLVMGetOperand(Src, i)));
- LLVMValueRef Fn = CloneValue(LLVMGetOperand(Src, ArgCount));
+ LLVMValueRef Fn = CloneValue(LLVMGetCalledValue(Src));
Dst = LLVMBuildCall(Builder, Fn, Args.data(), ArgCount, Name);
break;
}
OpenPOWER on IntegriCloud