diff options
| author | Gabor Greif <ggreif@gmail.com> | 2010-07-09 12:23:50 +0000 |
|---|---|---|
| committer | Gabor Greif <ggreif@gmail.com> | 2010-07-09 12:23:50 +0000 |
| commit | 00563b82722f39e1ecf7918ac58e3c97a909165c (patch) | |
| tree | a9345ca85d59843afff10a3097c29babbed9c2c8 | |
| parent | 5db22e138301311751e98c14bc3656a7e57ecd00 (diff) | |
| download | external_llvm-00563b82722f39e1ecf7918ac58e3c97a909165c.zip external_llvm-00563b82722f39e1ecf7918ac58e3c97a909165c.tar.gz external_llvm-00563b82722f39e1ecf7918ac58e3c97a909165c.tar.bz2 | |
do not repeatedly dereference use_iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107962 91177308-0d34-0410-b5e6-96231b3b80d8
| -rw-r--r-- | lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index c533d6e..946c3ee 100644 --- a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -365,10 +365,11 @@ DbgDeclareInst *InstCombiner::hasOneUsePlusDeclare(Value *V) { return 0; for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ++UI) { - if (DbgDeclareInst *DI = dyn_cast<DbgDeclareInst>(UI)) + User *U = *UI; + if (DbgDeclareInst *DI = dyn_cast<DbgDeclareInst>(U)) return DI; - if (isa<BitCastInst>(UI) && UI->hasOneUse()) { - if (DbgDeclareInst *DI = dyn_cast<DbgDeclareInst>(UI->use_begin())) + if (isa<BitCastInst>(U) && U->hasOneUse()) { + if (DbgDeclareInst *DI = dyn_cast<DbgDeclareInst>(U->use_begin())) return DI; } } |
