mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Small cleanups:
- use SmallVectorImpl& for the function argument. - ignore the operands on the GEP, even if they aren't constant! Much as we pretend the malloc succeeds, we pretend that malloc + whatever-you-GEP'd-by is not null. It's magic! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136757 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1044,7 +1044,7 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static bool IsOnlyNullComparedAndFreed(Value *V, SmallVector<WeakVH, 64> &Users,
|
static bool IsOnlyNullComparedAndFreed(Value *V, SmallVectorImpl<WeakVH> &Users,
|
||||||
int Depth = 0) {
|
int Depth = 0) {
|
||||||
if (Depth == 8)
|
if (Depth == 8)
|
||||||
return false;
|
return false;
|
||||||
@ -1069,8 +1069,7 @@ static bool IsOnlyNullComparedAndFreed(Value *V, SmallVector<WeakVH, 64> &Users,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) {
|
if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) {
|
||||||
if (GEPI->hasAllZeroIndices() &&
|
if (IsOnlyNullComparedAndFreed(GEPI, Users, Depth+1)) {
|
||||||
IsOnlyNullComparedAndFreed(GEPI, Users, Depth+1)) {
|
|
||||||
Users.push_back(GEPI);
|
Users.push_back(GEPI);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user