[Go to site: main page, start]

LLDB mainline
TypeSystem.h
Go to the documentation of this file.
1//===-- TypeSystem.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_SYMBOL_TYPESYSTEM_H
10#define LLDB_SYMBOL_TYPESYSTEM_H
11
12#include <atomic>
13#include <cassert>
14#include <functional>
15#include <mutex>
16#include <optional>
17#include <string>
18
19#include "llvm/ADT/APFloat.h"
20#include "llvm/ADT/APSInt.h"
21#include "llvm/ADT/DenseMap.h"
22#include "llvm/ADT/SmallBitVector.h"
23#include "llvm/Support/Casting.h"
24#include "llvm/Support/Error.h"
25#include "llvm/Support/JSON.h"
26
31#include "lldb/Symbol/Type.h"
32#include "lldb/Utility/Scalar.h"
33#include "lldb/lldb-forward.h"
34#include "lldb/lldb-private.h"
35#include "lldb/lldb-types.h"
36
37class PDBASTParser;
38
39namespace lldb_private {
40
41namespace plugin {
42namespace dwarf {
43class DWARFDIE;
44class DWARFASTParser;
45} // namespace dwarf
46} // namespace plugin
47
48namespace npdb {
49 class PdbAstBuilder;
50} // namespace npdb
51
52/// Interface for representing a type system.
53///
54/// Implemented by language plugins to define the type system for a given
55/// language.
56///
57/// This interface extensively used opaque pointers to prevent that generic
58/// LLDB code has dependencies on language plugins. The type and semantics of
59/// these opaque pointers are defined by the TypeSystem implementation inside
60/// the respective language plugin. Opaque pointers from one TypeSystem
61/// instance should never be passed to a different TypeSystem instance (even
62/// when the language plugin for both TypeSystem instances is the same).
63///
64/// Most of the functions in this class should not be called directly but only
65/// called by their respective counterparts in CompilerType, CompilerDecl and
66/// CompilerDeclContext.
67///
68/// \see lldb_private::CompilerType
69/// \see lldb_private::CompilerDecl
70/// \see lldb_private::CompilerDeclContext
72 public std::enable_shared_from_this<TypeSystem> {
73public:
74 // Constructors and Destructors
76 ~TypeSystem() override;
77
78 // LLVM RTTI support
79 virtual bool isA(const void *ClassID) const = 0;
80
82 Module *module);
83
85 Target *target);
86
87 /// Free up any resources associated with this TypeSystem. Done before
88 /// removing all the TypeSystems from the TypeSystemMap.
89 virtual void Finalize() {}
90
91 virtual plugin::dwarf::DWARFASTParser *GetDWARFParser() { return nullptr; }
92
93 virtual PDBASTParser *GetPDBParser() { return nullptr; }
94 virtual npdb::PdbAstBuilder *GetNativePDBParser() { return nullptr; }
95
96 // CompilerDecl functions
97 virtual ConstString DeclGetName(void *opaque_decl) = 0;
98
99 virtual ConstString DeclGetMangledName(void *opaque_decl);
100
101 virtual CompilerDeclContext DeclGetDeclContext(void *opaque_decl);
102
103 virtual CompilerType DeclGetFunctionReturnType(void *opaque_decl);
104
105 virtual size_t DeclGetFunctionNumArguments(void *opaque_decl);
106
107 virtual CompilerType DeclGetFunctionArgumentType(void *opaque_decl,
108 size_t arg_idx);
109
110 virtual std::vector<lldb_private::CompilerContext>
111 DeclGetCompilerContext(void *opaque_decl);
112
113 virtual Scalar DeclGetConstantValue(void *opaque_decl) { return Scalar(); }
114
115 virtual CompilerType GetTypeForDecl(void *opaque_decl) = 0;
116
117 // CompilerDeclContext functions
118
119 virtual std::vector<CompilerDecl>
120 DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString name,
121 const bool ignore_imported_decls);
122
123 virtual ConstString DeclContextGetName(void *opaque_decl_ctx) = 0;
124
125 virtual ConstString
126 DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) = 0;
127
128 virtual bool DeclContextIsClassMethod(void *opaque_decl_ctx) = 0;
129
130 virtual bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,
131 void *other_opaque_decl_ctx) = 0;
132
133 virtual lldb::LanguageType DeclContextGetLanguage(void *opaque_decl_ctx) = 0;
134
135 /// Returns the direct parent context of specified type
136 virtual CompilerDeclContext
138
139 virtual std::vector<lldb_private::CompilerContext>
140 DeclContextGetCompilerContext(void *opaque_decl_ctx);
141
142 // Tests
143#ifndef NDEBUG
144 /// Verify the integrity of the type to catch CompilerTypes that mix
145 /// and match invalid TypeSystem/Opaque type pairs.
146 virtual bool Verify(lldb::opaque_compiler_type_t type) = 0;
147#endif
148
150 CompilerType *element_type, uint64_t *size,
151 bool *is_incomplete) = 0;
152
154
156
158
160
162
164
166
167 virtual size_t
169
170 virtual CompilerType
172 const size_t index) = 0;
173
175
176 virtual bool
178
180
182 CompilerType *function_pointer_type_ptr) = 0;
183
185 bool &is_signed) = 0;
186
188 bool &is_signed) {
189 is_signed = false;
190 return false;
191 }
192
194
196 CompilerType *target_type, // Can pass NULL
197 bool check_cplusplus, bool check_objc) = 0;
198
200 CompilerType *pointee_type) = 0;
201
203
205
207 return false;
208 }
209
210 virtual bool CanPassInRegisters(const CompilerType &type) = 0;
211
212 // TypeSystems can support more than one language
213 virtual bool SupportsLanguage(lldb::LanguageType language) = 0;
214
215 static bool SupportsLanguageStatic(lldb::LanguageType language);
216 // Type Completion
217
219
221 return false;
222 }
223
224 // AST related queries
225
226 virtual uint32_t GetPointerByteSize() = 0;
227
228 virtual CompilerType GetPointerDiffType(bool is_signed) = 0;
229
231
232 virtual unsigned GetPtrAuthKey(lldb::opaque_compiler_type_t type) = 0;
233
234 virtual unsigned
236
237 virtual bool
239
240 // Accessors
241
243 bool BaseOnly) = 0;
244
246
247 /// Defaults to GetTypeName(type). Override if your language desires
248 /// specialized behavior.
250
251 virtual uint32_t
253 CompilerType *pointee_or_element_compiler_type) = 0;
254
255 virtual lldb::LanguageType
257
258 virtual lldb::TypeClass GetTypeClass(lldb::opaque_compiler_type_t type) = 0;
259
260 // Creating related types
261
262 virtual CompilerType
264 ExecutionContextScope *exe_scope) = 0;
265
267 uint64_t size);
268
270
271 virtual CompilerType
273
274 // Returns -1 if this isn't a function of if the function doesn't have a
275 // prototype Returns a value >= 0 if there is a prototype.
277
278 virtual CompilerType
280 size_t idx) = 0;
281
282 virtual CompilerType
284
286
289
291
293
294 virtual CompilerType
296
297 virtual CompilerType
299
301
303
305
307
309 uint32_t payload);
310
311 /// \param opaque_payload The m_payload field of Type, which may
312 /// carry TypeSystem-specific extra information.
314 const char *name,
315 const CompilerDeclContext &decl_ctx,
316 uint32_t opaque_payload);
317
318 // Exploring the type
319
320 virtual const llvm::fltSemantics &
321 GetFloatTypeSemantics(size_t byte_size, lldb::Format format) = 0;
322
323 virtual llvm::Expected<uint64_t>
325 ExecutionContextScope *exe_scope) = 0;
326
328
330
331 virtual llvm::Expected<uint32_t>
333 bool omit_empty_base_classes,
334 const ExecutionContext *exe_ctx) = 0;
335
337
338 virtual lldb::BasicType
340
341 virtual void ForEachEnumerator(
343 std::function<bool(const CompilerType &integer_type,
344 ConstString name,
345 const llvm::APSInt &value)> const &callback) {}
346
347 virtual uint32_t GetNumFields(lldb::opaque_compiler_type_t type) = 0;
348
350 size_t idx, std::string &name,
351 uint64_t *bit_offset_ptr,
352 uint32_t *bitfield_bit_size_ptr,
353 bool *is_bitfield_ptr) = 0;
354
355 virtual uint32_t
357
358 virtual uint32_t
360
361 virtual CompilerType
363 uint32_t *bit_offset_ptr) = 0;
364
365 virtual CompilerType
367 uint32_t *bit_offset_ptr) = 0;
368
370 llvm::StringRef name) {
371 return CompilerDecl();
372 }
373
374 virtual llvm::Expected<CompilerType>
376 ExecutionContext *exe_ctx, std::string &deref_name,
377 uint32_t &deref_byte_size, int32_t &deref_byte_offset,
378 ValueObject *valobj, uint64_t &language_flags) = 0;
379
380 virtual llvm::Expected<CompilerType> GetChildCompilerTypeAtIndex(
381 lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, size_t idx,
382 bool transparent_pointers, bool omit_empty_base_classes,
383 bool ignore_array_bounds, std::string &child_name,
384 uint32_t &child_byte_size, int32_t &child_byte_offset,
385 uint32_t &child_bitfield_bit_size, uint32_t &child_bitfield_bit_offset,
386 bool &child_is_base_class, bool &child_is_deref_of_parent,
387 ValueObject *valobj, uint64_t &language_flags) = 0;
388
389 // Lookup a child given a name. This function will match base class names and
390 // member member names in "clang_type" only, not descendants.
391 virtual llvm::Expected<uint32_t>
393 llvm::StringRef name,
394 bool omit_empty_base_classes) = 0;
395
397 lldb::opaque_compiler_type_t type, llvm::StringRef name,
398 bool omit_empty_base_classes, std::vector<uint32_t> &child_indexes) = 0;
399
400 virtual CompilerType
402 llvm::StringRef name) {
403 return CompilerType();
404 }
405
407
409 bool expand_pack);
410
413 bool expand_pack);
414 virtual CompilerType
416 bool expand_pack);
417 virtual std::optional<CompilerType::IntegralTemplateArgument>
419 bool expand_pack);
420
422
423 virtual CompilerType
425
426 // Dumping types
427
428#ifndef NDEBUG
429 /// Convenience LLVM-style dump method for use in the debugger only.
430 LLVM_DUMP_METHOD virtual void
432#endif
433
435 lldb::Format format, const DataExtractor &data,
436 lldb::offset_t data_offset, size_t data_byte_size,
437 uint32_t bitfield_bit_size,
438 uint32_t bitfield_bit_offset,
439 ExecutionContextScope *exe_scope) = 0;
440
441 /// Dump the type to stdout.
445
446 /// Print a description of the type to a stream. The exact implementation
447 /// varies, but the expectation is that eDescriptionLevelFull returns a
448 /// source-like representation of the type, whereas eDescriptionLevelVerbose
449 /// does a dump of the underlying AST if applicable.
453
454 /// Dump a textual representation of the internal TypeSystem state to the
455 /// given stream.
456 ///
457 /// This should not modify the state of the TypeSystem if possible.
458 ///
459 /// \param[out] output Stream to dup the AST into.
460 /// \param[in] filter If empty, dump whole AST. If non-empty, will only
461 /// dump decls whose names contain \c filter.
462 /// \param[in] show_color If true, prints the AST color-highlighted.
463 virtual void Dump(llvm::raw_ostream &output, llvm::StringRef filter,
464 bool show_color) = 0;
465
466 /// This is used by swift.
468
469 // TODO: Determine if these methods should move to TypeSystemClang.
470
472 CompilerType *pointee_type) = 0;
473
475
476 virtual std::optional<size_t>
478 ExecutionContextScope *exe_scope) = 0;
479
481
485
486 virtual CompilerType
488 size_t bit_size) = 0;
489
491
492 virtual bool IsConst(lldb::opaque_compiler_type_t type) = 0;
493
495 CompilerType *base_type_ptr) = 0;
496
498
500
501 // If the current object represents a typedef type, get the underlying type
503
505 CompilerType *element_type, uint64_t *size) = 0;
506
507 virtual CompilerType
509
510 virtual CompilerType
512
514 CompilerType *pointee_type, bool *is_rvalue) = 0;
515
516 virtual bool
520
522 llvm::StringRef expr, llvm::StringRef prefix, SourceLanguage language,
523 Expression::ResultType desired_type,
524 const EvaluateExpressionOptions &options, ValueObject *ctx_obj) {
525 return nullptr;
526 }
527
528 virtual FunctionCaller *GetFunctionCaller(const CompilerType &return_type,
529 const Address &function_address,
530 const ValueList &arg_value_list,
531 const char *name) {
532 return nullptr;
533 }
534
535 virtual std::unique_ptr<UtilityFunction>
536 CreateUtilityFunction(std::string text, std::string name);
537
539 return nullptr;
540 }
541
542 virtual CompilerType GetTypeForFormatters(void *type);
543
544 virtual LazyBool ShouldPrintAsOneLiner(void *type, ValueObject *valobj);
545
546 // Type systems can have types that are placeholder types, which are meant to
547 // indicate the presence of a type, but offer no actual information about
548 // said types, and leave the burden of actually figuring type information out
549 // to dynamic type resolution. For instance a language with a generics
550 // system, can use placeholder types to indicate "type argument goes here",
551 // without promising uniqueness of the placeholder, nor attaching any
552 // actually idenfiable information to said placeholder. This API allows type
553 // systems to tell LLDB when such a type has been encountered In response,
554 // the debugger can react by not using this type as a cache entry in any
555 // type-specific way For instance, LLDB will currently not cache any
556 // formatters that are discovered on such a type as attributable to the
557 // meaningless type itself, instead preferring to use the dynamic type
558 virtual bool IsMeaninglessWithoutDynamicResolution(void *type);
559
560 virtual std::optional<llvm::json::Value> ReportStatistics();
561
562 SymbolFile *GetSymbolFile() const { return m_sym_file.load(); }
563
564 /// Bind this TypeSystem to its owning SymbolFile.
565 ///
566 /// A TypeSystem is created by its Module's TypeSystemMap before that
567 /// Module has an associated SymbolFile. The SymbolFile installs this
568 /// back-pointer when it first hands out the TypeSystem so that lazy
569 /// type-completion callbacks can route through it.
570 ///
571 /// Each Module owns at most one SymbolFile and one (Module-)TypeSystem per
572 /// language, so the binding is expected to be established exactly once.
573 /// Repeated calls with the same pointer are no-ops. Rebinding to a different
574 /// non-null SymbolFile is a programming error.
575 void SetSymbolFile(SymbolFile *sym_file) {
576 SymbolFile *expected = nullptr;
577 if (m_sym_file.compare_exchange_strong(expected, sym_file))
578 return;
579 assert(expected == sym_file &&
580 "TypeSystem rebound to a different SymbolFile");
581 }
582
586
587protected:
588 /// Used for reporting statistics.
590
591private:
592 std::atomic<SymbolFile *> m_sym_file = nullptr;
593};
594
596public:
599
600 // Clear calls Finalize on all the TypeSystems managed by this map, and then
601 // empties the map.
602 void Clear();
603
604 // Iterate through all of the type systems that are created. Return true from
605 // callback to keep iterating, false to stop iterating.
606 void ForEach(std::function<bool(lldb::TypeSystemSP)> const &callback);
607
608 llvm::Expected<lldb::TypeSystemSP>
610 bool can_create);
611
612 llvm::Expected<lldb::TypeSystemSP>
614 bool can_create);
615
616 /// Check all type systems in the map to see if any have forcefully completed
617 /// types;
619protected:
620 typedef llvm::DenseMap<uint16_t, lldb::TypeSystemSP> collection;
621 mutable std::mutex m_mutex; ///< A mutex to keep this object happy in
622 /// multi-threaded environments.
625
626private:
627 typedef llvm::function_ref<lldb::TypeSystemSP()> CreateCallback;
628 /// Finds the type system for the given language. If no type system could be
629 /// found for a language and a CreateCallback was provided, the value
630 /// returned by the callback will be treated as the TypeSystem for the
631 /// language.
632 ///
633 /// \param language The language for which the type system should be found.
634 /// \param create_callback A callback that will be called if no previously
635 /// created TypeSystem that fits the given language
636 /// could found. Can be omitted if a non-existent
637 /// type system should be treated as an error
638 /// instead.
639 /// \return The found type system or an error.
640 llvm::Expected<lldb::TypeSystemSP> GetTypeSystemForLanguage(
641 lldb::LanguageType language,
642 std::optional<CreateCallback> create_callback = std::nullopt);
643 };
644
645 } // namespace lldb_private
646
647#endif // LLDB_SYMBOL_TYPESYSTEM_H
A section + offset based address class.
Definition Address.h:62
Represents a generic declaration context in a program.
Represents a generic declaration such as a function declaration.
Generic representation of a type in a programming language.
A uniqued constant string class.
Definition ConstString.h:40
An data extractor class.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Encapsulates a function that can be called.
A class that describes an executable image and its associated object and symbol files.
Definition Module.h:91
A stream class that can stream formatted output to a file.
Definition Stream.h:28
Provides public interface for all SymbolFiles.
Definition SymbolFile.h:51
llvm::DenseMap< uint16_t, lldb::TypeSystemSP > collection
Definition TypeSystem.h:620
std::mutex m_mutex
A mutex to keep this object happy in multi-threaded environments.
Definition TypeSystem.h:621
bool GetHasForcefullyCompletedTypes() const
Check all type systems in the map to see if any have forcefully completed types;.
llvm::function_ref< lldb::TypeSystemSP()> CreateCallback
Definition TypeSystem.h:627
llvm::Expected< lldb::TypeSystemSP > GetTypeSystemForLanguage(lldb::LanguageType language, Module *module, bool can_create)
void ForEach(std::function< bool(lldb::TypeSystemSP)> const &callback)
std::atomic< SymbolFile * > m_sym_file
Definition TypeSystem.h:592
virtual CompilerType GetFullyUnqualifiedType(lldb::opaque_compiler_type_t type)=0
virtual PersistentExpressionState * GetPersistentExpressionState()
Definition TypeSystem.h:538
virtual CompilerType GetFunctionReturnType(lldb::opaque_compiler_type_t type)=0
virtual std::unique_ptr< UtilityFunction > CreateUtilityFunction(std::string text, std::string name)
virtual void Finalize()
Free up any resources associated with this TypeSystem.
Definition TypeSystem.h:89
virtual bool IsMeaninglessWithoutDynamicResolution(void *type)
virtual size_t GetNumTemplateArguments(lldb::opaque_compiler_type_t type, bool expand_pack)
virtual bool IsEnumerationType(lldb::opaque_compiler_type_t type, bool &is_signed)
Definition TypeSystem.h:187
virtual bool GetPtrAuthAddressDiversity(lldb::opaque_compiler_type_t type)=0
virtual PDBASTParser * GetPDBParser()
Definition TypeSystem.h:93
virtual CompilerType GetBuiltinTypeByName(ConstString name)
virtual bool GetCompleteType(lldb::opaque_compiler_type_t type)=0
virtual bool IsBeingDefined(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetTypeTemplateArgument(lldb::opaque_compiler_type_t type, size_t idx, bool expand_pack)
SymbolFile * GetSymbolFile() const
Definition TypeSystem.h:562
virtual CompilerType GetTypeForFormatters(void *type)
virtual unsigned GetPtrAuthDiscriminator(lldb::opaque_compiler_type_t type)=0
virtual bool IsVectorType(lldb::opaque_compiler_type_t type, CompilerType *element_type, uint64_t *size)=0
virtual CompilerType AddRestrictModifier(lldb::opaque_compiler_type_t type)
virtual CompilerType GetAtomicType(lldb::opaque_compiler_type_t type)
virtual lldb::Format GetFormat(lldb::opaque_compiler_type_t type)=0
virtual bool IsMemberDataPointerType(lldb::opaque_compiler_type_t type)=0
virtual ConstString GetMangledTypeName(lldb::opaque_compiler_type_t type)
Defaults to GetTypeName(type).
virtual CompilerType GetLValueReferenceType(lldb::opaque_compiler_type_t type)
virtual std::vector< CompilerDecl > DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString name, const bool ignore_imported_decls)
virtual void ForEachEnumerator(lldb::opaque_compiler_type_t type, std::function< bool(const CompilerType &integer_type, ConstString name, const llvm::APSInt &value)> const &callback)
Definition TypeSystem.h:341
virtual unsigned GetPtrAuthKey(lldb::opaque_compiler_type_t type)=0
virtual uint32_t GetPointerByteSize()=0
virtual ConstString DeclGetName(void *opaque_decl)=0
virtual llvm::Expected< uint64_t > GetBitSize(lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope)=0
virtual bool IsAggregateType(lldb::opaque_compiler_type_t type)=0
virtual bool IsDefined(lldb::opaque_compiler_type_t type)=0
virtual std::optional< size_t > GetTypeBitAlign(lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope)=0
virtual ConstString GetTypeName(lldb::opaque_compiler_type_t type, bool BaseOnly)=0
virtual bool DeclContextIsClassMethod(void *opaque_decl_ctx)=0
virtual bool IsPromotableIntegerType(lldb::opaque_compiler_type_t type)
virtual std::optional< llvm::json::Value > ReportStatistics()
virtual CompilerType CreateTypedef(lldb::opaque_compiler_type_t type, const char *name, const CompilerDeclContext &decl_ctx, uint32_t opaque_payload)
virtual void DumpTypeDescription(lldb::opaque_compiler_type_t type, Stream &s, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull)=0
Print a description of the type to a stream.
virtual bool IsCompleteType(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetPointerDiffType(bool is_signed)=0
virtual Scalar DeclGetConstantValue(void *opaque_decl)
Definition TypeSystem.h:113
virtual bool IsFunctionType(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetFunctionArgumentAtIndex(lldb::opaque_compiler_type_t type, const size_t index)=0
virtual CompilerType GetNonReferenceType(lldb::opaque_compiler_type_t type)=0
virtual FunctionCaller * GetFunctionCaller(const CompilerType &return_type, const Address &function_address, const ValueList &arg_value_list, const char *name)
Definition TypeSystem.h:528
virtual LazyBool ShouldPrintAsOneLiner(void *type, ValueObject *valobj)
virtual size_t GetIndexOfChildMemberWithName(lldb::opaque_compiler_type_t type, llvm::StringRef name, bool omit_empty_base_classes, std::vector< uint32_t > &child_indexes)=0
virtual bool IsTypedefType(lldb::opaque_compiler_type_t type)=0
virtual bool IsBlockPointerType(lldb::opaque_compiler_type_t type, CompilerType *function_pointer_type_ptr)=0
virtual bool IsIntegerType(lldb::opaque_compiler_type_t type, bool &is_signed)=0
virtual lldb::LanguageType GetMinimumLanguage(lldb::opaque_compiler_type_t type)=0
virtual CompilerType AddConstModifier(lldb::opaque_compiler_type_t type)
bool m_has_forcefully_completed_types
Used for reporting statistics.
Definition TypeSystem.h:589
virtual lldb::Encoding GetEncoding(lldb::opaque_compiler_type_t type)=0
virtual npdb::PdbAstBuilder * GetNativePDBParser()
Definition TypeSystem.h:94
void SetSymbolFile(SymbolFile *sym_file)
Bind this TypeSystem to its owning SymbolFile.
Definition TypeSystem.h:575
virtual CompilerType GetTypedefedType(lldb::opaque_compiler_type_t type)=0
virtual const llvm::fltSemantics & GetFloatTypeSemantics(size_t byte_size, lldb::Format format)=0
virtual uint32_t GetTypeInfo(lldb::opaque_compiler_type_t type, CompilerType *pointee_or_element_compiler_type)=0
virtual bool IsPointerOrReferenceType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type)=0
virtual CompilerType AddPtrAuthModifier(lldb::opaque_compiler_type_t type, uint32_t payload)
virtual uint32_t GetNumVirtualBaseClasses(lldb::opaque_compiler_type_t type)=0
virtual CompilerDecl GetStaticFieldWithName(lldb::opaque_compiler_type_t type, llvm::StringRef name)
Definition TypeSystem.h:369
virtual CompilerType DeclGetFunctionReturnType(void *opaque_decl)
virtual CompilerType GetDirectNestedTypeWithName(lldb::opaque_compiler_type_t type, llvm::StringRef name)
Definition TypeSystem.h:401
virtual lldb::TypeClass GetTypeClass(lldb::opaque_compiler_type_t type)=0
virtual bool DeclContextIsContainedInLookup(void *opaque_decl_ctx, void *other_opaque_decl_ctx)=0
virtual bool HasPointerAuthQualifier(lldb::opaque_compiler_type_t type)
Definition TypeSystem.h:206
virtual LLVM_DUMP_METHOD void dump(lldb::opaque_compiler_type_t type) const =0
Convenience LLVM-style dump method for use in the debugger only.
virtual bool IsFunctionPointerType(lldb::opaque_compiler_type_t type)=0
virtual bool IsCharType(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetTypeForDecl(void *opaque_decl)=0
virtual CompilerType DeclGetFunctionArgumentType(void *opaque_decl, size_t arg_idx)
virtual bool IsMemberFunctionPointerType(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetRValueReferenceType(lldb::opaque_compiler_type_t type)
virtual std::vector< lldb_private::CompilerContext > DeclGetCompilerContext(void *opaque_decl)
virtual bool IsReferenceType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type, bool *is_rvalue)=0
virtual UserExpression * GetUserExpression(llvm::StringRef expr, llvm::StringRef prefix, SourceLanguage language, Expression::ResultType desired_type, const EvaluateExpressionOptions &options, ValueObject *ctx_obj)
Definition TypeSystem.h:521
virtual std::vector< lldb_private::CompilerContext > DeclContextGetCompilerContext(void *opaque_decl_ctx)
virtual lldb::LanguageType DeclContextGetLanguage(void *opaque_decl_ctx)=0
virtual bool IsScopedEnumerationType(lldb::opaque_compiler_type_t type)=0
bool GetHasForcefullyCompletedTypes() const
Definition TypeSystem.h:583
virtual bool IsAnonymousType(lldb::opaque_compiler_type_t type)
virtual bool IsPointerType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type)=0
virtual ConstString DeclContextGetName(void *opaque_decl_ctx)=0
virtual ConstString DeclGetMangledName(void *opaque_decl)
virtual bool IsVoidType(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetArrayType(lldb::opaque_compiler_type_t type, uint64_t size)
virtual bool IsConst(lldb::opaque_compiler_type_t type)=0
virtual llvm::Expected< CompilerType > GetChildCompilerTypeAtIndex(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers, bool omit_empty_base_classes, bool ignore_array_bounds, std::string &child_name, uint32_t &child_byte_size, int32_t &child_byte_offset, uint32_t &child_bitfield_bit_size, uint32_t &child_bitfield_bit_offset, bool &child_is_base_class, bool &child_is_deref_of_parent, ValueObject *valobj, uint64_t &language_flags)=0
virtual void Dump(llvm::raw_ostream &output, llvm::StringRef filter, bool show_color)=0
Dump a textual representation of the internal TypeSystem state to the given stream.
virtual void DumpTypeDescription(lldb::opaque_compiler_type_t type, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull)=0
Dump the type to stdout.
static bool SupportsLanguageStatic(lldb::LanguageType language)
virtual CompilerDeclContext GetCompilerDeclContextForType(const CompilerType &type)
Returns the direct parent context of specified type.
virtual ConstString DeclContextGetScopeQualifiedName(void *opaque_decl_ctx)=0
virtual CompilerType GetFieldAtIndex(lldb::opaque_compiler_type_t type, size_t idx, std::string &name, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr)=0
virtual CompilerType CreateGenericFunctionPrototype()
Definition TypeSystem.h:482
virtual CompilerType GetDirectBaseClassAtIndex(lldb::opaque_compiler_type_t type, size_t idx, uint32_t *bit_offset_ptr)=0
virtual llvm::Expected< CompilerType > GetDereferencedType(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, std::string &deref_name, uint32_t &deref_byte_size, int32_t &deref_byte_offset, ValueObject *valobj, uint64_t &language_flags)=0
virtual CompilerType GetPromotedIntegerType(lldb::opaque_compiler_type_t type)
virtual bool CanPassInRegisters(const CompilerType &type)=0
virtual CompilerType GetPointeeType(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetVirtualBaseClassAtIndex(lldb::opaque_compiler_type_t type, size_t idx, uint32_t *bit_offset_ptr)=0
virtual size_t GetNumberOfFunctionArguments(lldb::opaque_compiler_type_t type)=0
virtual bool SupportsLanguage(lldb::LanguageType language)=0
virtual CompilerType GetArrayElementType(lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope)=0
virtual bool IsPolymorphicClass(lldb::opaque_compiler_type_t type)=0
virtual uint32_t IsHomogeneousAggregate(lldb::opaque_compiler_type_t type, CompilerType *base_type_ptr)=0
virtual std::optional< CompilerType::IntegralTemplateArgument > GetIntegralTemplateArgument(lldb::opaque_compiler_type_t type, size_t idx, bool expand_pack)
virtual bool Verify(lldb::opaque_compiler_type_t type)=0
Verify the integrity of the type to catch CompilerTypes that mix and match invalid TypeSystem/Opaque ...
virtual unsigned GetTypeQualifiers(lldb::opaque_compiler_type_t type)=0
virtual llvm::Expected< uint32_t > GetNumChildren(lldb::opaque_compiler_type_t type, bool omit_empty_base_classes, const ExecutionContext *exe_ctx)=0
virtual llvm::Expected< uint32_t > GetIndexOfChildWithName(lldb::opaque_compiler_type_t type, llvm::StringRef name, bool omit_empty_base_classes)=0
virtual lldb::BasicType GetBasicTypeEnumeration(lldb::opaque_compiler_type_t type)=0
virtual plugin::dwarf::DWARFASTParser * GetDWARFParser()
Definition TypeSystem.h:91
virtual CompilerType GetCanonicalType(lldb::opaque_compiler_type_t type)=0
virtual ConstString GetDisplayTypeName(lldb::opaque_compiler_type_t type)=0
virtual int GetFunctionArgumentCount(lldb::opaque_compiler_type_t type)=0
virtual lldb::TemplateArgumentKind GetTemplateArgumentKind(lldb::opaque_compiler_type_t type, size_t idx, bool expand_pack)
virtual bool IsRuntimeGeneratedType(lldb::opaque_compiler_type_t type)=0
This is used by swift.
virtual CompilerType GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size)=0
virtual bool ShouldTreatScalarValueAsAddress(lldb::opaque_compiler_type_t type)
Definition TypeSystem.h:517
virtual bool IsFloatingPointType(lldb::opaque_compiler_type_t type)=0
virtual bool DumpTypeValue(lldb::opaque_compiler_type_t type, Stream &s, lldb::Format format, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, ExecutionContextScope *exe_scope)=0
static lldb::TypeSystemSP CreateInstance(lldb::LanguageType language, Module *module)
virtual uint32_t GetNumFields(lldb::opaque_compiler_type_t type)=0
virtual bool IsTemplateType(lldb::opaque_compiler_type_t type)
virtual bool isA(const void *ClassID) const =0
virtual size_t DeclGetFunctionNumArguments(void *opaque_decl)
virtual bool IsForcefullyCompleted(lldb::opaque_compiler_type_t type)
Definition TypeSystem.h:220
virtual CompilerType GetPointerType(lldb::opaque_compiler_type_t type)=0
virtual bool IsPossibleDynamicType(lldb::opaque_compiler_type_t type, CompilerType *target_type, bool check_cplusplus, bool check_objc)=0
virtual CompilerDeclContext DeclGetDeclContext(void *opaque_decl)
virtual size_t GetNumMemberFunctions(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type)=0
virtual uint32_t GetNumDirectBaseClasses(lldb::opaque_compiler_type_t type)=0
virtual CompilerType AddVolatileModifier(lldb::opaque_compiler_type_t type)
virtual bool IsScalarType(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetEnumerationIntegerType(lldb::opaque_compiler_type_t type)=0
virtual bool IsArrayType(lldb::opaque_compiler_type_t type, CompilerType *element_type, uint64_t *size, bool *is_incomplete)=0
virtual TypeMemberFunctionImpl GetMemberFunctionAtIndex(lldb::opaque_compiler_type_t type, size_t idx)=0
virtual CompilerType GetSizeType()=0
virtual CompilerType GetFunctionArgumentTypeAtIndex(lldb::opaque_compiler_type_t type, size_t idx)=0
Encapsulates a one-time expression for use in lldb.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::TypeSystem > TypeSystemSP
void * opaque_compiler_type_t
Definition lldb-types.h:91
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eDescriptionLevelFull
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
Format
Display format definitions.
uint64_t offset_t
Definition lldb-types.h:86
LanguageType
Programming language type.
Encoding
Register encoding definitions.
A type-erased pair of llvm::dwarf::SourceLanguageName and version.