summaryrefslogtreecommitdiff
path: root/source/Interpreter/OptionValueFileSpecLIst.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-01-19 10:06:29 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-01-19 10:06:29 +0000
commit94994d372d014ce4c8758b9605d63fae651bd8aa (patch)
tree51c0b708bd59f205d6b35cb2a8c24d62f0c33d77 /source/Interpreter/OptionValueFileSpecLIst.cpp
parent39be7ce23363d12ae3e49aeb1fdb2bfeb892e836 (diff)
Notes
Diffstat (limited to 'source/Interpreter/OptionValueFileSpecLIst.cpp')
-rw-r--r--source/Interpreter/OptionValueFileSpecLIst.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/source/Interpreter/OptionValueFileSpecLIst.cpp b/source/Interpreter/OptionValueFileSpecLIst.cpp
index 7fdc3c780239..fd78bba94fef 100644
--- a/source/Interpreter/OptionValueFileSpecLIst.cpp
+++ b/source/Interpreter/OptionValueFileSpecLIst.cpp
@@ -9,10 +9,6 @@
#include "lldb/Interpreter/OptionValueFileSpecList.h"
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
#include "lldb/Host/StringConvert.h"
#include "lldb/Utility/Args.h"
#include "lldb/Utility/Stream.h"
@@ -25,16 +21,24 @@ void OptionValueFileSpecList::DumpValue(const ExecutionContext *exe_ctx,
if (dump_mask & eDumpOptionType)
strm.Printf("(%s)", GetTypeAsCString());
if (dump_mask & eDumpOptionValue) {
- if (dump_mask & eDumpOptionType)
- strm.Printf(" =%s", m_current_value.GetSize() > 0 ? "\n" : "");
- strm.IndentMore();
+ const bool one_line = dump_mask & eDumpOptionCommand;
const uint32_t size = m_current_value.GetSize();
+ if (dump_mask & eDumpOptionType)
+ strm.Printf(" =%s",
+ (m_current_value.GetSize() > 0 && !one_line) ? "\n" : "");
+ if (!one_line)
+ strm.IndentMore();
for (uint32_t i = 0; i < size; ++i) {
- strm.Indent();
- strm.Printf("[%u]: ", i);
+ if (!one_line) {
+ strm.Indent();
+ strm.Printf("[%u]: ", i);
+ }
m_current_value.GetFileSpecAtIndex(i).Dump(&strm);
+ if (one_line)
+ strm << ' ';
}
- strm.IndentLess();
+ if (!one_line)
+ strm.IndentLess();
}
}
@@ -61,7 +65,7 @@ Status OptionValueFileSpecList::SetValueFromString(llvm::StringRef value,
count);
} else {
for (size_t i = 1; i < argc; ++i, ++idx) {
- FileSpec file(args.GetArgumentAtIndex(i), false);
+ FileSpec file(args.GetArgumentAtIndex(i));
if (idx < count)
m_current_value.Replace(idx, file);
else
@@ -83,7 +87,7 @@ Status OptionValueFileSpecList::SetValueFromString(llvm::StringRef value,
if (argc > 0) {
m_value_was_set = true;
for (size_t i = 0; i < argc; ++i) {
- FileSpec file(args.GetArgumentAtIndex(i), false);
+ FileSpec file(args.GetArgumentAtIndex(i));
m_current_value.Append(file);
}
NotifyValueChanged();
@@ -107,7 +111,7 @@ Status OptionValueFileSpecList::SetValueFromString(llvm::StringRef value,
if (op == eVarSetOperationInsertAfter)
++idx;
for (size_t i = 1; i < argc; ++i, ++idx) {
- FileSpec file(args.GetArgumentAtIndex(i), false);
+ FileSpec file(args.GetArgumentAtIndex(i));
m_current_value.Insert(idx, file);
}
NotifyValueChanged();
@@ -136,7 +140,7 @@ Status OptionValueFileSpecList::SetValueFromString(llvm::StringRef value,
size_t num_remove_indexes = remove_indexes.size();
if (num_remove_indexes) {
// Sort and then erase in reverse so indexes are always valid
- std::sort(remove_indexes.begin(), remove_indexes.end());
+ llvm::sort(remove_indexes.begin(), remove_indexes.end());
for (size_t j = num_remove_indexes - 1; j < num_remove_indexes; ++j) {
m_current_value.Remove(j);
}