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/Utility/Scalar.h"
31#include "lldb/lldb-forward.h"
32#include "lldb/lldb-private.h"
33#include "lldb/lldb-types.h"
34
35class PDBASTParser;
36
37namespace lldb_private {
38
39namespace plugin {
40namespace dwarf {
41class DWARFDIE;
42class DWARFASTParser;
43} // namespace dwarf
44} // namespace plugin
45
46namespace npdb {
47 class PdbAstBuilder;
48} // namespace npdb
49
50/// Interface for representing a type system.
51///
52/// Implemented by language plugins to define the type system for a given
53/// language.
54///
55/// This interface extensively used opaque pointers to prevent that generic
56/// LLDB code has dependencies on language plugins. The type and semantics of
57/// these opaque pointers are defined by the TypeSystem implementation inside
58/// the respective language plugin. Opaque pointers from one TypeSystem
59/// instance should never be passed to a different TypeSystem instance (even
60/// when the language plugin for both TypeSystem instances is the same).
61///
62/// Most of the functions in this class should not be called directly but only
63/// called by their respective counterparts in CompilerType, CompilerDecl and
64/// CompilerDeclContext.
65///
66/// \see lldb_private::CompilerType
67/// \see lldb_private::CompilerDecl
68/// \see lldb_private::CompilerDeclContext
70 public std::enable_shared_from_this<TypeSystem> {
71public:
72 // Constructors and Destructors
74 ~TypeSystem() override;
75
76 // LLVM RTTI support
77 virtual bool isA(const void *ClassID) const = 0;
78
80 Module *module);
81
83 Target *target);
84
85 /// Free up any resources associated with this TypeSystem. Done before
86 /// removing all the TypeSystems from the TypeSystemMap.
87 virtual void Finalize() {}
88
89 virtual plugin::dwarf::DWARFASTParser *GetDWARFParser() { return nullptr; }
90
91 virtual PDBASTParser *GetPDBParser() { return nullptr; }
92 virtual npdb::PdbAstBuilder *GetNativePDBParser() { return nullptr; }
93
94 virtual SymbolFile *GetSymbolFile() const { return m_sym_file; }
95
96 virtual void SetSymbolFile(SymbolFile *sym_file) { m_sym_file = sym_file; }
97
98 // CompilerDecl functions
99 virtual ConstString DeclGetName(void *opaque_decl) = 0;
100
101 virtual ConstString DeclGetMangledName(void *opaque_decl);
102
103 virtual CompilerDeclContext DeclGetDeclContext(void *opaque_decl);
104
105 virtual CompilerType DeclGetFunctionReturnType(void *opaque_decl);
106
107 virtual size_t DeclGetFunctionNumArguments(void *opaque_decl);
108
109 virtual CompilerType DeclGetFunctionArgumentType(void *opaque_decl,
110 size_t arg_idx);
111
112 virtual std::vector<lldb_private::CompilerContext>
113 DeclGetCompilerContext(void *opaque_decl);
114
115 virtual Scalar DeclGetConstantValue(void *opaque_decl) { return Scalar(); }
116
117 virtual CompilerType GetTypeForDecl(void *opaque_decl) = 0;
118
119 // CompilerDeclContext functions
120
121 virtual std::vector<CompilerDecl>
122 DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString name,
123 const bool ignore_imported_decls);
124
125 virtual ConstString DeclContextGetName(void *opaque_decl_ctx) = 0;
126
127 virtual ConstString
128 DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) = 0;
129
130 virtual bool DeclContextIsClassMethod(void *opaque_decl_ctx) = 0;
131
132 virtual bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,
133 void *other_opaque_decl_ctx) = 0;
134
135 virtual lldb::LanguageType DeclContextGetLanguage(void *opaque_decl_ctx) = 0;
136
137 /// Returns the direct parent context of specified type
138 virtual CompilerDeclContext
140
141 virtual std::vector<lldb_private::CompilerContext>
142 DeclContextGetCompilerContext(void *opaque_decl_ctx);
143
144 // Tests
145#ifndef NDEBUG
146 /// Verify the integrity of the type to catch CompilerTypes that mix
147 /// and match invalid TypeSystem/Opaque type pairs.
148 virtual bool Verify(lldb::opaque_compiler_type_t type) = 0;
149#endif
150
152 CompilerType *element_type, uint64_t *size,
153 bool *is_incomplete) = 0;
154
156
158
160
162
164
166
168
169 virtual size_t
171
172 virtual CompilerType
174 const size_t index) = 0;
175
177
178 virtual bool
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
206 virtual bool CanPassInRegisters(const CompilerType &type) = 0;
207
208 // TypeSystems can support more than one language
209 virtual bool SupportsLanguage(lldb::LanguageType language) = 0;
210
211 static bool SupportsLanguageStatic(lldb::LanguageType language);
212 // Type Completion
213
215
217 return false;
218 }
219
220 // AST related queries
221
222 virtual uint32_t GetPointerByteSize() = 0;
223
224 virtual unsigned GetPtrAuthKey(lldb::opaque_compiler_type_t type) = 0;
225
226 virtual unsigned
228
229 virtual bool
231
232 // Accessors
233
235 bool BaseOnly) = 0;
236
238
239 /// Defaults to GetTypeName(type). Override if your language desires
240 /// specialized behavior.
242
243 virtual uint32_t
245 CompilerType *pointee_or_element_compiler_type) = 0;
246
247 virtual lldb::LanguageType
249
250 virtual lldb::TypeClass GetTypeClass(lldb::opaque_compiler_type_t type) = 0;
251
252 // Creating related types
253
254 virtual CompilerType
256 ExecutionContextScope *exe_scope) = 0;
257
259 uint64_t size);
260
262
263 virtual CompilerType
265
266 // Returns -1 if this isn't a function of if the function doesn't have a
267 // prototype Returns a value >= 0 if there is a prototype.
269
270 virtual CompilerType
272 size_t idx) = 0;
273
274 virtual CompilerType
276
278
281
283
285
286 virtual CompilerType
288
289 virtual CompilerType
291
293
295
297
299
301 uint32_t payload);
302
303 /// \param opaque_payload The m_payload field of Type, which may
304 /// carry TypeSystem-specific extra information.
306 const char *name,
307 const CompilerDeclContext &decl_ctx,
308 uint32_t opaque_payload);
309
310 // Exploring the type
311
312 virtual const llvm::fltSemantics &
313 GetFloatTypeSemantics(size_t byte_size, lldb::Format format) = 0;
314
315 virtual llvm::Expected<uint64_t>
317 ExecutionContextScope *exe_scope) = 0;
318
320
322
323 virtual llvm::Expected<uint32_t>
325 bool omit_empty_base_classes,
326 const ExecutionContext *exe_ctx) = 0;
327
329
330 virtual lldb::BasicType
332
333 virtual void ForEachEnumerator(
335 std::function<bool(const CompilerType &integer_type,
336 ConstString name,
337 const llvm::APSInt &value)> const &callback) {}
338
339 virtual uint32_t GetNumFields(lldb::opaque_compiler_type_t type) = 0;
340
342 size_t idx, std::string &name,
343 uint64_t *bit_offset_ptr,
344 uint32_t *bitfield_bit_size_ptr,
345 bool *is_bitfield_ptr) = 0;
346
347 virtual uint32_t
349
350 virtual uint32_t
352
353 virtual CompilerType
355 uint32_t *bit_offset_ptr) = 0;
356
357 virtual CompilerType
359 uint32_t *bit_offset_ptr) = 0;
360
362 llvm::StringRef name) {
363 return CompilerDecl();
364 }
365
366 virtual llvm::Expected<CompilerType>
368 ExecutionContext *exe_ctx, std::string &deref_name,
369 uint32_t &deref_byte_size, int32_t &deref_byte_offset,
370 ValueObject *valobj, uint64_t &language_flags) = 0;
371
372 virtual llvm::Expected<CompilerType> GetChildCompilerTypeAtIndex(
373 lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, size_t idx,
374 bool transparent_pointers, bool omit_empty_base_classes,
375 bool ignore_array_bounds, std::string &child_name,
376 uint32_t &child_byte_size, int32_t &child_byte_offset,
377 uint32_t &child_bitfield_bit_size, uint32_t &child_bitfield_bit_offset,
378 bool &child_is_base_class, bool &child_is_deref_of_parent,
379 ValueObject *valobj, uint64_t &language_flags) = 0;
380
381 // Lookup a child given a name. This function will match base class names and
382 // member member names in "clang_type" only, not descendants.
383 virtual llvm::Expected<uint32_t>
385 llvm::StringRef name,
386 bool omit_empty_base_classes) = 0;
387
389 lldb::opaque_compiler_type_t type, llvm::StringRef name,
390 bool omit_empty_base_classes, std::vector<uint32_t> &child_indexes) = 0;
391
392 virtual CompilerType
394 llvm::StringRef name) {
395 return CompilerType();
396 }
397
399
401 bool expand_pack);
402
405 bool expand_pack);
406 virtual CompilerType
408 bool expand_pack);
409 virtual std::optional<CompilerType::IntegralTemplateArgument>
411 bool expand_pack);
412
413 // DIL
414
415 /// Checks if the type is eligible for integral promotion.
417
418 /// Perform integral promotion on a given type.
419 /// This promotes eligible types (boolean, integers, unscoped enumerations)
420 /// to a larger integer type according to type system rules.
421 /// \returns Promoted type.
422 virtual llvm::Expected<CompilerType>
424
425 // Dumping types
426
427#ifndef NDEBUG
428 /// Convenience LLVM-style dump method for use in the debugger only.
429 LLVM_DUMP_METHOD virtual void
431#endif
432
434 lldb::Format format, const DataExtractor &data,
435 lldb::offset_t data_offset, size_t data_byte_size,
436 uint32_t bitfield_bit_size,
437 uint32_t bitfield_bit_offset,
438 ExecutionContextScope *exe_scope) = 0;
439
440 /// Dump the type to stdout.
444
445 /// Print a description of the type to a stream. The exact implementation
446 /// varies, but the expectation is that eDescriptionLevelFull returns a
447 /// source-like representation of the type, whereas eDescriptionLevelVerbose
448 /// does a dump of the underlying AST if applicable.
452
453 /// Dump a textual representation of the internal TypeSystem state to the
454 /// given stream.
455 ///
456 /// This should not modify the state of the TypeSystem if possible.
457 ///
458 /// \param[out] output Stream to dup the AST into.
459 /// \param[in] filter If empty, dump whole AST. If non-empty, will only
460 /// dump decls whose names contain \c filter.
461 /// \param[in] show_color If true, prints the AST color-highlighted.
462 virtual void Dump(llvm::raw_ostream &output, llvm::StringRef filter,
463 bool show_color) = 0;
464
465 /// This is used by swift.
467
468 // TODO: Determine if these methods should move to TypeSystemClang.
469
471 CompilerType *pointee_type) = 0;
472
474
475 virtual std::optional<size_t>
477 ExecutionContextScope *exe_scope) = 0;
478
480
484
485 virtual CompilerType
487 size_t bit_size) = 0;
488
490
491 virtual bool IsConst(lldb::opaque_compiler_type_t type) = 0;
492
494 CompilerType *base_type_ptr) = 0;
495
497
499
500 // If the current object represents a typedef type, get the underlying type
502
504 CompilerType *element_type, uint64_t *size) = 0;
505
506 virtual CompilerType
508
509 virtual CompilerType
511
513 CompilerType *pointee_type, bool *is_rvalue) = 0;
514
515 virtual bool
519
521 llvm::StringRef expr, llvm::StringRef prefix, SourceLanguage language,
522 Expression::ResultType desired_type,
523 const EvaluateExpressionOptions &options, ValueObject *ctx_obj) {
524 return nullptr;
525 }
526
527 virtual FunctionCaller *GetFunctionCaller(const CompilerType &return_type,
528 const Address &function_address,
529 const ValueList &arg_value_list,
530 const char *name) {
531 return nullptr;
532 }
533
534 virtual std::unique_ptr<UtilityFunction>
535 CreateUtilityFunction(std::string text, std::string name);
536
538 return nullptr;
539 }
540
541 virtual CompilerType GetTypeForFormatters(void *type);
542
543 virtual LazyBool ShouldPrintAsOneLiner(void *type, ValueObject *valobj);
544
545 // Type systems can have types that are placeholder types, which are meant to
546 // indicate the presence of a type, but offer no actual information about
547 // said types, and leave the burden of actually figuring type information out
548 // to dynamic type resolution. For instance a language with a generics
549 // system, can use placeholder types to indicate "type argument goes here",
550 // without promising uniqueness of the placeholder, nor attaching any
551 // actually idenfiable information to said placeholder. This API allows type
552 // systems to tell LLDB when such a type has been encountered In response,
553 // the debugger can react by not using this type as a cache entry in any
554 // type-specific way For instance, LLDB will currently not cache any
555 // formatters that are discovered on such a type as attributable to the
556 // meaningless type itself, instead preferring to use the dynamic type
557 virtual bool IsMeaninglessWithoutDynamicResolution(void *type);
558
559 virtual std::optional<llvm::json::Value> ReportStatistics();
560
564protected:
566 /// Used for reporting statistics.
568};
569
571public:
574
575 // Clear calls Finalize on all the TypeSystems managed by this map, and then
576 // empties the map.
577 void Clear();
578
579 // Iterate through all of the type systems that are created. Return true from
580 // callback to keep iterating, false to stop iterating.
581 void ForEach(std::function<bool(lldb::TypeSystemSP)> const &callback);
582
583 llvm::Expected<lldb::TypeSystemSP>
585 bool can_create);
586
587 llvm::Expected<lldb::TypeSystemSP>
589 bool can_create);
590
591 /// Check all type systems in the map to see if any have forcefully completed
592 /// types;
594protected:
595 typedef llvm::DenseMap<uint16_t, lldb::TypeSystemSP> collection;
596 mutable std::mutex m_mutex; ///< A mutex to keep this object happy in
597 /// multi-threaded environments.
600
601private:
602 typedef llvm::function_ref<lldb::TypeSystemSP()> CreateCallback;
603 /// Finds the type system for the given language. If no type system could be
604 /// found for a language and a CreateCallback was provided, the value
605 /// returned by the callback will be treated as the TypeSystem for the
606 /// language.
607 ///
608 /// \param language The language for which the type system should be found.
609 /// \param create_callback A callback that will be called if no previously
610 /// created TypeSystem that fits the given language
611 /// could found. Can be omitted if a non-existent
612 /// type system should be treated as an error
613 /// instead.
614 /// \return The found type system or an error.
615 llvm::Expected<lldb::TypeSystemSP> GetTypeSystemForLanguage(
616 lldb::LanguageType language,
617 std::optional<CreateCallback> create_callback = std::nullopt);
618 };
619
620 } // namespace lldb_private
621
622#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:90
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:595
std::mutex m_mutex
A mutex to keep this object happy in multi-threaded environments.
Definition TypeSystem.h:596
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:602
llvm::Expected< lldb::TypeSystemSP > GetTypeSystemForLanguage(lldb::LanguageType language, Module *module, bool can_create)
void ForEach(std::function< bool(lldb::TypeSystemSP)> const &callback)
virtual CompilerType GetFullyUnqualifiedType(lldb::opaque_compiler_type_t type)=0
virtual PersistentExpressionState * GetPersistentExpressionState()
Definition TypeSystem.h:537
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:87
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:91
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)
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 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:333
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)
Checks if the type is eligible for integral promotion.
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 Scalar DeclGetConstantValue(void *opaque_decl)
Definition TypeSystem.h:115
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:527
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 llvm::Expected< CompilerType > DoIntegralPromotion(CompilerType from, ExecutionContextScope *exe_scope)
Perform integral promotion on a given type.
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:94
virtual CompilerType AddConstModifier(lldb::opaque_compiler_type_t type)
bool m_has_forcefully_completed_types
Used for reporting statistics.
Definition TypeSystem.h:567
virtual lldb::Encoding GetEncoding(lldb::opaque_compiler_type_t type)=0
virtual npdb::PdbAstBuilder * GetNativePDBParser()
Definition TypeSystem.h:92
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:361
virtual CompilerType DeclGetFunctionReturnType(void *opaque_decl)
virtual CompilerType GetDirectNestedTypeWithName(lldb::opaque_compiler_type_t type, llvm::StringRef name)
Definition TypeSystem.h:393
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)
virtual void SetSymbolFile(SymbolFile *sym_file)
Definition TypeSystem.h:96
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:520
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:561
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:481
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 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:89
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:516
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:216
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 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:90
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:85
LanguageType
Programming language type.
Encoding
Register encoding definitions.
A type-erased pair of llvm::dwarf::SourceLanguageName and version.