Coverage Report

Created: 2022-01-18 06:27

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/include/lldb/Interpreter/OptionValueLanguage.h
Line
Count
Source (jump to first uncovered line)
1
//===-- OptionValueLanguage.h -------------------------------------*- C++
2
//-*-===//
3
//
4
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5
// See https://llvm.org/LICENSE.txt for license information.
6
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7
//
8
//===----------------------------------------------------------------------===//
9
10
#ifndef LLDB_INTERPRETER_OPTIONVALUELANGUAGE_H
11
#define LLDB_INTERPRETER_OPTIONVALUELANGUAGE_H
12
13
#include "lldb/Interpreter/OptionValue.h"
14
#include "lldb/lldb-enumerations.h"
15
16
namespace lldb_private {
17
18
class OptionValueLanguage : public Cloneable<OptionValueLanguage, OptionValue> {
19
public:
20
  OptionValueLanguage(lldb::LanguageType value)
21
21.2k
      : m_current_value(value), m_default_value(value) {}
22
23
  OptionValueLanguage(lldb::LanguageType current_value,
24
                      lldb::LanguageType default_value)
25
29.7k
      : m_current_value(current_value), m_default_value(default_value) {}
26
27
56.4k
  ~OptionValueLanguage() override = default;
28
29
  // Virtual subclass pure virtual overrides
30
31
9.42k
  OptionValue::Type GetType() const override { return eTypeLanguage; }
32
33
  void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
34
                 uint32_t dump_mask) override;
35
36
  Status
37
  SetValueFromString(llvm::StringRef value,
38
                     VarSetOperationType op = eVarSetOperationAssign) override;
39
40
6.91k
  void Clear() override {
41
6.91k
    m_current_value = m_default_value;
42
6.91k
    m_value_was_set = false;
43
6.91k
  }
44
45
  // Subclass specific functions
46
47
9.38k
  lldb::LanguageType GetCurrentValue() const { return m_current_value; }
48
49
0
  lldb::LanguageType GetDefaultValue() const { return m_default_value; }
50
51
2
  void SetCurrentValue(lldb::LanguageType value) { m_current_value = value; }
52
53
0
  void SetDefaultValue(lldb::LanguageType value) { m_default_value = value; }
54
55
protected:
56
  lldb::LanguageType m_current_value;
57
  lldb::LanguageType m_default_value;
58
};
59
60
} // namespace lldb_private
61
62
#endif // LLDB_INTERPRETER_OPTIONVALUELANGUAGE_H