diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-08-03 01:11:40 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-08-03 01:11:40 +0000 |
commit | dbd22550911ef20d09403d294090b480c03eeeca (patch) | |
tree | 4387374d7e4f5c3a8c2e6c89beb988d4c916ebe9 /lib | |
parent | d0c0d444592a0fea209ea99ebcd1be274eee6692 (diff) | |
download | external_llvm-dbd22550911ef20d09403d294090b480c03eeeca.zip external_llvm-dbd22550911ef20d09403d294090b480c03eeeca.tar.gz external_llvm-dbd22550911ef20d09403d294090b480c03eeeca.tar.bz2 |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/InstCombine/InstructionCombining.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index 9c93903..5bc7b0b 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -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) { if (Depth == 8) return false; @@ -1069,8 +1069,7 @@ static bool IsOnlyNullComparedAndFreed(Value *V, SmallVector<WeakVH, 64> &Users, } } if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) { - if (GEPI->hasAllZeroIndices() && - IsOnlyNullComparedAndFreed(GEPI, Users, Depth+1)) { + if (IsOnlyNullComparedAndFreed(GEPI, Users, Depth+1)) { Users.push_back(GEPI); continue; } |