Update LLDB for LLVM iterator change in r203364

What was use_iterator is now user_iterator.  Also switch to range-based
APIs, as in Clang r203365.

llvm-svn: 203463
This commit is contained in:
Ed Maste 2014-03-10 14:23:10 +00:00
parent 728051e7df
commit 80e8cc6dee
1 changed files with 5 additions and 13 deletions

View File

@ -2091,19 +2091,15 @@ IRForTarget::TurnGuardLoadIntoZero(llvm::Instruction* guard_load)
{
Constant* zero(ConstantInt::get(Type::getInt8Ty(m_module->getContext()), 0, true));
Value::use_iterator ui;
for (ui = guard_load->use_begin();
ui != guard_load->use_end();
++ui)
for (llvm::User *u : guard_load->users())
{
if (isa<Constant>(*ui))
if (isa<Constant>(u))
{
// do nothing for the moment
}
else
{
ui->replaceUsesOfWith(guard_load, zero);
u->replaceUsesOfWith(guard_load, zero);
}
}
@ -2168,16 +2164,12 @@ IRForTarget::UnfoldConstant(Constant *old_constant,
{
lldb_private::Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
Value::use_iterator ui;
SmallVector<User*, 16> users;
// We do this because the use list might change, invalidating our iterator.
// Much better to keep a work list ourselves.
for (ui = old_constant->use_begin();
ui != old_constant->use_end();
++ui)
users.push_back(*ui);
for (llvm::User *u : old_constant->users())
users.push_back(u);
for (size_t i = 0;
i < users.size();