From b9293c51bdd34ed58eca757bf170c6ec0559cbdf Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Mon, 14 Jan 2008 02:38:45 +0000 Subject: [PATCH] Simplify code. llvm-svn: 45950 --- llvm/lib/VMCore/Instructions.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp index a9cc275b548c..b569f01d78c0 100644 --- a/llvm/lib/VMCore/Instructions.cpp +++ b/llvm/lib/VMCore/Instructions.cpp @@ -406,10 +406,7 @@ bool CallInst::isStructReturn() const { /// @brief Determine if any call argument is an aggregate passed by value. bool CallInst::hasByValArgument() const { - const Value *Callee = getCalledValue(); - const PointerType *CalleeTy = cast(Callee->getType()); - const FunctionType *FTy = cast(CalleeTy->getElementType()); - for (unsigned i = 1, e = FTy->getNumParams()+1; i != e; ++i) + for (unsigned i = 1, e = getNumOperands(); i != e; ++i) if (paramHasAttr(i, ParamAttr::ByVal)) return true; return false;