Coverage Report

Created: 2022-01-18 06:27

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/source/Plugins/REPL/Clang/ClangREPL.h
Line
Count
Source
1
//===-- ClangREPL.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_SOURCE_PLUGINS_REPL_CLANG_CLANGREPL_H
10
#define LLDB_SOURCE_PLUGINS_REPL_CLANG_CLANGREPL_H
11
12
#include "lldb/Expression/REPL.h"
13
14
namespace lldb_private {
15
/// Implements a Clang-based REPL for C languages on top of LLDB's REPL
16
/// framework.
17
class ClangREPL : public REPL {
18
public:
19
  ClangREPL(lldb::LanguageType language, Target &target);
20
21
  ~ClangREPL() override;
22
23
  static void Initialize();
24
25
  static void Terminate();
26
27
  static lldb::REPLSP CreateInstance(Status &error, lldb::LanguageType language,
28
                                     Debugger *debugger, Target *target,
29
                                     const char *repl_options);
30
31
3.44k
  static llvm::StringRef GetPluginNameStatic() { return "ClangREPL"; }
32
33
protected:
34
  Status DoInitialization() override;
35
36
  ConstString GetSourceFileBasename() override;
37
38
  const char *GetAutoIndentCharacters() override;
39
40
  bool SourceIsComplete(const std::string &source) override;
41
42
  lldb::offset_t GetDesiredIndentation(const StringList &lines,
43
                                       int cursor_position,
44
                                       int tab_size) override;
45
46
  lldb::LanguageType GetLanguage() override;
47
48
  bool PrintOneVariable(Debugger &debugger, lldb::StreamFileSP &output_sp,
49
                        lldb::ValueObjectSP &valobj_sp,
50
                        ExpressionVariable *var = nullptr) override;
51
52
  void CompleteCode(const std::string &current_code,
53
                    CompletionRequest &request) override;
54
55
private:
56
  /// The specific C language of this REPL.
57
  lldb::LanguageType m_language;
58
  /// A regex matching the implicitly created LLDB result variables.
59
  lldb_private::RegularExpression m_implicit_expr_result_regex;
60
};
61
} // namespace lldb_private
62
63
#endif // LLDB_SOURCE_PLUGINS_REPL_CLANG_CLANGREPL_H