[Lldb-commits] [lldb] r203463 - Update LLDB for LLVM iterator change in r203364

Ed Maste emaste at freebsd.org
Mon Mar 10 07:23:11 PDT 2014


Author: emaste
Date: Mon Mar 10 09:23:10 2014
New Revision: 203463

URL: http://llvm.org/viewvc/llvm-project?rev=203463&view=rev
Log:
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.

Modified:
    lldb/trunk/source/Expression/IRForTarget.cpp

Modified: lldb/trunk/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRForTarget.cpp?rev=203463&r1=203462&r2=203463&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRForTarget.cpp (original)
+++ lldb/trunk/source/Expression/IRForTarget.cpp Mon Mar 10 09:23:10 2014
@@ -2091,19 +2091,15 @@ IRForTarget::TurnGuardLoadIntoZero(llvm:
 {
     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 *ol
 {
     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();





More information about the lldb-commits mailing list