diff options
| author | Amaury Sechet <deadalnix@gmail.com> | 2016-02-10 00:09:37 +0000 |
|---|---|---|
| committer | Amaury Sechet <deadalnix@gmail.com> | 2016-02-10 00:09:37 +0000 |
| commit | 5c7b3af5a129b2c475f13b677fcb5783f9ed9204 (patch) | |
| tree | 7d559c40f1844ef67da33c80d29b6c6ca0ead678 /llvm/include/llvm-c | |
| parent | e286b8d652e453424e0edfac5164d065b3129a7a (diff) | |
| download | bcm5719-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/include/llvm-c')
| -rw-r--r-- | llvm/include/llvm-c/Core.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h index 27eb7aef3fc..019bc7a8044 100644 --- a/llvm/include/llvm-c/Core.h +++ b/llvm/include/llvm-c/Core.h @@ -2386,6 +2386,17 @@ LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst); */ /** + * Obtain the argument count for a call instruction. + * + * This expects an LLVMValueRef that corresponds to a llvm::CallInst or + * llvm::InvokeInst. + * + * @see llvm::CallInst::getNumArgOperands() + * @see llvm::InvokeInst::getNumArgOperands() + */ +unsigned LLVMGetNumArgOperands(LLVMValueRef Instr); + +/** * Set the calling convention for a call instruction. * * This expects an LLVMValueRef that corresponds to a llvm::CallInst or @@ -2414,6 +2425,17 @@ void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index, unsigned align); /** + * Obtain the pointer to the function invoked by this instruction. + * + * This expects an LLVMValueRef that corresponds to a llvm::CallInst or + * llvm::InvokeInst. + * + * @see llvm::CallInst::getCalledValue() + * @see llvm::InvokeInst::getCalledValue() + */ +LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr); + +/** * Obtain whether a call instruction is a tail call. * * This only works on llvm::CallInst instructions. |

