Simplify code.
authorEvan Cheng <evan.cheng@apple.com>
Mon, 14 Jan 2008 02:38:45 +0000 (02:38 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 14 Jan 2008 02:38:45 +0000 (02:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45950 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Instructions.cpp

index a9cc275b548c1d5335426b2f31287edb7743dd20..b569f01d78c02b09c49b00bc4db7c887f3e5d418 100644 (file)
@@ -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<PointerType>(Callee->getType());
-  const FunctionType *FTy = cast<FunctionType>(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;