Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.5 KiB
C++
Raw Permalink Normal View History

//===-- OptionGroupUUID.cpp -----------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "lldb/Interpreter/OptionGroupUUID.h"
2017-03-22 23:33:16 +00:00
#include "lldb/Host/OptionParser.h"
using namespace lldb;
using namespace lldb_private;
OptionGroupUUID::OptionGroupUUID() : m_uuid() {}
OptionGroupUUID::~OptionGroupUUID() {}
static constexpr OptionDefinition g_option_table[] = {
{LLDB_OPT_SET_1, false, "uuid", 'u', OptionParser::eRequiredArgument,
nullptr, {}, 0, eArgTypeModuleUUID, "A module UUID value."},
};
2016-09-22 20:22:55 +00:00
llvm::ArrayRef<OptionDefinition> OptionGroupUUID::GetDefinitions() {
2016-09-22 21:06:13 +00:00
return llvm::makeArrayRef(g_option_table);
}
2017-05-12 04:51:55 +00:00
Status OptionGroupUUID::SetOptionValue(uint32_t option_idx,
llvm::StringRef option_arg,
ExecutionContext *execution_context) {
Status error;
2012-12-04 00:32:51 +00:00
const int short_option = g_option_table[option_idx].short_option;
switch (short_option) {
case 'u':
error = m_uuid.SetValueFromString(option_arg);
if (error.Success())
m_uuid.SetOptionWasSet();
break;
default:
llvm_unreachable("Unimplemented option");
}
return error;
}
2016-08-11 23:51:28 +00:00
void OptionGroupUUID::OptionParsingStarting(
ExecutionContext *execution_context) {
m_uuid.Clear();
}