[Lldb-commits] [lldb] r297640 - Fix up some enumerate() callsites in LLDB.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 13 10:12:12 PDT 2017


Author: zturner
Date: Mon Mar 13 12:12:12 2017
New Revision: 297640

URL: http://llvm.org/viewvc/llvm-project?rev=297640&view=rev
Log:
Fix up some enumerate() callsites in LLDB.

Modified:
    lldb/trunk/source/Commands/CommandObjectArgs.cpp
    lldb/trunk/source/Commands/CommandObjectType.cpp
    lldb/trunk/source/Interpreter/Args.cpp
    lldb/trunk/source/Interpreter/CommandInterpreter.cpp
    lldb/trunk/source/Interpreter/CommandObject.cpp

Modified: lldb/trunk/source/Commands/CommandObjectArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectArgs.cpp?rev=297640&r1=297639&r2=297640&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectArgs.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectArgs.cpp Mon Mar 13 12:12:12 2017
@@ -223,9 +223,9 @@ bool CommandObjectArgs::DoExecute(Args &
   result.GetOutputStream().Printf("Arguments : \n");
 
   for (auto entry : llvm::enumerate(args.entries())) {
-    result.GetOutputStream().Printf("%" PRIu64 " (%s): ", (uint64_t)entry.Index,
-                                    entry.Value.c_str());
-    value_list.GetValueAtIndex(entry.Index)->Dump(&result.GetOutputStream());
+    result.GetOutputStream().Printf(
+        "%" PRIu64 " (%s): ", (uint64_t)entry.index(), entry.value().c_str());
+    value_list.GetValueAtIndex(entry.index())->Dump(&result.GetOutputStream());
     result.GetOutputStream().Printf("\n");
   }
 

Modified: lldb/trunk/source/Commands/CommandObjectType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=297640&r1=297639&r2=297640&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectType.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectType.cpp Mon Mar 13 12:12:12 2017
@@ -82,9 +82,9 @@ static bool WarnOnPotentialUnquotedUnsig
     return false;
 
   for (auto entry : llvm::enumerate(command.entries().drop_back())) {
-    if (entry.Value.ref != "unsigned")
+    if (entry.value().ref != "unsigned")
       continue;
-    auto next = command.entries()[entry.Index + 1].ref;
+    auto next = command.entries()[entry.index() + 1].ref;
     if (next == "int" || next == "short" || next == "char" || next == "long") {
       result.AppendWarningWithFormat(
           "unsigned %s being treated as two types. if you meant the combined "

Modified: lldb/trunk/source/Interpreter/Args.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=297640&r1=297639&r2=297640&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/Args.cpp (original)
+++ lldb/trunk/source/Interpreter/Args.cpp Mon Mar 13 12:12:12 2017
@@ -931,12 +931,12 @@ bool Args::ContainsEnvironmentVariable(l
   // Check each arg to see if it matches the env var name.
   for (auto arg : llvm::enumerate(m_entries)) {
     llvm::StringRef name, value;
-    std::tie(name, value) = arg.Value.ref.split('=');
+    std::tie(name, value) = arg.value().ref.split('=');
     if (name != env_var_name)
       continue;
 
     if (argument_index)
-      *argument_index = arg.Index;
+      *argument_index = arg.index();
     return true;
   }
 
@@ -954,9 +954,9 @@ size_t Args::FindArgumentIndexForOption(
              long_options[long_options_index].definition->long_option);
 
   for (auto entry : llvm::enumerate(m_entries)) {
-    if (entry.Value.ref.startswith(short_buffer) ||
-        entry.Value.ref.startswith(long_buffer))
-      return entry.Index;
+    if (entry.value().ref.startswith(short_buffer) ||
+        entry.value().ref.startswith(long_buffer))
+      return entry.index();
   }
 
   return size_t(-1);

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=297640&r1=297639&r2=297640&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Mon Mar 13 12:12:12 2017
@@ -2018,8 +2018,8 @@ void CommandInterpreter::BuildAliasComma
     }
 
     for (auto entry : llvm::enumerate(cmd_args.entries())) {
-      if (!used[entry.Index] && !wants_raw_input)
-        new_args.AppendArgument(entry.Value.ref);
+      if (!used[entry.index()] && !wants_raw_input)
+        new_args.AppendArgument(entry.value().ref);
     }
 
     cmd_args.Clear();

Modified: lldb/trunk/source/Interpreter/CommandObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandObject.cpp?rev=297640&r1=297639&r2=297640&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandObject.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandObject.cpp Mon Mar 13 12:12:12 2017
@@ -977,10 +977,10 @@ bool CommandObjectParsed::Execute(const
   }
   if (!handled) {
     for (auto entry : llvm::enumerate(cmd_args.entries())) {
-      if (!entry.Value.ref.empty() && entry.Value.ref.front() == '`') {
+      if (!entry.value().ref.empty() && entry.value().ref.front() == '`') {
         cmd_args.ReplaceArgumentAtIndex(
-            entry.Index,
-            m_interpreter.ProcessEmbeddedScriptCommands(entry.Value.c_str()));
+            entry.index(),
+            m_interpreter.ProcessEmbeddedScriptCommands(entry.value().c_str()));
       }
     }
 




More information about the lldb-commits mailing list