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 <map>
14 #include <mutex>
15 #include <string>
16 
17 #include "llvm/ADT/APFloat.h"
18 #include "llvm/ADT/APSInt.h"
19 #include "llvm/ADT/SmallBitVector.h"
20 #include "llvm/Support/Casting.h"
21 #include "llvm/Support/Error.h"
22 
27 #include "lldb/lldb-private.h"
28 
29 class DWARFDIE;
30 class DWARFASTParser;
31 class PDBASTParser;
32 
33 namespace lldb_private {
34 
35 /// A SmallBitVector that represents a set of source languages (\p
36 /// lldb::LanguageType). Each lldb::LanguageType is represented by
37 /// the bit with the position of its enumerator. The largest
38 /// LanguageType is < 64, so this is space-efficient and on 64-bit
39 /// architectures a LanguageSet can be completely stack-allocated.
40 struct LanguageSet {
41  llvm::SmallBitVector bitvector;
42  LanguageSet();
43 
44  /// If the set contains a single language only, return it.
45  llvm::Optional<lldb::LanguageType> GetSingularLanguage();
46  void Insert(lldb::LanguageType language);
47  bool Empty() const;
48  size_t Size() const;
49  bool operator[](unsigned i) const;
50 };
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
71 class TypeSystem : public PluginInterface {
72 public:
73  // Constructors and Destructors
74  ~TypeSystem() override;
75 
76  // LLVM RTTI support
77  virtual bool isA(const void *ClassID) const = 0;
78 
79  static lldb::TypeSystemSP CreateInstance(lldb::LanguageType language,
80  Module *module);
81 
82  static lldb::TypeSystemSP CreateInstance(lldb::LanguageType language,
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 DWARFASTParser *GetDWARFParser() { return nullptr; }
90  virtual PDBASTParser *GetPDBParser() { return nullptr; }
91 
92  virtual SymbolFile *GetSymbolFile() const { return m_sym_file; }
93 
94  // Returns true if the symbol file changed during the set accessor.
95  virtual void SetSymbolFile(SymbolFile *sym_file) { m_sym_file = sym_file; }
96 
97  // CompilerDecl functions
98  virtual ConstString DeclGetName(void *opaque_decl) = 0;
99 
100  virtual ConstString DeclGetMangledName(void *opaque_decl);
101 
102  virtual CompilerDeclContext DeclGetDeclContext(void *opaque_decl);
103 
104  virtual CompilerType DeclGetFunctionReturnType(void *opaque_decl);
105 
106  virtual size_t DeclGetFunctionNumArguments(void *opaque_decl);
107 
108  virtual CompilerType DeclGetFunctionArgumentType(void *opaque_decl,
109  size_t arg_idx);
110 
111  virtual CompilerType GetTypeForDecl(void *opaque_decl) = 0;
112 
113  // CompilerDeclContext functions
114 
115  virtual std::vector<CompilerDecl>
116  DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString name,
117  const bool ignore_imported_decls);
118 
119  virtual ConstString DeclContextGetName(void *opaque_decl_ctx) = 0;
120 
121  virtual ConstString
122  DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) = 0;
123 
124  virtual bool DeclContextIsClassMethod(
125  void *opaque_decl_ctx, lldb::LanguageType *language_ptr,
126  bool *is_instance_method_ptr, ConstString *language_object_name_ptr) = 0;
127 
128  virtual bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,
129  void *other_opaque_decl_ctx) = 0;
130 
131  // Tests
132 #ifndef NDEBUG
133  /// Verify the integrity of the type to catch CompilerTypes that mix
134  /// and match invalid TypeSystem/Opaque type pairs.
135  virtual bool Verify(lldb::opaque_compiler_type_t type) = 0;
136 #endif
137 
138  virtual bool IsArrayType(lldb::opaque_compiler_type_t type,
139  CompilerType *element_type, uint64_t *size,
140  bool *is_incomplete) = 0;
141 
142  virtual bool IsAggregateType(lldb::opaque_compiler_type_t type) = 0;
143 
145 
146  virtual bool IsCharType(lldb::opaque_compiler_type_t type) = 0;
147 
148  virtual bool IsCompleteType(lldb::opaque_compiler_type_t type) = 0;
149 
150  virtual bool IsDefined(lldb::opaque_compiler_type_t type) = 0;
151 
153  uint32_t &count, bool &is_complex) = 0;
154 
155  virtual bool IsFunctionType(lldb::opaque_compiler_type_t type) = 0;
156 
157  virtual size_t
159 
160  virtual CompilerType
162  const size_t index) = 0;
163 
165 
167  CompilerType *function_pointer_type_ptr) = 0;
168 
170  bool &is_signed) = 0;
171 
173  bool &is_signed) {
174  is_signed = false;
175  return false;
176  }
177 
179 
181  CompilerType *target_type, // Can pass NULL
182  bool check_cplusplus, bool check_objc) = 0;
183 
185  CompilerType *pointee_type) = 0;
186 
187  virtual bool IsScalarType(lldb::opaque_compiler_type_t type) = 0;
188 
189  virtual bool IsVoidType(lldb::opaque_compiler_type_t type) = 0;
190 
191  virtual bool CanPassInRegisters(const CompilerType &type) = 0;
192 
193  // TypeSystems can support more than one language
194  virtual bool SupportsLanguage(lldb::LanguageType language) = 0;
195 
196  // Type Completion
197 
198  virtual bool GetCompleteType(lldb::opaque_compiler_type_t type) = 0;
199 
200  // AST related queries
201 
202  virtual uint32_t GetPointerByteSize() = 0;
203 
204  // Accessors
205 
207 
209 
210  virtual uint32_t
212  CompilerType *pointee_or_element_compiler_type) = 0;
213 
214  virtual lldb::LanguageType
216 
217  virtual lldb::TypeClass GetTypeClass(lldb::opaque_compiler_type_t type) = 0;
218 
219  // Creating related types
220 
221  virtual CompilerType
223  ExecutionContextScope *exe_scope) = 0;
224 
226  uint64_t size);
227 
229 
230  virtual CompilerType
232 
233  // Returns -1 if this isn't a function of if the function doesn't have a
234  // prototype Returns a value >= 0 if there is a prototype.
236 
237  virtual CompilerType
239  size_t idx) = 0;
240 
241  virtual CompilerType
243 
244  virtual size_t GetNumMemberFunctions(lldb::opaque_compiler_type_t type) = 0;
245 
246  virtual TypeMemberFunctionImpl
248 
250 
252 
253  virtual CompilerType
255 
256  virtual CompilerType
258 
260 
262 
264 
266 
267  /// \param opaque_payload The m_payload field of Type, which may
268  /// carry TypeSystem-specific extra information.
270  const char *name,
271  const CompilerDeclContext &decl_ctx,
272  uint32_t opaque_payload);
273 
274  // Exploring the type
275 
276  virtual const llvm::fltSemantics &GetFloatTypeSemantics(size_t byte_size) = 0;
277 
278  virtual llvm::Optional<uint64_t>
280  ExecutionContextScope *exe_scope) = 0;
281 
283  uint64_t &count) = 0;
284 
286 
288  bool omit_empty_base_classes,
289  const ExecutionContext *exe_ctx) = 0;
290 
292 
293  virtual lldb::BasicType
295 
296  virtual void ForEachEnumerator(
298  std::function<bool(const CompilerType &integer_type,
299  ConstString name,
300  const llvm::APSInt &value)> const &callback) {}
301 
303 
305  size_t idx, std::string &name,
306  uint64_t *bit_offset_ptr,
307  uint32_t *bitfield_bit_size_ptr,
308  bool *is_bitfield_ptr) = 0;
309 
310  virtual uint32_t
312 
313  virtual uint32_t
315 
316  virtual CompilerType
318  uint32_t *bit_offset_ptr) = 0;
319 
320  virtual CompilerType
322  uint32_t *bit_offset_ptr) = 0;
323 
325  lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, size_t idx,
326  bool transparent_pointers, bool omit_empty_base_classes,
327  bool ignore_array_bounds, std::string &child_name,
328  uint32_t &child_byte_size, int32_t &child_byte_offset,
329  uint32_t &child_bitfield_bit_size, uint32_t &child_bitfield_bit_offset,
330  bool &child_is_base_class, bool &child_is_deref_of_parent,
331  ValueObject *valobj, uint64_t &language_flags) = 0;
332 
333  // Lookup a child given a name. This function will match base class names and
334  // member member names in "clang_type" only, not descendants.
336  const char *name,
337  bool omit_empty_base_classes) = 0;
338 
339  // Lookup a child member given a name. This function will match member names
340  // only and will descend into "clang_type" children in search for the first
341  // member in this class, or any base class that matches "name".
342  // TODO: Return all matches for a given name by returning a
343  // vector<vector<uint32_t>>
344  // so we catch all names that match a given child name, not just the first.
345  virtual size_t
347  const char *name, bool omit_empty_base_classes,
348  std::vector<uint32_t> &child_indexes) = 0;
349 
351 
355  size_t idx);
356  virtual llvm::Optional<CompilerType::IntegralTemplateArgument>
358 
359  // Dumping types
360 
361 #ifndef NDEBUG
362  /// Convenience LLVM-style dump method for use in the debugger only.
363  LLVM_DUMP_METHOD virtual void
364  dump(lldb::opaque_compiler_type_t type) const = 0;
365 #endif
366 
367  virtual void DumpValue(lldb::opaque_compiler_type_t type,
368  ExecutionContext *exe_ctx, Stream *s,
369  lldb::Format format, const DataExtractor &data,
370  lldb::offset_t data_offset, size_t data_byte_size,
371  uint32_t bitfield_bit_size,
372  uint32_t bitfield_bit_offset, bool show_types,
373  bool show_summary, bool verbose, uint32_t depth) = 0;
374 
375  virtual bool DumpTypeValue(lldb::opaque_compiler_type_t type, Stream *s,
376  lldb::Format format, const DataExtractor &data,
377  lldb::offset_t data_offset, size_t data_byte_size,
378  uint32_t bitfield_bit_size,
379  uint32_t bitfield_bit_offset,
380  ExecutionContextScope *exe_scope) = 0;
381 
382  /// Dump the type to stdout.
383  virtual void DumpTypeDescription(
386 
387  /// Print a description of the type to a stream. The exact implementation
388  /// varies, but the expectation is that eDescriptionLevelFull returns a
389  /// source-like representation of the type, whereas eDescriptionLevelVerbose
390  /// does a dump of the underlying AST if applicable.
391  virtual void DumpTypeDescription(
394 
395  // TODO: These methods appear unused. Should they be removed?
396 
398 
399  virtual void DumpSummary(lldb::opaque_compiler_type_t type,
400  ExecutionContext *exe_ctx, Stream *s,
401  const DataExtractor &data,
402  lldb::offset_t data_offset,
403  size_t data_byte_size) = 0;
404 
405  // TODO: Determine if these methods should move to TypeSystemClang.
406 
408  CompilerType *pointee_type) = 0;
409 
410  virtual unsigned GetTypeQualifiers(lldb::opaque_compiler_type_t type) = 0;
411 
413  uint32_t &length) = 0;
414 
415  virtual llvm::Optional<size_t>
417  ExecutionContextScope *exe_scope) = 0;
418 
419  virtual CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type) = 0;
420 
421  virtual CompilerType
423  size_t bit_size) = 0;
424 
425  virtual bool IsBeingDefined(lldb::opaque_compiler_type_t type) = 0;
426 
427  virtual bool IsConst(lldb::opaque_compiler_type_t type) = 0;
428 
430  CompilerType *base_type_ptr) = 0;
431 
432  virtual bool IsPolymorphicClass(lldb::opaque_compiler_type_t type) = 0;
433 
434  virtual bool IsTypedefType(lldb::opaque_compiler_type_t type) = 0;
435 
436  // If the current object represents a typedef type, get the underlying type
438 
439  virtual bool IsVectorType(lldb::opaque_compiler_type_t type,
440  CompilerType *element_type, uint64_t *size) = 0;
441 
442  virtual CompilerType
444 
445  virtual CompilerType
447 
449  CompilerType *pointee_type, bool *is_rvalue) = 0;
450 
451  virtual bool
453  return IsPointerOrReferenceType(type, nullptr);
454  }
455 
456  virtual UserExpression *
457  GetUserExpression(llvm::StringRef expr, llvm::StringRef prefix,
458  lldb::LanguageType language,
459  Expression::ResultType desired_type,
460  const EvaluateExpressionOptions &options,
461  ValueObject *ctx_obj) {
462  return nullptr;
463  }
464 
465  virtual FunctionCaller *GetFunctionCaller(const CompilerType &return_type,
466  const Address &function_address,
467  const ValueList &arg_value_list,
468  const char *name) {
469  return nullptr;
470  }
471 
472  virtual std::unique_ptr<UtilityFunction>
474 
476  return nullptr;
477  }
478 
479  virtual CompilerType GetTypeForFormatters(void *type);
480 
481  virtual LazyBool ShouldPrintAsOneLiner(void *type, ValueObject *valobj);
482 
483  // Type systems can have types that are placeholder types, which are meant to
484  // indicate the presence of a type, but offer no actual information about
485  // said types, and leave the burden of actually figuring type information out
486  // to dynamic type resolution. For instance a language with a generics
487  // system, can use placeholder types to indicate "type argument goes here",
488  // without promising uniqueness of the placeholder, nor attaching any
489  // actually idenfiable information to said placeholder. This API allows type
490  // systems to tell LLDB when such a type has been encountered In response,
491  // the debugger can react by not using this type as a cache entry in any
492  // type-specific way For instance, LLDB will currently not cache any
493  // formatters that are discovered on such a type as attributable to the
494  // meaningless type itself, instead preferring to use the dynamic type
495  virtual bool IsMeaninglessWithoutDynamicResolution(void *type);
496 
497 protected:
498  SymbolFile *m_sym_file = nullptr;
499 };
500 
502 public:
503  TypeSystemMap();
504  ~TypeSystemMap();
505 
506  // Clear calls Finalize on all the TypeSystems managed by this map, and then
507  // empties the map.
508  void Clear();
509 
510  // Iterate through all of the type systems that are created. Return true from
511  // callback to keep iterating, false to stop iterating.
512  void ForEach(std::function<bool(TypeSystem *)> const &callback);
513 
514  llvm::Expected<TypeSystem &>
516  bool can_create);
517 
518  llvm::Expected<TypeSystem &>
520  bool can_create);
521 
522 protected:
523  typedef std::map<lldb::LanguageType, lldb::TypeSystemSP> collection;
524  mutable std::mutex m_mutex; ///< A mutex to keep this object happy in
525  ///multi-threaded environments.
527  bool m_clear_in_progress = false;
528 
529 private:
530  typedef llvm::function_ref<lldb::TypeSystemSP()> CreateCallback;
531  /// Finds the type system for the given language. If no type system could be
532  /// found for a language and a CreateCallback was provided, the value returned
533  /// by the callback will be treated as the TypeSystem for the language.
534  ///
535  /// \param language The language for which the type system should be found.
536  /// \param create_callback A callback that will be called if no previously
537  /// created TypeSystem that fits the given language
538  /// could found. Can be omitted if a non-existent
539  /// type system should be treated as an error instead.
540  /// \return The found type system or an error.
541  llvm::Expected<TypeSystem &> GetTypeSystemForLanguage(
542  lldb::LanguageType language,
543  llvm::Optional<CreateCallback> create_callback = llvm::None);
544 };
545 
546 } // namespace lldb_private
547 
548 #endif // LLDB_SYMBOL_TYPESYSTEM_H
lldb_private::TypeSystem::IsCStringType
virtual bool IsCStringType(lldb::opaque_compiler_type_t type, uint32_t &length)=0
lldb_private::TypeSystem::SetSymbolFile
virtual void SetSymbolFile(SymbolFile *sym_file)
Definition: TypeSystem.h:95
lldb_private::TypeSystem::IsReferenceType
virtual bool IsReferenceType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type, bool *is_rvalue)=0
lldb_private::TypeSystem::DeclGetFunctionNumArguments
virtual size_t DeclGetFunctionNumArguments(void *opaque_decl)
Definition: TypeSystem.cpp:161
lldb_private::TypeSystem::IsPointerType
virtual bool IsPointerType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type)=0
lldb_private::SymbolFile
Definition: SymbolFile.h:37
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::TypeSystem::GetTypeQualifiers
virtual unsigned GetTypeQualifiers(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::IsVectorType
virtual bool IsVectorType(lldb::opaque_compiler_type_t type, CompilerType *element_type, uint64_t *size)=0
lldb_private::TypeSystem::IsEnumerationType
virtual bool IsEnumerationType(lldb::opaque_compiler_type_t type, bool &is_signed)
Definition: TypeSystem.h:172
CompilerDecl.h
lldb::Format
Format
Display format definitions.
Definition: lldb-enumerations.h:155
lldb_private::TypeSystem::CreateInstance
static lldb::TypeSystemSP CreateInstance(lldb::LanguageType language, Module *module)
Definition: TypeSystem.cpp:55
lldb_private::TypeSystem::ShouldTreatScalarValueAsAddress
virtual bool ShouldTreatScalarValueAsAddress(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.h:452
lldb_private::LanguageSet::GetSingularLanguage
llvm::Optional< lldb::LanguageType > GetSingularLanguage()
If the set contains a single language only, return it.
Definition: TypeSystem.cpp:27
lldb_private::TypeSystem::GetPointeeType
virtual CompilerType GetPointeeType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::GetChildCompilerTypeAtIndex
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
lldb_private::TypeSystem::GetNumTemplateArguments
virtual size_t GetNumTemplateArguments(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:121
lldb_private::TypeSystem::GetTypeForDecl
virtual CompilerType GetTypeForDecl(void *opaque_decl)=0
lldb_private::TypeSystem::IsAnonymousType
virtual bool IsAnonymousType(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:69
lldb_private::TypeSystem::GetIntegralTemplateArgument
virtual llvm::Optional< CompilerType::IntegralTemplateArgument > GetIntegralTemplateArgument(lldb::opaque_compiler_type_t type, size_t idx)
Definition: TypeSystem.cpp:136
lldb_private::TypeSystem::DeclGetDeclContext
virtual CompilerDeclContext DeclGetDeclContext(void *opaque_decl)
Definition: TypeSystem.cpp:153
lldb_private::PluginInterface
Definition: PluginInterface.h:16
lldb_private::TypeSystem::DeclContextGetName
virtual ConstString DeclContextGetName(void *opaque_decl_ctx)=0
lldb_private::LanguageSet::LanguageSet
LanguageSet()
Definition: TypeSystem.cpp:25
lldb_private::TypeSystem::IsScalarType
virtual bool IsScalarType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::IsFunctionType
virtual bool IsFunctionType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::GetRValueReferenceType
virtual CompilerType GetRValueReferenceType(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:84
lldb_private::TypeSystem::GetDisplayTypeName
virtual ConstString GetDisplayTypeName(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::GetPDBParser
virtual PDBASTParser * GetPDBParser()
Definition: TypeSystem.h:90
lldb_private::TypeSystem::GetVirtualBaseClassAtIndex
virtual CompilerType GetVirtualBaseClassAtIndex(lldb::opaque_compiler_type_t type, size_t idx, uint32_t *bit_offset_ptr)=0
lldb_private::EvaluateExpressionOptions
Definition: Target.h:262
lldb_private::TypeSystem::dump
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.
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::Module
Definition: Module.h:84
lldb_private::TypeSystem::IsTypedefType
virtual bool IsTypedefType(lldb::opaque_compiler_type_t type)=0
lldb::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
lldb_private::ValueList
Definition: Value.h:157
lldb_private::TypeSystem::IsMeaninglessWithoutDynamicResolution
virtual bool IsMeaninglessWithoutDynamicResolution(void *type)
Definition: TypeSystem.cpp:145
lldb_private::UserExpression
Definition: UserExpression.h:35
lldb_private::TypeSystemMap::CreateCallback
llvm::function_ref< lldb::TypeSystemSP()> CreateCallback
Definition: TypeSystem.h:530
lldb_private::LanguageSet::Insert
void Insert(lldb::LanguageType language)
Definition: TypeSystem.cpp:33
lldb_private::Stream
Definition: Stream.h:28
lldb_private::TypeSystem::GetTypeClass
virtual lldb::TypeClass GetTypeClass(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::IsPossibleDynamicType
virtual bool IsPossibleDynamicType(lldb::opaque_compiler_type_t type, CompilerType *target_type, bool check_cplusplus, bool check_objc)=0
lldb::BasicType
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
Definition: lldb-enumerations.h:741
lldb_private::LazyBool
LazyBool
Definition: lldb-private-enumerations.h:115
lldb_private::LanguageSet::Empty
bool Empty() const
Definition: TypeSystem.cpp:35
lldb_private::TypeSystem::DeclContextIsClassMethod
virtual bool DeclContextIsClassMethod(void *opaque_decl_ctx, lldb::LanguageType *language_ptr, bool *is_instance_method_ptr, ConstString *language_object_name_ptr)=0
lldb_private::TypeSystem::isA
virtual bool isA(const void *ClassID) const =0
lldb_private::Target
Definition: Target.h:454
lldb_private::TypeSystemMap::GetTypeSystemForLanguage
llvm::Expected< TypeSystem & > GetTypeSystemForLanguage(lldb::LanguageType language, Module *module, bool can_create)
Definition: TypeSystem.cpp:279
lldb_private::TypeSystem::Finalize
virtual void Finalize()
Definition: TypeSystem.h:87
lldb_private::TypeSystemMap::ForEach
void ForEach(std::function< bool(TypeSystem *)> const &callback)
Definition: TypeSystem.cpp:208
lldb_private::TypeSystem::GetCompleteType
virtual bool GetCompleteType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::IsPointerOrReferenceType
virtual bool IsPointerOrReferenceType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type)=0
lldb_private::TypeSystem::GetDWARFParser
virtual DWARFASTParser * GetDWARFParser()
Definition: TypeSystem.h:89
DWARFDIE
Definition: DWARFDIE.h:16
lldb_private::TypeSystem::IsHomogeneousAggregate
virtual uint32_t IsHomogeneousAggregate(lldb::opaque_compiler_type_t type, CompilerType *base_type_ptr)=0
lldb_private::TypeSystem::CreateTypedef
virtual CompilerType CreateTypedef(lldb::opaque_compiler_type_t type, const char *name, const CompilerDeclContext &decl_ctx, uint32_t opaque_payload)
Definition: TypeSystem.cpp:106
lldb_private::Expression::ResultType
ResultType
Definition: Expression.h:35
lldb_private::TypeSystem::DeclGetMangledName
virtual ConstString DeclGetMangledName(void *opaque_decl)
Definition: TypeSystem.cpp:149
lldb_private::TypeSystem::GetBuiltinTypeForEncodingAndBitSize
virtual CompilerType GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size)=0
lldb_private::TypeSystem::GetFormat
virtual lldb::Format GetFormat(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::IsCharType
virtual bool IsCharType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::GetBitSize
virtual llvm::Optional< uint64_t > GetBitSize(lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope)=0
lldb_private::LanguageSet::bitvector
llvm::SmallBitVector bitvector
Definition: TypeSystem.h:41
lldb_private::TypeSystem::AddVolatileModifier
virtual CompilerType AddVolatileModifier(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:97
lldb_private::TypeSystem::GetDirectBaseClassAtIndex
virtual CompilerType GetDirectBaseClassAtIndex(lldb::opaque_compiler_type_t type, size_t idx, uint32_t *bit_offset_ptr)=0
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb_private::ExecutionContextScope
Definition: ExecutionContextScope.h:32
lldb_private::TypeSystem::ForEachEnumerator
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:296
lldb_private::TypeSystem::IsArrayType
virtual bool IsArrayType(lldb::opaque_compiler_type_t type, CompilerType *element_type, uint64_t *size, bool *is_incomplete)=0
lldb_private::TypeSystemMap::m_mutex
std::mutex m_mutex
A mutex to keep this object happy in multi-threaded environments.
Definition: TypeSystem.h:524
lldb_private::TypeSystem::GetTypeBitAlign
virtual llvm::Optional< size_t > GetTypeBitAlign(lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope)=0
lldb_private::TypeSystem::DeclContextFindDeclByName
virtual std::vector< CompilerDecl > DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString name, const bool ignore_imported_decls)
Definition: TypeSystem.cpp:169
lldb_private::TypeSystem::GetFunctionCaller
virtual FunctionCaller * GetFunctionCaller(const CompilerType &return_type, const Address &function_address, const ValueList &arg_value_list, const char *name)
Definition: TypeSystem.h:465
lldb_private::TypeSystem::IsFloatingPointType
virtual bool IsFloatingPointType(lldb::opaque_compiler_type_t type, uint32_t &count, bool &is_complex)=0
lldb_private::TypeSystemMap
Definition: TypeSystem.h:501
lldb_private::TypeSystem::DumpTypeDescription
virtual void DumpTypeDescription(lldb::opaque_compiler_type_t type, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull)=0
Dump the type to stdout.
lldb_private::TypeSystem::GetTypeName
virtual ConstString GetTypeName(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::GetLValueReferenceType
virtual CompilerType GetLValueReferenceType(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:79
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::TypeSystemMap::~TypeSystemMap
~TypeSystemMap()
lldb::eDescriptionLevelFull
@ eDescriptionLevelFull
Definition: lldb-enumerations.h:209
lldb_private::TypeSystem::IsRuntimeGeneratedType
virtual bool IsRuntimeGeneratedType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::DeclContextIsContainedInLookup
virtual bool DeclContextIsContainedInLookup(void *opaque_decl_ctx, void *other_opaque_decl_ctx)=0
PluginInterface.h
lldb_private::TypeSystem::GetFunctionArgumentTypeAtIndex
virtual CompilerType GetFunctionArgumentTypeAtIndex(lldb::opaque_compiler_type_t type, size_t idx)=0
lldb_private::TypeSystem::DeclGetName
virtual ConstString DeclGetName(void *opaque_decl)=0
lldb_private::TypeSystem::IsPolymorphicClass
virtual bool IsPolymorphicClass(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::IsFunctionPointerType
virtual bool IsFunctionPointerType(lldb::opaque_compiler_type_t type)=0
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:39
lldb_private::TypeSystem::Verify
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
lldb_private::TypeSystem::GetNumFields
virtual uint32_t GetNumFields(lldb::opaque_compiler_type_t type)=0
lldb::TemplateArgumentKind
TemplateArgumentKind
Definition: lldb-enumerations.h:814
lldb_private::TypeSystem::IsCompleteType
virtual bool IsCompleteType(lldb::opaque_compiler_type_t type)=0
lldb_private::CompilerDeclContext
Represents a generic declaration context in a program.
Definition: CompilerDeclContext.h:30
lldb_private::TypeSystem::DeclContextGetScopeQualifiedName
virtual ConstString DeclContextGetScopeQualifiedName(void *opaque_decl_ctx)=0
lldb-private.h
lldb_private::TypeSystem::DumpSummary
virtual void DumpSummary(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size)=0
lldb_private::TypeSystem::IsIntegerType
virtual bool IsIntegerType(lldb::opaque_compiler_type_t type, bool &is_signed)=0
lldb_private::TypeSystem::GetTemplateArgumentKind
virtual lldb::TemplateArgumentKind GetTemplateArgumentKind(lldb::opaque_compiler_type_t type, size_t idx)
Definition: TypeSystem.cpp:126
lldb_private::TypeSystemMap::TypeSystemMap
TypeSystemMap()
Definition: TypeSystem.cpp:181
lldb_private::TypeSystemMap::collection
std::map< lldb::LanguageType, lldb::TypeSystemSP > collection
Definition: TypeSystem.h:523
lldb_private::TypeSystem::GetEnumerationIntegerType
virtual CompilerType GetEnumerationIntegerType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::GetBuiltinTypeByName
virtual CompilerType GetBuiltinTypeByName(ConstString name)
Definition: TypeSystem.cpp:113
lldb_private::TypeSystem::GetMinimumLanguage
virtual lldb::LanguageType GetMinimumLanguage(lldb::opaque_compiler_type_t type)=0
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
lldb_private::TypeSystem::GetFunctionReturnType
virtual CompilerType GetFunctionReturnType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::GetPersistentExpressionState
virtual PersistentExpressionState * GetPersistentExpressionState()
Definition: TypeSystem.h:475
lldb_private::TypeSystem::GetFloatTypeSemantics
virtual const llvm::fltSemantics & GetFloatTypeSemantics(size_t byte_size)=0
lldb_private::TypeSystem::GetPointerType
virtual CompilerType GetPointerType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::CreateUtilityFunction
virtual std::unique_ptr< UtilityFunction > CreateUtilityFunction(std::string text, std::string name)
Definition: TypeSystem.cpp:175
uint32_t
DWARFASTParser
Definition: DWARFASTParser.h:25
lldb_private::TypeSystem::~TypeSystem
~TypeSystem() override
lldb_private::Address
Definition: Address.h:59
lldb_private::TypeSystem::IsConst
virtual bool IsConst(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::IsAggregateType
virtual bool IsAggregateType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::IsBeingDefined
virtual bool IsBeingDefined(lldb::opaque_compiler_type_t type)=0
PDBASTParser
Definition: PDBASTParser.h:43
lldb_private::TypeSystem::AddConstModifier
virtual CompilerType AddConstModifier(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:92
lldb_private::TypeSystem::IsVoidType
virtual bool IsVoidType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::GetTypeTemplateArgument
virtual CompilerType GetTypeTemplateArgument(lldb::opaque_compiler_type_t type, size_t idx)
Definition: TypeSystem.cpp:130
lldb_private::TypeSystem::GetTypeInfo
virtual uint32_t GetTypeInfo(lldb::opaque_compiler_type_t type, CompilerType *pointee_or_element_compiler_type)=0
lldb_private::TypeSystem::GetArrayType
virtual CompilerType GetArrayType(lldb::opaque_compiler_type_t type, uint64_t size)
Definition: TypeSystem.cpp:73
lldb_private::TypeSystem::GetNumberOfFunctionArguments
virtual size_t GetNumberOfFunctionArguments(lldb::opaque_compiler_type_t type)=0
lldb::Encoding
Encoding
Register encoding definitions.
Definition: lldb-enumerations.h:146
lldb_private::TypeSystem::IsBlockPointerType
virtual bool IsBlockPointerType(lldb::opaque_compiler_type_t type, CompilerType *function_pointer_type_ptr)=0
lldb_private::TypeSystem::ShouldPrintAsOneLiner
virtual LazyBool ShouldPrintAsOneLiner(void *type, ValueObject *valobj)
Definition: TypeSystem.cpp:141
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb_private::TypeSystem::GetNumMemberFunctions
virtual size_t GetNumMemberFunctions(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::GetFunctionArgumentCount
virtual int GetFunctionArgumentCount(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::m_sym_file
SymbolFile * m_sym_file
Definition: TypeSystem.h:498
lldb_private::PersistentExpressionState
Definition: ExpressionVariable.h:203
CompilerDeclContext.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::TypeSystem::DeclGetFunctionReturnType
virtual CompilerType DeclGetFunctionReturnType(void *opaque_decl)
Definition: TypeSystem.cpp:157
lldb_private::TypeSystem::DumpValue
virtual void DumpValue(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, 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, bool show_types, bool show_summary, bool verbose, uint32_t depth)=0
lldb_private::LanguageSet::Size
size_t Size() const
Definition: TypeSystem.cpp:34
lldb_private::TypeSystem::GetFieldAtIndex
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
lldb_private::TypeSystem
Interface for representing a type system.
Definition: TypeSystem.h:71
lldb_private::TypeSystem::GetIndexOfChildWithName
virtual uint32_t GetIndexOfChildWithName(lldb::opaque_compiler_type_t type, const char *name, bool omit_empty_base_classes)=0
lldb_private::TypeSystem::GetBasicTypeEnumeration
virtual lldb::BasicType GetBasicTypeEnumeration(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::DeclGetFunctionArgumentType
virtual CompilerType DeclGetFunctionArgumentType(void *opaque_decl, size_t arg_idx)
Definition: TypeSystem.cpp:163
lldb_private::TypeSystem::GetIndexOfChildMemberWithName
virtual size_t GetIndexOfChildMemberWithName(lldb::opaque_compiler_type_t type, const char *name, bool omit_empty_base_classes, std::vector< uint32_t > &child_indexes)=0
lldb_private::TypeSystem::IsScopedEnumerationType
virtual bool IsScopedEnumerationType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::CanPassInRegisters
virtual bool CanPassInRegisters(const CompilerType &type)=0
lldb_private::TypeSystem::GetCanonicalType
virtual CompilerType GetCanonicalType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::GetPointerByteSize
virtual uint32_t GetPointerByteSize()=0
lldb_private::LanguageSet
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
Definition: TypeSystem.h:40
lldb_private::TypeSystem::GetArrayElementType
virtual CompilerType GetArrayElementType(lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope)=0
lldb_private::TypeSystem::GetNumChildren
virtual uint32_t GetNumChildren(lldb::opaque_compiler_type_t type, bool omit_empty_base_classes, const ExecutionContext *exe_ctx)=0
lldb_private::TypeSystem::GetSymbolFile
virtual SymbolFile * GetSymbolFile() const
Definition: TypeSystem.h:92
lldb_private::TypeSystem::GetUserExpression
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:457
lldb_private::TypeSystem::GetTypeForFormatters
virtual CompilerType GetTypeForFormatters(void *type)
Definition: TypeSystem.cpp:117
lldb_private::TypeMemberFunctionImpl
Definition: Type.h:435
lldb_private::TypeSystem::GetBasicTypeFromAST
virtual CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type)=0
lldb_private::TypeSystem::IsDefined
virtual bool IsDefined(lldb::opaque_compiler_type_t type)=0
Expression.h
lldb_private::TypeSystem::GetTypedefedType
virtual CompilerType GetTypedefedType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystemMap::m_map
collection m_map
Definition: TypeSystem.h:526
lldb_private::TypeSystem::DumpTypeValue
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
lldb_private::TypeSystemMap::Clear
void Clear()
Definition: TypeSystem.cpp:185
lldb_private::TypeSystem::AddRestrictModifier
virtual CompilerType AddRestrictModifier(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:102
lldb_private::TypeSystem::GetNonReferenceType
virtual CompilerType GetNonReferenceType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::GetMemberFunctionAtIndex
virtual TypeMemberFunctionImpl GetMemberFunctionAtIndex(lldb::opaque_compiler_type_t type, size_t idx)=0
lldb_private::LanguageSet::operator[]
bool operator[](unsigned i) const
Definition: TypeSystem.cpp:36
lldb_private::TypeSystem::GetEncoding
virtual lldb::Encoding GetEncoding(lldb::opaque_compiler_type_t type, uint64_t &count)=0
lldb_private::TypeSystemMap::m_clear_in_progress
bool m_clear_in_progress
Definition: TypeSystem.h:527
lldb::opaque_compiler_type_t
void * opaque_compiler_type_t
Definition: lldb-types.h:90
lldb_private::TypeSystem::GetFunctionArgumentAtIndex
virtual CompilerType GetFunctionArgumentAtIndex(lldb::opaque_compiler_type_t type, const size_t index)=0
lldb::DescriptionLevel
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
Definition: lldb-enumerations.h:207
lldb_private::TypeSystem::GetNumDirectBaseClasses
virtual uint32_t GetNumDirectBaseClasses(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::SupportsLanguage
virtual bool SupportsLanguage(lldb::LanguageType language)=0
lldb_private::TypeSystem::GetNumVirtualBaseClasses
virtual uint32_t GetNumVirtualBaseClasses(lldb::opaque_compiler_type_t type)=0
lldb_private::FunctionCaller
Definition: FunctionCaller.h:56
lldb_private::TypeSystem::GetFullyUnqualifiedType
virtual CompilerType GetFullyUnqualifiedType(lldb::opaque_compiler_type_t type)=0
lldb_private::TypeSystem::GetAtomicType
virtual CompilerType GetAtomicType(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:88