diff options
| author | Raphael Isemann <teemperor@gmail.com> | 2019-09-13 08:26:00 +0000 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2019-09-13 08:26:00 +0000 |
| commit | a024f5e3701a602a582f0d5705ed2b431aaf8e4d (patch) | |
| tree | ab430784e8ff1646ee8e992fb81a0cfca5777c83 | |
| parent | 1ae9e6918d94ec0e296c7753cd3f1a7c22cb3153 (diff) | |
| download | bcm5719-llvm-a024f5e3701a602a582f0d5705ed2b431aaf8e4d.tar.gz bcm5719-llvm-a024f5e3701a602a582f0d5705ed2b431aaf8e4d.zip | |
[lldb][NFC] Make ArgEntry::quote private and provide a getter
llvm-svn: 371823
| -rw-r--r-- | lldb/include/lldb/Utility/Args.h | 3 | ||||
| -rw-r--r-- | lldb/source/API/SBCommandInterpreter.cpp | 2 | ||||
| -rw-r--r-- | lldb/source/Host/common/Editline.cpp | 2 | ||||
| -rw-r--r-- | lldb/source/Interpreter/Options.cpp | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/lldb/include/lldb/Utility/Args.h b/lldb/include/lldb/Utility/Args.h index bc21d39bac2..7672dbf95e3 100644 --- a/lldb/include/lldb/Utility/Args.h +++ b/lldb/include/lldb/Utility/Args.h @@ -35,6 +35,7 @@ public: private: friend class Args; std::unique_ptr<char[]> ptr; + char quote; char *data() { return ptr.get(); } @@ -43,11 +44,11 @@ public: ArgEntry(llvm::StringRef str, char quote); llvm::StringRef ref; - char quote; const char *c_str() const { return ptr.get(); } /// Returns true if this argument was quoted in any way. bool IsQuoted() const { return quote != '\0'; } + char GetQuoteChar() const { return quote; } }; /// Construct with an option command string. diff --git a/lldb/source/API/SBCommandInterpreter.cpp b/lldb/source/API/SBCommandInterpreter.cpp index 98354c414a7..23a9b24206c 100644 --- a/lldb/source/API/SBCommandInterpreter.cpp +++ b/lldb/source/API/SBCommandInterpreter.cpp @@ -394,7 +394,7 @@ int SBCommandInterpreter::HandleCompletionWithDescriptions( // If we matched a unique single command, add a space... Only do this if // the completer told us this was a complete word, however... if (lldb_matches.GetSize() == 1) { - char quote_char = request.GetParsedArg().quote; + char quote_char = request.GetParsedArg().GetQuoteChar(); common_prefix = Args::EscapeLLDBCommandArgument(common_prefix, quote_char); if (request.GetParsedArg().IsQuoted()) diff --git a/lldb/source/Host/common/Editline.cpp b/lldb/source/Host/common/Editline.cpp index 0a95dffa40e..3e655244b10 100644 --- a/lldb/source/Host/common/Editline.cpp +++ b/lldb/source/Host/common/Editline.cpp @@ -949,7 +949,7 @@ unsigned char Editline::TabCommand(int ch) { std::string to_add = completion.GetCompletion(); to_add = to_add.substr(request.GetCursorArgumentPrefix().size()); if (request.GetParsedArg().IsQuoted()) - to_add.push_back(request.GetParsedArg().quote); + to_add.push_back(request.GetParsedArg().GetQuoteChar()); to_add.push_back(' '); el_insertstr(m_editline, to_add.c_str()); break; diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp index 138677ca13f..0e37461601d 100644 --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -937,7 +937,7 @@ static Args ReconstituteArgsAfterParsing(llvm::ArrayRef<char *> parsed, for (const char *arg : parsed) { auto pos = FindOriginalIter(arg, original); assert(pos != original.end()); - result.AppendArgument(pos->ref, pos->quote); + result.AppendArgument(pos->ref, pos->GetQuoteChar()); } return result; } |

