From: Jakub Staszak Date: Thu, 7 Mar 2013 20:22:39 +0000 (+0000) Subject: Simplify code. No functionality change. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b1b6c170819120e535ef706f58041bb6caebe35d;p=oota-llvm.git Simplify code. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176646 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/MemoryBuiltins.cpp b/lib/Analysis/MemoryBuiltins.cpp index 26a013fab66..a1eea1c8509 100644 --- a/lib/Analysis/MemoryBuiltins.cpp +++ b/lib/Analysis/MemoryBuiltins.cpp @@ -225,9 +225,9 @@ const CallInst *llvm::isArrayMalloc(const Value *I, const CallInst *CI = extractMallocCall(I, TLI); Value *ArraySize = computeArraySize(CI, TD, TLI); - if (ArraySize && - ArraySize != ConstantInt::get(CI->getArgOperand(0)->getType(), 1)) - return CI; + if (ConstantInt *ConstSize = dyn_cast_or_null(ArraySize)) + if (ConstSize->isOne()) + return CI; // CI is a non-array malloc or we can't figure out that it is an array malloc. return 0;