Simplify ComputeMultiple so that it doesn't depend on TargetData.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89175 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2009-11-18 00:58:27 +00:00
parent 5052c1547e
commit 3dbb9e64d6
3 changed files with 13 additions and 27 deletions

View File

@ -105,9 +105,8 @@ static Value *computeArraySize(const CallInst *CI, const TargetData *TD,
// return the multiple. Otherwise, return NULL.
Value *MallocArg = CI->getOperand(1);
Value *Multiple = NULL;
APInt Val(TD->getTypeSizeInBits(MallocArg->getType()->getScalarType()), 0);
if (ComputeMultiple(MallocArg, ElementSize, Multiple,
Val, LookThroughSExt, TD))
LookThroughSExt))
return Multiple;
return NULL;