aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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
commit9515a8f88a597e78c32c797e4946ebf7648512c0 (patch)
tree105564af6cfe5909b3013049cc379daf32342c59 /lib
parent338169ddc9bb4061f248d0afbf0ec87b6bf2227d (diff)
downloadexternal_llvm-9515a8f88a597e78c32c797e4946ebf7648512c0.tar.gz
external_llvm-9515a8f88a597e78c32c797e4946ebf7648512c0.tar.bz2
external_llvm-9515a8f88a597e78c32c797e4946ebf7648512c0.zip
Add CallSite::hasArgument to allow for seeing if a call passes a certain value as an argument quickly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Instructions.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 3fb1c61b72..d78926742c 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/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
//===----------------------------------------------------------------------===//