summaryrefslogtreecommitdiff
path: root/source/Utility
diff options
context:
space:
mode:
Diffstat (limited to 'source/Utility')
-rw-r--r--source/Utility/ArchSpec.cpp8
-rw-r--r--source/Utility/CompletionRequest.cpp1
-rw-r--r--source/Utility/Stream.cpp45
3 files changed, 6 insertions, 48 deletions
diff --git a/source/Utility/ArchSpec.cpp b/source/Utility/ArchSpec.cpp
index 320f2d9d1144..1c50c313e0d1 100644
--- a/source/Utility/ArchSpec.cpp
+++ b/source/Utility/ArchSpec.cpp
@@ -255,12 +255,14 @@ size_t ArchSpec::AutoComplete(CompletionRequest &request) {
for (uint32_t i = 0; i < llvm::array_lengthof(g_core_definitions); ++i) {
if (NameMatches(g_core_definitions[i].name, NameMatch::StartsWith,
request.GetCursorArgumentPrefix()))
- request.GetMatches().AppendString(g_core_definitions[i].name);
+ request.AddCompletion(g_core_definitions[i].name);
}
} else {
- ListSupportedArchNames(request.GetMatches());
+ StringList matches;
+ ListSupportedArchNames(matches);
+ request.AddCompletions(matches);
}
- return request.GetMatches().GetSize();
+ return request.GetNumberOfMatches();
}
#define CPU_ANY (UINT32_MAX)
diff --git a/source/Utility/CompletionRequest.cpp b/source/Utility/CompletionRequest.cpp
index 1b7697a35860..c88747e2abe3 100644
--- a/source/Utility/CompletionRequest.cpp
+++ b/source/Utility/CompletionRequest.cpp
@@ -20,6 +20,7 @@ CompletionRequest::CompletionRequest(llvm::StringRef command_line,
: m_command(command_line), m_raw_cursor_pos(raw_cursor_pos),
m_match_start_point(match_start_point),
m_max_return_elements(max_return_elements), m_matches(&matches) {
+ matches.Clear();
// We parse the argument up to the cursor, so the last argument in
// parsed_line is the one containing the cursor, and the cursor is after the
diff --git a/source/Utility/Stream.cpp b/source/Utility/Stream.cpp
index 647a0c0beb5c..7df7f7008084 100644
--- a/source/Utility/Stream.cpp
+++ b/source/Utility/Stream.cpp
@@ -526,48 +526,3 @@ size_t Stream::PutCStringAsRawHex8(const char *s) {
m_flags.Set(eBinary);
return bytes_written;
}
-
-void Stream::UnitTest(Stream *s) {
- s->PutHex8(0x12);
-
- s->PutChar(' ');
- s->PutHex16(0x3456, endian::InlHostByteOrder());
- s->PutChar(' ');
- s->PutHex16(0x3456, eByteOrderBig);
- s->PutChar(' ');
- s->PutHex16(0x3456, eByteOrderLittle);
-
- s->PutChar(' ');
- s->PutHex32(0x789abcde, endian::InlHostByteOrder());
- s->PutChar(' ');
- s->PutHex32(0x789abcde, eByteOrderBig);
- s->PutChar(' ');
- s->PutHex32(0x789abcde, eByteOrderLittle);
-
- s->PutChar(' ');
- s->PutHex64(0x1122334455667788ull, endian::InlHostByteOrder());
- s->PutChar(' ');
- s->PutHex64(0x1122334455667788ull, eByteOrderBig);
- s->PutChar(' ');
- s->PutHex64(0x1122334455667788ull, eByteOrderLittle);
-
- const char *hola = "Hello World!!!";
- s->PutChar(' ');
- s->PutCString(hola);
-
- s->PutChar(' ');
- s->Write(hola, 5);
-
- s->PutChar(' ');
- s->PutCStringAsRawHex8(hola);
-
- s->PutChar(' ');
- s->PutCStringAsRawHex8("01234");
-
- s->PutChar(' ');
- s->Printf("pid=%i", 12733);
-
- s->PutChar(' ');
- s->PrintfAsRawHex8("pid=%i", 12733);
- s->PutChar('\n');
-}