diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp index 6de244648a2e..433309e3278d 100644 --- a/lldb/source/Expression/IRForTarget.cpp +++ b/lldb/source/Expression/IRForTarget.cpp @@ -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(*ui)) + if (isa(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 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();