From 6df01501b102dca2ceceabedbb644ba51e09cc5a Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Wed, 4 Jun 2008 16:31:12 +0000 Subject: 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 --- lib/VMCore/Instructions.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/VMCore/Instructions.cpp') diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index 3fb1c61..d789267 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -91,6 +91,13 @@ void CallSite::setDoesNotThrow(bool doesNotThrow) { cast(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 //===----------------------------------------------------------------------===// -- cgit v1.1