[llvm-commits] [llvm] r45950 - /llvm/trunk/lib/VMCore/Instructions.cpp

Evan Cheng evan.cheng at apple.com
Sun Jan 13 18:38:47 PST 2008


Author: evancheng
Date: Sun Jan 13 20:38:45 2008
New Revision: 45950

URL: http://llvm.org/viewvc/llvm-project?rev=45950&view=rev
Log:
Simplify code.

Modified:
    llvm/trunk/lib/VMCore/Instructions.cpp

Modified: llvm/trunk/lib/VMCore/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=45950&r1=45949&r2=45950&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Instructions.cpp (original)
+++ llvm/trunk/lib/VMCore/Instructions.cpp Sun Jan 13 20:38:45 2008
@@ -406,10 +406,7 @@
 
 /// @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;





More information about the llvm-commits mailing list