diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2008-06-04 16:31:12 +0000 |
---|---|---|
committer | Matthijs Kooijman <matthijs@stdin.nl> | 2008-06-04 16:31:12 +0000 |
commit | d901e5842fd4a09a841c417881ed0dd62efadc84 (patch) | |
tree | 6f3c782e02beb7b6fb7a62ae893cd7c2d19bcd70 /llvm/lib/VMCore/Instructions.cpp | |
parent | 76d8dec5db06f05ef06ed129ac0b4d216baa3700 (diff) | |
download | bcm5719-llvm-d901e5842fd4a09a841c417881ed0dd62efadc84.tar.gz bcm5719-llvm-d901e5842fd4a09a841c417881ed0dd62efadc84.zip |
Add CallSite::hasArgument to allow for seeing if a call passes a certain value as an argument quickly.
llvm-svn: 51946
Diffstat (limited to 'llvm/lib/VMCore/Instructions.cpp')
-rw-r--r-- | llvm/lib/VMCore/Instructions.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp index 3fb1c61b722..d78926742cf 100644 --- a/llvm/lib/VMCore/Instructions.cpp +++ b/llvm/lib/VMCore/Instructions.cpp @@ -91,6 +91,13 @@ void CallSite::setDoesNotThrow(bool doesNotThrow) { cast<InvokeInst>(I)->setDoesNotThrow(doesNotThrow); } +bool CallSite::hasArgument(Value *Arg) { + for (arg_iterator AI = this->arg_begin(), E = this->arg_end(); AI != E; ++AI) + if (AI->get() == Arg) + return true; + return false; +} + //===----------------------------------------------------------------------===// // TerminatorInst Class //===----------------------------------------------------------------------===// |