diff options
Diffstat (limited to 'lldb/source/Utility/Args.cpp')
| -rw-r--r-- | lldb/source/Utility/Args.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lldb/source/Utility/Args.cpp b/lldb/source/Utility/Args.cpp index b13a91f2b43..9fcc833ce43 100644 --- a/lldb/source/Utility/Args.cpp +++ b/lldb/source/Utility/Args.cpp @@ -163,7 +163,6 @@ Args::ArgEntry::ArgEntry(llvm::StringRef str, char quote) : quote(quote) { ::memcpy(data(), str.data() ? str.data() : "", size); ptr[size] = 0; - ref = llvm::StringRef(c_str(), size); } // Args constructor @@ -182,7 +181,7 @@ Args &Args::operator=(const Args &rhs) { m_argv.clear(); m_entries.clear(); for (auto &entry : rhs.m_entries) { - m_entries.emplace_back(entry.ref, entry.quote); + m_entries.emplace_back(entry.ref(), entry.quote); m_argv.push_back(m_entries.back().data()); } m_argv.push_back(nullptr); @@ -199,7 +198,7 @@ void Args::Dump(Stream &s, const char *label_name) const { int i = 0; for (auto &entry : m_entries) { s.Indent(); - s.Format("{0}[{1}]=\"{2}\"\n", label_name, i++, entry.ref); + s.Format("{0}[{1}]=\"{2}\"\n", label_name, i++, entry.ref()); } s.Format("{0}[{1}]=NULL\n", label_name, i); s.EOL(); @@ -211,7 +210,7 @@ bool Args::GetCommandString(std::string &command) const { for (size_t i = 0; i < m_entries.size(); ++i) { if (i > 0) command += ' '; - command += m_entries[i].ref; + command += m_entries[i].ref(); } return !m_entries.empty(); @@ -226,10 +225,10 @@ bool Args::GetQuotedCommandString(std::string &command) const { if (m_entries[i].quote) { command += m_entries[i].quote; - command += m_entries[i].ref; + command += m_entries[i].ref(); command += m_entries[i].quote; } else { - command += m_entries[i].ref; + command += m_entries[i].ref(); } } @@ -293,7 +292,7 @@ void Args::AppendArguments(const Args &rhs) { assert(m_argv.back() == nullptr); m_argv.pop_back(); for (auto &entry : rhs.m_entries) { - m_entries.emplace_back(entry.ref, entry.quote); + m_entries.emplace_back(entry.ref(), entry.quote); m_argv.push_back(m_entries.back().data()); } m_argv.push_back(nullptr); |

