BCUI + 1 doesn't work. Use next instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58830 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2008-11-07 01:59:41 +00:00
parent cab3e68136
commit 068a795b33

View File

@ -30,6 +30,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/Compiler.h"
#include <algorithm>
@ -298,7 +299,7 @@ namespace {
// Remove dbg intrinsic uses now.
Value::use_iterator BCUI = BC->use_begin();
DbgInfoIntrinsic *DI = cast<DbgInfoIntrinsic>(*BCUI);
assert (BCUI + 1 == BC->use_end() && "Unexpected alloca uses!");
assert (next(BCUI) == BC->use_end() && "Unexpected alloca uses!");
DI->eraseFromParent();
BC->eraseFromParent();
} else if (StoreInst *SI = dyn_cast<StoreInst>(User)) {