mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-29 14:40:25 +00:00
Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176646 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4a521da51a
commit
b1b6c17081
@ -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<ConstantInt>(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;
|
||||
|
Loading…
Reference in New Issue
Block a user