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 <functional>
13#include <mutex>
14#include <optional>
15#include <string>
16
17#include "llvm/ADT/APFloat.h"
18#include "llvm/ADT/APSInt.h"
19#include "llvm/ADT/DenseMap.h"
20#include "llvm/ADT/SmallBitVector.h"
21#include "llvm/Support/Casting.h"
22#include "llvm/Support/Error.h"
23#include "llvm/Support/JSON.h"
24
29#include "lldb/Symbol/Type.h"
30#include "lldb/lldb-private.h"
31
32class PDBASTParser;
33
34namespace lldb_private {
35
36namespace plugin {
37namespace dwarf {
38class DWARFDIE;
39class DWARFASTParser;
40} // namespace dwarf
41} // namespace plugin
42
43namespace npdb {
44 class PdbAstBuilder;
45} // namespace npdb
46
47/// Interface for representing a type system.
48///
49/// Implemented by language plugins to define the type system for a given
50/// language.
51///
52/// This interface extensively used opaque pointers to prevent that generic
53/// LLDB code has dependencies on language plugins. The type and semantics of
54/// these opaque pointers are defined by the TypeSystem implementation inside
55/// the respective language plugin. Opaque pointers from one TypeSystem
56/// instance should never be passed to a different TypeSystem instance (even
57/// when the language plugin for both TypeSystem instances is the same).
58///
59/// Most of the functions in this class should not be called directly but only
60/// called by their respective counterparts in CompilerType, CompilerDecl and
61/// CompilerDeclContext.
62///
63/// \see lldb_private::CompilerType
64/// \see lldb_private::CompilerDecl
65/// \see lldb_private::CompilerDeclContext
67 public std::enable_shared_from_this<TypeSystem> {
68public:
69 // Constructors and Destructors
71 ~TypeSystem() override;
72
73 // LLVM RTTI support
74 virtual bool isA(const void *ClassID) const = 0;
75
77 Module *module);
78
80 Target *target);
81
82 /// Free up any resources associated with this TypeSystem. Done before
83 /// removing all the TypeSystems from the TypeSystemMap.
84 virtual void Finalize() {}
85
86 virtual plugin::dwarf::DWARFASTParser *GetDWARFParser() { return nullptr; }
87
88 virtual PDBASTParser *GetPDBParser() { return nullptr; }
89 virtual npdb::PdbAstBuilder *GetNativePDBParser() { return nullptr; }
90
91 virtual SymbolFile *GetSymbolFile() const { return m_sym_file; }
92
93 virtual void SetSymbolFile(SymbolFile *sym_file) { m_sym_file = sym_file; }
94
95 // CompilerDecl functions
96 virtual ConstString DeclGetName(void *opaque_decl) = 0;
97
98 virtual ConstString DeclGetMangledName(void *opaque_decl);
99
100 virtual CompilerDeclContext DeclGetDeclContext(void *opaque_decl);
101
102 virtual CompilerType DeclGetFunctionReturnType(void *opaque_decl);
103
104 virtual size_t DeclGetFunctionNumArguments(void *opaque_decl);
105
106 virtual CompilerType DeclGetFunctionArgumentType(void *opaque_decl,
107 size_t arg_idx);
108
109 virtual std::vector<lldb_private::CompilerContext>
110 DeclGetCompilerContext(void *opaque_decl);
111
112 virtual CompilerType GetTypeForDecl(void *opaque_decl) = 0;
113
114 // CompilerDeclContext functions
115
116 virtual std::vector<CompilerDecl>
117 DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString name,
118 const bool ignore_imported_decls);
119
120 virtual ConstString DeclContextGetName(void *opaque_decl_ctx) = 0;
121
122 virtual ConstString
123 DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) = 0;
124
125 virtual bool DeclContextIsClassMethod(void *opaque_decl_ctx) = 0;
126
127 virtual bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,
128 void *other_opaque_decl_ctx) = 0;
129
130 virtual lldb::LanguageType DeclContextGetLanguage(void *opaque_decl_ctx) = 0;
131
132 /// Returns the direct parent context of specified type
133 virtual CompilerDeclContext
135
136 virtual std::vector<lldb_private::CompilerContext>
137 DeclContextGetCompilerContext(void *opaque_decl_ctx);
138
139 // Tests
140#ifndef NDEBUG
141 /// Verify the integrity of the type to catch CompilerTypes that mix
142 /// and match invalid TypeSystem/Opaque type pairs.
143 virtual bool Verify(lldb::opaque_compiler_type_t type) = 0;
144#endif
145
147 CompilerType *element_type, uint64_t *size,
148 bool *is_incomplete) = 0;
149
151
153
155
157
159
161 uint32_t &count, bool &is_complex) = 0;
162
164
165 virtual size_t
167
168 virtual CompilerType
170 const size_t index) = 0;
171
173
174 virtual bool
176
178 CompilerType *function_pointer_type_ptr) = 0;
179
181 bool &is_signed) = 0;
182
184 bool &is_signed) {
185 is_signed = false;
186 return false;
187 }
188
190
192 CompilerType *target_type, // Can pass NULL
193 bool check_cplusplus, bool check_objc) = 0;
194
196 CompilerType *pointee_type) = 0;
197
199
201
202 virtual bool CanPassInRegisters(const CompilerType &type) = 0;
203
204 // TypeSystems can support more than one language
205 virtual bool SupportsLanguage(lldb::LanguageType language) = 0;
206
207 // Type Completion
208
210
212 return false;
213 }
214
215 // AST related queries
216
217 virtual uint32_t GetPointerByteSize() = 0;
218
219 // Accessors
220
222 bool BaseOnly) = 0;
223
225
226 virtual uint32_t
228 CompilerType *pointee_or_element_compiler_type) = 0;
229
230 virtual lldb::LanguageType
232
233 virtual lldb::TypeClass GetTypeClass(lldb::opaque_compiler_type_t type) = 0;
234
235 // Creating related types
236
237 virtual CompilerType
239 ExecutionContextScope *exe_scope) = 0;
240
242 uint64_t size);
243
245
246 virtual CompilerType
248
249 // Returns -1 if this isn't a function of if the function doesn't have a
250 // prototype Returns a value >= 0 if there is a prototype.
252
253 virtual CompilerType
255 size_t idx) = 0;
256
257 virtual CompilerType
259
261
264
266
268
269 virtual CompilerType
271
272 virtual CompilerType
274
276
278
280
282
283 /// \param opaque_payload The m_payload field of Type, which may
284 /// carry TypeSystem-specific extra information.
286 const char *name,
287 const CompilerDeclContext &decl_ctx,
288 uint32_t opaque_payload);
289
290 // Exploring the type
291
292 virtual const llvm::fltSemantics &GetFloatTypeSemantics(size_t byte_size) = 0;
293
294 virtual std::optional<uint64_t>
296 ExecutionContextScope *exe_scope) = 0;
297
299 uint64_t &count) = 0;
300
302
303 virtual llvm::Expected<uint32_t>
305 bool omit_empty_base_classes,
306 const ExecutionContext *exe_ctx) = 0;
307
309
310 virtual lldb::BasicType
312
313 virtual void ForEachEnumerator(
315 std::function<bool(const CompilerType &integer_type,
316 ConstString name,
317 const llvm::APSInt &value)> const &callback) {}
318
319 virtual uint32_t GetNumFields(lldb::opaque_compiler_type_t type) = 0;
320
322 size_t idx, std::string &name,
323 uint64_t *bit_offset_ptr,
324 uint32_t *bitfield_bit_size_ptr,
325 bool *is_bitfield_ptr) = 0;
326
327 virtual uint32_t
329
330 virtual uint32_t
332
333 virtual CompilerType
335 uint32_t *bit_offset_ptr) = 0;
336
337 virtual CompilerType
339 uint32_t *bit_offset_ptr) = 0;
340
342 lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, size_t idx,
343 bool transparent_pointers, bool omit_empty_base_classes,
344 bool ignore_array_bounds, std::string &child_name,
345 uint32_t &child_byte_size, int32_t &child_byte_offset,
346 uint32_t &child_bitfield_bit_size, uint32_t &child_bitfield_bit_offset,
347 bool &child_is_base_class, bool &child_is_deref_of_parent,
348 ValueObject *valobj, uint64_t &language_flags) = 0;
349
350 // Lookup a child given a name. This function will match base class names and
351 // member member names in "clang_type" only, not descendants.
353 llvm::StringRef name,
354 bool omit_empty_base_classes) = 0;
355
356 // Lookup a child member given a name. This function will match member names
357 // only and will descend into "clang_type" children in search for the first
358 // member in this class, or any base class that matches "name".
359 // TODO: Return all matches for a given name by returning a
360 // vector<vector<uint32_t>>
361 // so we catch all names that match a given child name, not just the first.
363 lldb::opaque_compiler_type_t type, llvm::StringRef name,
364 bool omit_empty_base_classes, std::vector<uint32_t> &child_indexes) = 0;
365
367
369 bool expand_pack);
370
373 bool expand_pack);
374 virtual CompilerType
376 bool expand_pack);
377 virtual std::optional<CompilerType::IntegralTemplateArgument>
379 bool expand_pack);
380
381 // Dumping types
382
383#ifndef NDEBUG
384 /// Convenience LLVM-style dump method for use in the debugger only.
385 LLVM_DUMP_METHOD virtual void
387#endif
388
390 lldb::Format format, const DataExtractor &data,
391 lldb::offset_t data_offset, size_t data_byte_size,
392 uint32_t bitfield_bit_size,
393 uint32_t bitfield_bit_offset,
394 ExecutionContextScope *exe_scope) = 0;
395
396 /// Dump the type to stdout.
400
401 /// Print a description of the type to a stream. The exact implementation
402 /// varies, but the expectation is that eDescriptionLevelFull returns a
403 /// source-like representation of the type, whereas eDescriptionLevelVerbose
404 /// does a dump of the underlying AST if applicable.
408
409 /// Dump a textual representation of the internal TypeSystem state to the
410 /// given stream.
411 ///
412 /// This should not modify the state of the TypeSystem if possible.
413 virtual void Dump(llvm::raw_ostream &output) = 0;
414
415 /// This is used by swift.
417
418 // TODO: Determine if these methods should move to TypeSystemClang.
419
421 CompilerType *pointee_type) = 0;
422
424
425 virtual std::optional<size_t>
427 ExecutionContextScope *exe_scope) = 0;
428
430
432 return CompilerType();
433 }
434
435 virtual CompilerType
437 size_t bit_size) = 0;
438
440
441 virtual bool IsConst(lldb::opaque_compiler_type_t type) = 0;
442
444 CompilerType *base_type_ptr) = 0;
445
447
449
450 // If the current object represents a typedef type, get the underlying type
452
454 CompilerType *element_type, uint64_t *size) = 0;
455
456 virtual CompilerType
458
459 virtual CompilerType
461
463 CompilerType *pointee_type, bool *is_rvalue) = 0;
464
465 virtual bool
467 return IsPointerOrReferenceType(type, nullptr);
468 }
469
470 virtual UserExpression *
471 GetUserExpression(llvm::StringRef expr, llvm::StringRef prefix,
472 lldb::LanguageType language,
473 Expression::ResultType desired_type,
474 const EvaluateExpressionOptions &options,
475 ValueObject *ctx_obj) {
476 return nullptr;
477 }
478
479 virtual FunctionCaller *GetFunctionCaller(const CompilerType &return_type,
480 const Address &function_address,
481 const ValueList &arg_value_list,
482 const char *name) {
483 return nullptr;
484 }
485
486 virtual std::unique_ptr<UtilityFunction>
487 CreateUtilityFunction(std::string text, std::string name);
488
490 return nullptr;
491 }
492
493 virtual CompilerType GetTypeForFormatters(void *type);
494
495 virtual LazyBool ShouldPrintAsOneLiner(void *type, ValueObject *valobj);
496
497 // Type systems can have types that are placeholder types, which are meant to
498 // indicate the presence of a type, but offer no actual information about
499 // said types, and leave the burden of actually figuring type information out
500 // to dynamic type resolution. For instance a language with a generics
501 // system, can use placeholder types to indicate "type argument goes here",
502 // without promising uniqueness of the placeholder, nor attaching any
503 // actually idenfiable information to said placeholder. This API allows type
504 // systems to tell LLDB when such a type has been encountered In response,
505 // the debugger can react by not using this type as a cache entry in any
506 // type-specific way For instance, LLDB will currently not cache any
507 // formatters that are discovered on such a type as attributable to the
508 // meaningless type itself, instead preferring to use the dynamic type
509 virtual bool IsMeaninglessWithoutDynamicResolution(void *type);
510
511 virtual std::optional<llvm::json::Value> ReportStatistics();
512
515 }
516protected:
518 /// Used for reporting statistics.
520};
521
523public:
526
527 // Clear calls Finalize on all the TypeSystems managed by this map, and then
528 // empties the map.
529 void Clear();
530
531 // Iterate through all of the type systems that are created. Return true from
532 // callback to keep iterating, false to stop iterating.
533 void ForEach(std::function<bool(lldb::TypeSystemSP)> const &callback);
534
535 llvm::Expected<lldb::TypeSystemSP>
537 bool can_create);
538
539 llvm::Expected<lldb::TypeSystemSP>
541 bool can_create);
542
543 /// Check all type systems in the map to see if any have forcefully completed
544 /// types;
546protected:
547 typedef llvm::DenseMap<uint16_t, lldb::TypeSystemSP> collection;
548 mutable std::mutex m_mutex; ///< A mutex to keep this object happy in
549 /// multi-threaded environments.
552
553private:
554 typedef llvm::function_ref<lldb::TypeSystemSP()> CreateCallback;
555 /// Finds the type system for the given language. If no type system could be
556 /// found for a language and a CreateCallback was provided, the value
557 /// returned by the callback will be treated as the TypeSystem for the
558 /// language.
559 ///
560 /// \param language The language for which the type system should be found.
561 /// \param create_callback A callback that will be called if no previously
562 /// created TypeSystem that fits the given language
563 /// could found. Can be omitted if a non-existent
564 /// type system should be treated as an error
565 /// instead.
566 /// \return The found type system or an error.
567 llvm::Expected<lldb::TypeSystemSP> GetTypeSystemForLanguage(
568 lldb::LanguageType language,
569 std::optional<CreateCallback> create_callback = std::nullopt);
570 };
571
572 } // namespace lldb_private
573
574#endif // LLDB_SYMBOL_TYPESYSTEM_H
A section + offset based address class.
Definition: Address.h:62
Represents a generic declaration context in a program.
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
A uniqued constant string class.
Definition: ConstString.h:40
An data extractor class.
Definition: DataExtractor.h:48
"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:88
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:50
llvm::DenseMap< uint16_t, lldb::TypeSystemSP > collection
Definition: TypeSystem.h:547
std::mutex m_mutex
A mutex to keep this object happy in multi-threaded environments.
Definition: TypeSystem.h:548
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:554
llvm::Expected< lldb::TypeSystemSP > GetTypeSystemForLanguage(lldb::LanguageType language, Module *module, bool can_create)
Definition: TypeSystem.cpp:317
void ForEach(std::function< bool(lldb::TypeSystemSP)> const &callback)
Definition: TypeSystem.cpp:233
Interface for representing a type system.
Definition: TypeSystem.h:67
virtual CompilerType GetFullyUnqualifiedType(lldb::opaque_compiler_type_t type)=0
virtual PersistentExpressionState * GetPersistentExpressionState()
Definition: TypeSystem.h:489
virtual CompilerType GetFunctionReturnType(lldb::opaque_compiler_type_t type)=0
virtual std::unique_ptr< UtilityFunction > CreateUtilityFunction(std::string text, std::string name)
Definition: TypeSystem.cpp:191
virtual void Finalize()
Free up any resources associated with this TypeSystem.
Definition: TypeSystem.h:84
virtual bool IsMeaninglessWithoutDynamicResolution(void *type)
Definition: TypeSystem.cpp:151
virtual size_t GetNumTemplateArguments(lldb::opaque_compiler_type_t type, bool expand_pack)
Definition: TypeSystem.cpp:125
virtual bool IsEnumerationType(lldb::opaque_compiler_type_t type, bool &is_signed)
Definition: TypeSystem.h:183
virtual PDBASTParser * GetPDBParser()
Definition: TypeSystem.h:88
virtual CompilerType GetBuiltinTypeByName(ConstString name)
Definition: TypeSystem.cpp:113
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)
Definition: TypeSystem.cpp:136
virtual 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 CompilerType GetTypeForFormatters(void *type)
Definition: TypeSystem.cpp:117
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)
Definition: TypeSystem.cpp:102
virtual CompilerType GetAtomicType(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:88
virtual lldb::Format GetFormat(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetLValueReferenceType(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:79
virtual std::vector< CompilerDecl > DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString name, const bool ignore_imported_decls)
Definition: TypeSystem.cpp:185
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:313
virtual uint32_t GetPointerByteSize()=0
virtual ConstString DeclGetName(void *opaque_decl)=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 uint32_t GetIndexOfChildWithName(lldb::opaque_compiler_type_t type, llvm::StringRef name, bool omit_empty_base_classes)=0
virtual bool DeclContextIsClassMethod(void *opaque_decl_ctx)=0
virtual std::optional< llvm::json::Value > ReportStatistics()
Definition: TypeSystem.cpp:195
virtual CompilerType CreateTypedef(lldb::opaque_compiler_type_t type, const char *name, const CompilerDeclContext &decl_ctx, uint32_t opaque_payload)
Definition: TypeSystem.cpp:106
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 bool IsFunctionType(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetFunctionArgumentAtIndex(lldb::opaque_compiler_type_t type, const size_t index)=0
virtual const llvm::fltSemantics & GetFloatTypeSemantics(size_t byte_size)=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:479
virtual std::optional< uint64_t > GetBitSize(lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope)=0
virtual LazyBool ShouldPrintAsOneLiner(void *type, ValueObject *valobj)
Definition: TypeSystem.cpp:147
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 SymbolFile * GetSymbolFile() const
Definition: TypeSystem.h:91
virtual CompilerType AddConstModifier(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:92
bool m_has_forcefully_completed_types
Used for reporting statistics.
Definition: TypeSystem.h:519
virtual npdb::PdbAstBuilder * GetNativePDBParser()
Definition: TypeSystem.h:89
SymbolFile * m_sym_file
Definition: TypeSystem.h:517
virtual CompilerType GetTypedefedType(lldb::opaque_compiler_type_t type)=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 uint32_t GetNumVirtualBaseClasses(lldb::opaque_compiler_type_t type)=0
virtual CompilerType DeclGetFunctionReturnType(void *opaque_decl)
Definition: TypeSystem.cpp:163
virtual lldb::Encoding GetEncoding(lldb::opaque_compiler_type_t type, uint64_t &count)=0
virtual bool IsFloatingPointType(lldb::opaque_compiler_type_t type, uint32_t &count, bool &is_complex)=0
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 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)
Definition: TypeSystem.cpp:169
virtual void SetSymbolFile(SymbolFile *sym_file)
Definition: TypeSystem.h:93
virtual bool IsMemberFunctionPointerType(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetRValueReferenceType(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:84
virtual std::vector< lldb_private::CompilerContext > DeclGetCompilerContext(void *opaque_decl)
Definition: TypeSystem.cpp:175
virtual bool IsReferenceType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type, bool *is_rvalue)=0
virtual std::vector< lldb_private::CompilerContext > DeclContextGetCompilerContext(void *opaque_decl_ctx)
Definition: TypeSystem.cpp:180
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:513
virtual bool IsAnonymousType(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:69
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)
Definition: TypeSystem.cpp:155
virtual bool IsVoidType(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetArrayType(lldb::opaque_compiler_type_t type, uint64_t size)
Definition: TypeSystem.cpp:73
virtual bool IsConst(lldb::opaque_compiler_type_t type)=0
virtual UserExpression * GetUserExpression(llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language, Expression::ResultType desired_type, const EvaluateExpressionOptions &options, ValueObject *ctx_obj)
Definition: TypeSystem.h:471
virtual void DumpTypeDescription(lldb::opaque_compiler_type_t type, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull)=0
Dump the type to stdout.
virtual CompilerDeclContext GetCompilerDeclContextForType(const CompilerType &type)
Returns the direct parent context of specified type.
Definition: TypeSystem.cpp:200
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:431
virtual CompilerType GetDirectBaseClassAtIndex(lldb::opaque_compiler_type_t type, size_t idx, uint32_t *bit_offset_ptr)=0
virtual void Dump(llvm::raw_ostream &output)=0
Dump a textual representation of the internal TypeSystem state to the given stream.
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)
Definition: TypeSystem.cpp:142
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 ...
Definition: TypeSystem.cpp:66
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 lldb::BasicType GetBasicTypeEnumeration(lldb::opaque_compiler_type_t type)=0
virtual plugin::dwarf::DWARFASTParser * GetDWARFParser()
Definition: TypeSystem.h:86
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)
Definition: TypeSystem.cpp:131
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:466
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)
Definition: TypeSystem.cpp:55
virtual uint32_t GetNumFields(lldb::opaque_compiler_type_t type)=0
virtual bool IsTemplateType(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:121
virtual bool isA(const void *ClassID) const =0
virtual size_t DeclGetFunctionNumArguments(void *opaque_decl)
Definition: TypeSystem.cpp:167
virtual bool IsForcefullyCompleted(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.h:211
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)
Definition: TypeSystem.cpp:159
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)
Definition: TypeSystem.cpp:97
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 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.
Definition: SBAttachInfo.h:14
std::shared_ptr< lldb_private::TypeSystem > TypeSystemSP
Definition: lldb-forward.h:457
void * opaque_compiler_type_t
Definition: lldb-types.h:87
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:83
LanguageType
Programming language type.
Encoding
Register encoding definitions.