Coverage Report

Created: 2022-01-18 06:27

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/include/lldb/Interpreter/OptionValueFileSpecList.h
Line
Count
Source (jump to first uncovered line)
1
//===-- OptionValueFileSpecList.h -------------------------------*- C++ -*-===//
2
//
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
6
//
7
//===----------------------------------------------------------------------===//
8
9
#ifndef LLDB_INTERPRETER_OPTIONVALUEFILESPECLIST_H
10
#define LLDB_INTERPRETER_OPTIONVALUEFILESPECLIST_H
11
12
#include <mutex>
13
14
#include "lldb/Core/FileSpecList.h"
15
#include "lldb/Interpreter/OptionValue.h"
16
17
namespace lldb_private {
18
19
class OptionValueFileSpecList
20
    : public Cloneable<OptionValueFileSpecList, OptionValue> {
21
public:
22
32.3k
  OptionValueFileSpecList() = default;
23
24
  OptionValueFileSpecList(const OptionValueFileSpecList &other)
25
27.1k
      : Cloneable(other), m_current_value(other.GetCurrentValue()) {}
26
27
41.9k
  ~OptionValueFileSpecList() override = default;
28
29
  // Virtual subclass pure virtual overrides
30
31
421k
  OptionValue::Type GetType() const override { return eTypeFileSpecList; }
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
20.8k
  void Clear() override {
41
20.8k
    std::lock_guard<std::recursive_mutex> lock(m_mutex);
42
20.8k
    m_current_value.Clear();
43
20.8k
    m_value_was_set = false;
44
20.8k
  }
45
46
0
  bool IsAggregateValue() const override { return true; }
47
48
  // Subclass specific functions
49
50
445k
  FileSpecList GetCurrentValue() const {
51
445k
    std::lock_guard<std::recursive_mutex> lock(m_mutex);
52
445k
    return m_current_value;
53
445k
  }
54
55
0
  void SetCurrentValue(const FileSpecList &value) {
56
0
    std::lock_guard<std::recursive_mutex> lock(m_mutex);
57
0
    m_current_value = value;
58
0
  }
59
60
2.96k
  void AppendCurrentValue(const FileSpec &value) {
61
2.96k
    std::lock_guard<std::recursive_mutex> lock(m_mutex);
62
2.96k
    m_current_value.Append(value);
63
2.96k
  }
64
65
protected:
66
  lldb::OptionValueSP Clone() const override;
67
68
  mutable std::recursive_mutex m_mutex;
69
  FileSpecList m_current_value;
70
};
71
72
} // namespace lldb_private
73
74
#endif // LLDB_INTERPRETER_OPTIONVALUEFILESPECLIST_H