Skip to content
Snippets Groups Projects
Commit 60a346d0 authored by Gabor Greif's avatar Gabor Greif
Browse files

do not repeatedly dereference use_iterator

llvm-svn: 107962
parent 48fb6abf
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment