1 //===-- OptionGroupMemoryTag.cpp -----------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "lldb/Interpreter/OptionGroupMemoryTag.h"
11 #include "lldb/Host/OptionParser.h"
14 using namespace lldb_private
;
16 static const uint32_t SHORT_OPTION_SHOW_TAGS
= 0x54414753; // 'tags'
18 OptionGroupMemoryTag::OptionGroupMemoryTag(bool note_binary
/*=false*/)
19 : m_show_tags(false, false), m_option_definition
{
23 SHORT_OPTION_SHOW_TAGS
,
24 OptionParser::eNoArgument
,
30 ? "Include memory tags in output "
31 "(does not apply to binary output)."
32 : "Include memory tags in output."} {}
34 llvm::ArrayRef
<OptionDefinition
> OptionGroupMemoryTag::GetDefinitions() {
35 return llvm::ArrayRef(m_option_definition
);
39 OptionGroupMemoryTag::SetOptionValue(uint32_t option_idx
,
40 llvm::StringRef option_arg
,
41 ExecutionContext
*execution_context
) {
42 assert(option_idx
== 0 && "Only one option in memory tag group!");
44 switch (m_option_definition
.short_option
) {
45 case SHORT_OPTION_SHOW_TAGS
:
46 m_show_tags
.SetCurrentValue(true);
47 m_show_tags
.SetOptionWasSet();
51 llvm_unreachable("Unimplemented option");
57 void OptionGroupMemoryTag::OptionParsingStarting(
58 ExecutionContext
*execution_context
) {