Commit 9dfd4e26 authored by Raphael Isemann's avatar Raphael Isemann
Browse files

[lldb][NFC] Remove ConstString -> const char * -> StringRef conversions when calling Stream::Indent

Let's just pass in a StringRef and save the strlen call when rebuilding the StringRef parameter.
parent 8d96aed5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ void OptionValueDictionary::DumpValue(const ExecutionContext *exe_ctx,
      else
        strm.EOL();

      strm.Indent(pos->first.GetCString());
      strm.Indent(pos->first.GetStringRef());

      const uint32_t extra_dump_options = m_raw_value_dump ? eDumpOptionRaw : 0;
      switch (dict_type) {
+1 −1
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ void Options::OutputFormattedUsageText(Stream &strm,
  if (static_cast<uint32_t>(actual_text.length() + strm.GetIndentLevel()) <
      output_max_columns) {
    // Output it as a single line.
    strm.Indent(actual_text.c_str());
    strm.Indent(actual_text);
    strm.EOL();
  } else {
    // We need to break it up into multiple lines.
+4 −4
Original line number Diff line number Diff line
@@ -3131,7 +3131,7 @@ void RenderScriptRuntime::DumpKernels(Stream &strm) const {
    strm.Printf("Resource '%s':", module->m_resname.c_str());
    strm.EOL();
    for (const auto &kernel : module->m_kernels) {
      strm.Indent(kernel.m_name.AsCString());
      strm.Indent(kernel.m_name.GetStringRef());
      strm.EOL();
    }
  }
@@ -3941,7 +3941,7 @@ void RSModuleDescriptor::Dump(Stream &strm) const {
}

void RSGlobalDescriptor::Dump(Stream &strm) const {
  strm.Indent(m_name.AsCString());
  strm.Indent(m_name.GetStringRef());
  VariableList var_list;
  m_module->m_module->FindGlobalVariables(m_name, nullptr, 1U, var_list);
  if (var_list.GetSize() == 1) {
@@ -3966,12 +3966,12 @@ void RSGlobalDescriptor::Dump(Stream &strm) const {
}

void RSKernelDescriptor::Dump(Stream &strm) const {
  strm.Indent(m_name.AsCString());
  strm.Indent(m_name.GetStringRef());
  strm.EOL();
}

void RSReductionDescriptor::Dump(lldb_private::Stream &stream) const {
  stream.Indent(m_reduce_name.AsCString());
  stream.Indent(m_reduce_name.GetStringRef());
  stream.IndentMore();
  stream.EOL();
  stream.Indent();