summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instructions.cpp
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2008-06-04 16:31:12 +0000
committerMatthijs Kooijman <matthijs@stdin.nl>2008-06-04 16:31:12 +0000
commitd901e5842fd4a09a841c417881ed0dd62efadc84 (patch)
tree6f3c782e02beb7b6fb7a62ae893cd7c2d19bcd70 /llvm/lib/VMCore/Instructions.cpp
parent76d8dec5db06f05ef06ed129ac0b4d216baa3700 (diff)
downloadbcm5719-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.cpp7
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
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud