LLDB mainline
RustLanguage.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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_LANGUAGE_RUST_RUSTLANGUAGE_H
10#define LLDB_SOURCE_PLUGINS_LANGUAGE_RUST_RUSTLANGUAGE_H
11
13#include "lldb/lldb-private.h"
14#include "llvm/ADT/StringRef.h"
15
16namespace lldb_private {
17
18namespace formatters {
19SyntheticChildrenFrontEnd *
21 lldb::ValueObjectSP valobj_sp);
22}
23
24class RustLanguage : public Language {
25public:
26 RustLanguage() = default;
27
28 ~RustLanguage() override = default;
29
33
34 bool IsSourceFile(llvm::StringRef file_path) const override;
35
36 std::unique_ptr<TypeScavenger> GetTypeScavenger() override;
37
38 bool IsNilReference(ValueObject &valobj) override;
39
40 /// Rust has no null literal, so null pointers print like in C.
41 llvm::StringRef GetNilReferenceSummaryString() override { return "NULL"; }
42
43 DemangledName DemangleSymbol(ConstString mangled,
45 const DemangleOptions &options) const override;
46
48
49 std::vector<lldb::LanguageType>
50 GetFormatterLanguages(lldb::LanguageType language) const override;
51
52 bool IsCategoryApplicable(lldb::LanguageType category_language,
53 lldb::LanguageType valobj_language) const override;
54
55 // Static Functions
56 static void Initialize();
57
58 static void Terminate();
59
61
62 static llvm::StringRef GetPluginNameStatic() { return "rust"; }
63
64 /// PluginInterface protocol.
65 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
66};
67
68} // namespace lldb_private
69
70#endif // LLDB_SOURCE_PLUGINS_LANGUAGE_RUST_RUSTLANGUAGE_H
A uniqued constant string class.
Definition ConstString.h:40
std::unique_ptr< TypeScavenger > GetTypeScavenger() override
std::vector< lldb::LanguageType > GetFormatterLanguages(lldb::LanguageType language) const override
Returns the languages whose formatters apply to values of language, in the order in which to consult ...
llvm::StringRef GetPluginName() override
PluginInterface protocol.
static Language * CreateInstance(lldb::LanguageType language)
DemangledName DemangleSymbol(ConstString mangled, Mangled::ManglingScheme scheme, const DemangleOptions &options) const override
Demangle mangled, a name mangled with scheme, a scheme that this language registered with Mangled::Re...
bool IsSourceFile(llvm::StringRef file_path) const override
static llvm::StringRef GetPluginNameStatic()
lldb::TypeCategoryImplSP GetFormatters() override
llvm::StringRef GetNilReferenceSummaryString() override
Rust has no null literal, so null pointers print like in C.
lldb::LanguageType GetLanguageType() const override
~RustLanguage() override=default
bool IsNilReference(ValueObject &valobj) override
bool IsCategoryApplicable(lldb::LanguageType category_language, lldb::LanguageType valobj_language) const override
Returns whether the formatters in a category for category_language, one of the languages of this plug...
SyntheticChildrenFrontEnd * RustVectorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP valobj_sp)
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
LanguageType
Programming language type.
@ eLanguageTypeRust
Rust.
std::shared_ptr< lldb_private::TypeCategoryImpl > TypeCategoryImplSP