mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-26 09:18:56 +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:
@@ -225,9 +225,9 @@ const CallInst *llvm::isArrayMalloc(const Value *I,
|
|||||||
const CallInst *CI = extractMallocCall(I, TLI);
|
const CallInst *CI = extractMallocCall(I, TLI);
|
||||||
Value *ArraySize = computeArraySize(CI, TD, TLI);
|
Value *ArraySize = computeArraySize(CI, TD, TLI);
|
||||||
|
|
||||||
if (ArraySize &&
|
if (ConstantInt *ConstSize = dyn_cast_or_null<ConstantInt>(ArraySize))
|
||||||
ArraySize != ConstantInt::get(CI->getArgOperand(0)->getType(), 1))
|
if (ConstSize->isOne())
|
||||||
return CI;
|
return CI;
|
||||||
|
|
||||||
// CI is a non-array malloc or we can't figure out that it is an array malloc.
|
// CI is a non-array malloc or we can't figure out that it is an array malloc.
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user