LLDB  mainline
TypeSystemClang.h
Go to the documentation of this file.
1 //===-- TypeSystemClang.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_SOURCE_PLUGINS_TYPESYSTEM_CLANG_TYPESYSTEMCLANG_H
10 #define LLDB_SOURCE_PLUGINS_TYPESYSTEM_CLANG_TYPESYSTEMCLANG_H
11 
12 #include <cstdint>
13 
14 #include <functional>
15 #include <initializer_list>
16 #include <map>
17 #include <memory>
18 #include <set>
19 #include <string>
20 #include <utility>
21 #include <vector>
22 
23 #include "clang/AST/ASTContext.h"
24 #include "clang/AST/ASTFwd.h"
25 #include "clang/AST/TemplateBase.h"
26 #include "clang/AST/Type.h"
27 #include "clang/Basic/TargetInfo.h"
28 #include "llvm/ADT/APSInt.h"
29 #include "llvm/ADT/SmallVector.h"
30 
34 #include "lldb/Symbol/TypeSystem.h"
35 #include "lldb/Target/Target.h"
37 #include "lldb/Utility/Flags.h"
38 #include "lldb/Utility/Log.h"
39 #include "lldb/lldb-enumerations.h"
40 
42 class PDBASTParser;
43 
44 namespace clang {
45 class FileManager;
46 class HeaderSearch;
47 class ModuleMap;
48 } // namespace clang
49 
50 namespace lldb_private {
51 
52 class ClangASTMetadata;
53 class ClangASTSource;
54 class Declaration;
55 
56 /// A Clang module ID.
58  unsigned m_id = 0;
59 
60 public:
61  OptionalClangModuleID() = default;
62  explicit OptionalClangModuleID(unsigned id) : m_id(id) {}
63  bool HasValue() const { return m_id != 0; }
64  unsigned GetValue() const { return m_id; }
65 };
66 
67 /// The implementation of lldb::Type's m_payload field for TypeSystemClang.
69  /// The Layout is as follows:
70  /// \verbatim
71  /// bit 0..30 ... Owning Module ID.
72  /// bit 31 ...... IsCompleteObjCClass.
73  /// \endverbatim
75 
76 public:
77  TypePayloadClang() = default;
78  explicit TypePayloadClang(OptionalClangModuleID owning_module,
79  bool is_complete_objc_class = false);
80  explicit TypePayloadClang(uint32_t opaque_payload) : m_payload(opaque_payload) {}
81  operator Type::Payload() { return m_payload; }
82 
83  static constexpr unsigned ObjCClassBit = 1 << 31;
85  void SetIsCompleteObjCClass(bool is_complete_objc_class) {
86  m_payload = is_complete_objc_class ? Flags(m_payload).Set(ObjCClassBit)
88  }
91  }
93  /// \}
94 };
95 
96 /// A TypeSystem implementation based on Clang.
97 ///
98 /// This class uses a single clang::ASTContext as the backend for storing
99 /// its types and declarations. Every clang::ASTContext should also just have
100 /// a single associated TypeSystemClang instance that manages it.
101 ///
102 /// The clang::ASTContext instance can either be created by TypeSystemClang
103 /// itself or it can adopt an existing clang::ASTContext (for example, when
104 /// it is necessary to provide a TypeSystem interface for an existing
105 /// clang::ASTContext that was created by clang::CompilerInstance).
106 class TypeSystemClang : public TypeSystem {
107  // LLVM RTTI support
108  static char ID;
109 
110 public:
111  typedef void (*CompleteTagDeclCallback)(void *baton, clang::TagDecl *);
112  typedef void (*CompleteObjCInterfaceDeclCallback)(void *baton,
113  clang::ObjCInterfaceDecl *);
114 
115  // llvm casting support
116  bool isA(const void *ClassID) const override { return ClassID == &ID; }
117  static bool classof(const TypeSystem *ts) { return ts->isA(&ID); }
118 
119  /// Constructs a TypeSystemClang with an ASTContext using the given triple.
120  ///
121  /// \param name The name for the TypeSystemClang (for logging purposes)
122  /// \param triple The llvm::Triple used for the ASTContext. The triple defines
123  /// certain characteristics of the ASTContext and its types
124  /// (e.g., whether certain primitive types exist or what their
125  /// signedness is).
126  explicit TypeSystemClang(llvm::StringRef name, llvm::Triple triple);
127 
128  /// Constructs a TypeSystemClang that uses an existing ASTContext internally.
129  /// Useful when having an existing ASTContext created by Clang.
130  ///
131  /// \param name The name for the TypeSystemClang (for logging purposes)
132  /// \param existing_ctxt An existing ASTContext.
133  explicit TypeSystemClang(llvm::StringRef name,
134  clang::ASTContext &existing_ctxt);
135 
136  ~TypeSystemClang() override;
137 
138  void Finalize() override;
139 
140  // PluginInterface functions
141  llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
142 
143  static llvm::StringRef GetPluginNameStatic() { return "clang"; }
144 
145  static lldb::TypeSystemSP CreateInstance(lldb::LanguageType language,
146  Module *module, Target *target);
147 
150 
151  static void Initialize();
152 
153  static void Terminate();
154 
155  static TypeSystemClang *GetASTContext(clang::ASTContext *ast_ctx);
156 
157  /// Returns the display name of this TypeSystemClang that indicates what
158  /// purpose it serves in LLDB. Used for example in logs.
159  llvm::StringRef getDisplayName() const { return m_display_name; }
160 
161  /// Returns the clang::ASTContext instance managed by this TypeSystemClang.
162  clang::ASTContext &getASTContext();
163 
164  clang::MangleContext *getMangleContext();
165 
166  std::shared_ptr<clang::TargetOptions> &getTargetOptions();
167 
168  clang::TargetInfo *getTargetInfo();
169 
170  void setSema(clang::Sema *s);
171  clang::Sema *getSema() { return m_sema; }
172 
173  const char *GetTargetTriple();
174 
175  void SetExternalSource(
176  llvm::IntrusiveRefCntPtr<clang::ExternalASTSource> &ast_source_up);
177 
178  bool GetCompleteDecl(clang::Decl *decl) {
180  }
181 
182  static void DumpDeclHiearchy(clang::Decl *decl);
183 
184  static void DumpDeclContextHiearchy(clang::DeclContext *decl_ctx);
185 
186  static bool DeclsAreEquivalent(clang::Decl *lhs_decl, clang::Decl *rhs_decl);
187 
188  static bool GetCompleteDecl(clang::ASTContext *ast, clang::Decl *decl);
189 
190  void SetMetadataAsUserID(const clang::Decl *decl, lldb::user_id_t user_id);
191  void SetMetadataAsUserID(const clang::Type *type, lldb::user_id_t user_id);
192 
193  void SetMetadata(const clang::Decl *object, ClangASTMetadata &meta_data);
194 
195  void SetMetadata(const clang::Type *object, ClangASTMetadata &meta_data);
196  ClangASTMetadata *GetMetadata(const clang::Decl *object);
197  ClangASTMetadata *GetMetadata(const clang::Type *object);
198 
199  void SetCXXRecordDeclAccess(const clang::CXXRecordDecl *object,
200  clang::AccessSpecifier access);
201  clang::AccessSpecifier
202  GetCXXRecordDeclAccess(const clang::CXXRecordDecl *object);
203 
204  // Basic Types
206  size_t bit_size) override;
207 
209 
211 
213  GetBuiltinTypeForDWARFEncodingAndBitSize(llvm::StringRef type_name,
214  uint32_t dw_ate, uint32_t bit_size);
215 
216  CompilerType GetCStringType(bool is_const);
217 
218  static clang::DeclContext *GetDeclContextForType(clang::QualType type);
219 
220  static clang::DeclContext *GetDeclContextForType(const CompilerType &type);
221 
222  uint32_t GetPointerByteSize() override;
223 
224  clang::TranslationUnitDecl *GetTranslationUnitDecl() {
225  return getASTContext().getTranslationUnitDecl();
226  }
227 
228  static bool AreTypesSame(CompilerType type1, CompilerType type2,
229  bool ignore_qualifiers = false);
230 
231  /// Creates a CompilerType form the given QualType with the current
232  /// TypeSystemClang instance as the CompilerType's typesystem.
233  /// \param qt The QualType for a type that belongs to the ASTContext of this
234  /// TypeSystemClang.
235  /// \return The CompilerType representing the given QualType. If the
236  /// QualType's type pointer is a nullptr then the function returns an
237  /// invalid CompilerType.
238  CompilerType GetType(clang::QualType qt) {
239  if (qt.getTypePtrOrNull() == nullptr)
240  return CompilerType();
241  // Check that the type actually belongs to this TypeSystemClang.
242  assert(qt->getAsTagDecl() == nullptr ||
243  &qt->getAsTagDecl()->getASTContext() == &getASTContext());
244  return CompilerType(this, qt.getAsOpaquePtr());
245  }
246 
247  CompilerType GetTypeForDecl(clang::NamedDecl *decl);
248 
249  CompilerType GetTypeForDecl(clang::TagDecl *decl);
250 
251  CompilerType GetTypeForDecl(clang::ObjCInterfaceDecl *objc_decl);
252 
253  template <typename RecordDeclType>
256  clang::DeclContext *decl_context = nullptr) {
257  CompilerType compiler_type;
258 
259  if (type_name.GetLength()) {
260  clang::ASTContext &ast = getASTContext();
261  if (!decl_context)
262  decl_context = ast.getTranslationUnitDecl();
263 
264  clang::IdentifierInfo &myIdent = ast.Idents.get(type_name.GetCString());
265  clang::DeclarationName myName =
266  ast.DeclarationNames.getIdentifier(&myIdent);
267 
268  clang::DeclContext::lookup_result result = decl_context->lookup(myName);
269 
270  if (!result.empty()) {
271  clang::NamedDecl *named_decl = *result.begin();
272  if (const RecordDeclType *record_decl =
273  llvm::dyn_cast<RecordDeclType>(named_decl))
274  compiler_type.SetCompilerType(
275  this, clang::QualType(record_decl->getTypeForDecl(), 0)
276  .getAsOpaquePtr());
277  }
278  }
279 
280  return compiler_type;
281  }
282 
284  ConstString type_name,
285  const std::initializer_list<std::pair<const char *, CompilerType>>
286  &type_fields,
287  bool packed = false);
288 
290  ConstString type_name,
291  const std::initializer_list<std::pair<const char *, CompilerType>>
292  &type_fields,
293  bool packed = false);
294 
295  static bool IsOperator(llvm::StringRef name,
296  clang::OverloadedOperatorKind &op_kind);
297 
298  // Structure, Unions, Classes
299 
300  static clang::AccessSpecifier
302 
303  static clang::AccessSpecifier
304  UnifyAccessSpecifiers(clang::AccessSpecifier lhs, clang::AccessSpecifier rhs);
305 
306  static uint32_t GetNumBaseClasses(const clang::CXXRecordDecl *cxx_record_decl,
307  bool omit_empty_base_classes);
308 
309  /// Synthesize a clang::Module and return its ID or a default-constructed ID.
310  OptionalClangModuleID GetOrCreateClangModule(llvm::StringRef name,
311  OptionalClangModuleID parent,
312  bool is_framework = false,
313  bool is_explicit = false);
314 
315  CompilerType CreateRecordType(clang::DeclContext *decl_ctx,
316  OptionalClangModuleID owning_module,
317  lldb::AccessType access_type,
318  llvm::StringRef name, int kind,
319  lldb::LanguageType language,
320  ClangASTMetadata *metadata = nullptr,
321  bool exports_symbols = false);
322 
324  public:
325  bool IsValid() const {
326  // Having a pack name but no packed args doesn't make sense, so mark
327  // these template parameters as invalid.
328  if (pack_name && !packed_args)
329  return false;
330  return args.size() == names.size() &&
331  (!packed_args || !packed_args->packed_args);
332  }
333 
334  bool hasParameterPack() const { return static_cast<bool>(packed_args); }
335 
336  llvm::SmallVector<const char *, 2> names;
337  llvm::SmallVector<clang::TemplateArgument, 2> args;
338 
339  const char * pack_name = nullptr;
340  std::unique_ptr<TemplateParameterInfos> packed_args;
341  };
342 
343  clang::FunctionTemplateDecl *CreateFunctionTemplateDecl(
344  clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module,
345  clang::FunctionDecl *func_decl, const TemplateParameterInfos &infos);
346 
348  clang::FunctionDecl *func_decl, clang::FunctionTemplateDecl *Template,
349  const TemplateParameterInfos &infos);
350 
351  clang::ClassTemplateDecl *CreateClassTemplateDecl(
352  clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module,
353  lldb::AccessType access_type, llvm::StringRef class_name, int kind,
354  const TemplateParameterInfos &infos);
355 
356  clang::TemplateTemplateParmDecl *
357  CreateTemplateTemplateParmDecl(const char *template_name);
358 
359  clang::ClassTemplateSpecializationDecl *CreateClassTemplateSpecializationDecl(
360  clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module,
361  clang::ClassTemplateDecl *class_template_decl, int kind,
362  const TemplateParameterInfos &infos);
363 
365  CreateClassTemplateSpecializationType(clang::ClassTemplateSpecializationDecl *
366  class_template_specialization_decl);
367 
368  static clang::DeclContext *
369  GetAsDeclContext(clang::FunctionDecl *function_decl);
370 
372  bool is_method, clang::OverloadedOperatorKind op_kind,
373  uint32_t num_params);
374 
375  bool FieldIsBitfield(clang::FieldDecl *field, uint32_t &bitfield_bit_size);
376 
377  static bool RecordHasFields(const clang::RecordDecl *record_decl);
378 
379  CompilerType CreateObjCClass(llvm::StringRef name,
380  clang::DeclContext *decl_ctx,
381  OptionalClangModuleID owning_module,
382  bool isForwardDecl, bool isInternal,
383  ClangASTMetadata *metadata = nullptr);
384 
385  // Returns a mask containing bits from the TypeSystemClang::eTypeXXX
386  // enumerations
387 
388  // Namespace Declarations
389 
390  clang::NamespaceDecl *
391  GetUniqueNamespaceDeclaration(const char *name, clang::DeclContext *decl_ctx,
392  OptionalClangModuleID owning_module,
393  bool is_inline = false);
394 
395  // Function Types
396 
397  clang::FunctionDecl *CreateFunctionDeclaration(
398  clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module,
399  llvm::StringRef name, const CompilerType &function_Type,
400  clang::StorageClass storage, bool is_inline);
401 
403  CreateFunctionType(const CompilerType &result_type, const CompilerType *args,
404  unsigned num_args, bool is_variadic, unsigned type_quals,
405  clang::CallingConv cc = clang::CC_C,
406  clang::RefQualifierKind ref_qual = clang::RQ_None);
407 
408  clang::ParmVarDecl *
409  CreateParameterDeclaration(clang::DeclContext *decl_ctx,
410  OptionalClangModuleID owning_module,
411  const char *name, const CompilerType &param_type,
412  int storage, bool add_decl = false);
413 
414  void SetFunctionParameters(clang::FunctionDecl *function_decl,
415  llvm::ArrayRef<clang::ParmVarDecl *> params);
416 
417  CompilerType CreateBlockPointerType(const CompilerType &function_type);
418 
419  // Array Types
420 
421  CompilerType CreateArrayType(const CompilerType &element_type,
422  size_t element_count, bool is_vector);
423 
424  // Enumeration Types
425  CompilerType CreateEnumerationType(llvm::StringRef name,
426  clang::DeclContext *decl_ctx,
427  OptionalClangModuleID owning_module,
428  const Declaration &decl,
429  const CompilerType &integer_qual_type,
430  bool is_scoped);
431 
432  // Integer type functions
433 
434  CompilerType GetIntTypeFromBitSize(size_t bit_size, bool is_signed);
435 
436  CompilerType GetPointerSizedIntType(bool is_signed);
437 
438  // Floating point functions
439 
440  static CompilerType GetFloatTypeFromBitSize(clang::ASTContext *ast,
441  size_t bit_size);
442 
443  // TypeSystem methods
444  DWARFASTParser *GetDWARFParser() override;
445  PDBASTParser *GetPDBParser() override;
447 
448  // TypeSystemClang callbacks for external source lookups.
449  void CompleteTagDecl(clang::TagDecl *);
450 
451  void CompleteObjCInterfaceDecl(clang::ObjCInterfaceDecl *);
452 
453  bool LayoutRecordType(
454  const clang::RecordDecl *record_decl, uint64_t &size, uint64_t &alignment,
455  llvm::DenseMap<const clang::FieldDecl *, uint64_t> &field_offsets,
456  llvm::DenseMap<const clang::CXXRecordDecl *, clang::CharUnits>
457  &base_offsets,
458  llvm::DenseMap<const clang::CXXRecordDecl *, clang::CharUnits>
459  &vbase_offsets);
460 
461  /// Creates a CompilerDecl from the given Decl with the current
462  /// TypeSystemClang instance as its typesystem.
463  /// The Decl has to come from the ASTContext of this
464  /// TypeSystemClang.
465  CompilerDecl GetCompilerDecl(clang::Decl *decl) {
466  assert(&decl->getASTContext() == &getASTContext() &&
467  "CreateCompilerDecl for Decl from wrong ASTContext?");
468  return CompilerDecl(this, decl);
469  }
470 
471  // CompilerDecl override functions
472  ConstString DeclGetName(void *opaque_decl) override;
473 
474  ConstString DeclGetMangledName(void *opaque_decl) override;
475 
476  CompilerDeclContext DeclGetDeclContext(void *opaque_decl) override;
477 
478  CompilerType DeclGetFunctionReturnType(void *opaque_decl) override;
479 
480  size_t DeclGetFunctionNumArguments(void *opaque_decl) override;
481 
482  CompilerType DeclGetFunctionArgumentType(void *opaque_decl,
483  size_t arg_idx) override;
484 
485  CompilerType GetTypeForDecl(void *opaque_decl) override;
486 
487  // CompilerDeclContext override functions
488 
489  /// Creates a CompilerDeclContext from the given DeclContext
490  /// with the current TypeSystemClang instance as its typesystem.
491  /// The DeclContext has to come from the ASTContext of this
492  /// TypeSystemClang.
493  CompilerDeclContext CreateDeclContext(clang::DeclContext *ctx);
494 
495  /// Set the owning module for \p decl.
496  static void SetOwningModule(clang::Decl *decl,
497  OptionalClangModuleID owning_module);
498 
499  std::vector<CompilerDecl>
500  DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString name,
501  const bool ignore_using_decls) override;
502 
503  ConstString DeclContextGetName(void *opaque_decl_ctx) override;
504 
505  ConstString DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) override;
506 
507  bool DeclContextIsClassMethod(void *opaque_decl_ctx,
508  lldb::LanguageType *language_ptr,
509  bool *is_instance_method_ptr,
510  ConstString *language_object_name_ptr) override;
511 
512  bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,
513  void *other_opaque_decl_ctx) override;
514 
515  // Clang specific clang::DeclContext functions
516 
517  static clang::DeclContext *
519 
520  static clang::ObjCMethodDecl *
522 
523  static clang::CXXMethodDecl *
525 
526  static clang::FunctionDecl *
528 
529  static clang::NamespaceDecl *
531 
533  const clang::Decl *object);
534 
535  static clang::ASTContext *
537 
538  // Tests
539 
540 #ifndef NDEBUG
541  bool Verify(lldb::opaque_compiler_type_t type) override;
542 #endif
543 
545  CompilerType *element_type, uint64_t *size,
546  bool *is_incomplete) override;
547 
549  CompilerType *element_type, uint64_t *size) override;
550 
551  bool IsAggregateType(lldb::opaque_compiler_type_t type) override;
552 
553  bool IsAnonymousType(lldb::opaque_compiler_type_t type) override;
554 
555  bool IsBeingDefined(lldb::opaque_compiler_type_t type) override;
556 
557  bool IsCharType(lldb::opaque_compiler_type_t type) override;
558 
559  bool IsCompleteType(lldb::opaque_compiler_type_t type) override;
560 
561  bool IsConst(lldb::opaque_compiler_type_t type) override;
562 
564  uint32_t &length) override;
565 
566  static bool IsCXXClassType(const CompilerType &type);
567 
568  bool IsDefined(lldb::opaque_compiler_type_t type) override;
569 
571  bool &is_complex) override;
572 
573  bool IsFunctionType(lldb::opaque_compiler_type_t type) override;
574 
576  CompilerType *base_type_ptr) override;
577 
578  size_t
580 
582  const size_t index) override;
583 
585 
587  CompilerType *function_pointer_type_ptr) override;
588 
590  bool &is_signed) override;
591 
593  bool &is_signed) override;
594 
596 
597  static bool IsObjCClassType(const CompilerType &type);
598 
599  static bool IsObjCClassTypeAndHasIVars(const CompilerType &type,
600  bool check_superclass);
601 
602  static bool IsObjCObjectOrInterfaceType(const CompilerType &type);
603 
604  static bool IsObjCObjectPointerType(const CompilerType &type,
605  CompilerType *target_type = nullptr);
606 
608 
609  static bool IsClassType(lldb::opaque_compiler_type_t type);
610 
611  static bool IsEnumType(lldb::opaque_compiler_type_t type);
612 
614  CompilerType *target_type, // Can pass nullptr
615  bool check_cplusplus, bool check_objc) override;
616 
618 
620  CompilerType *pointee_type) override;
621 
623  CompilerType *pointee_type) override;
624 
626  CompilerType *pointee_type, bool *is_rvalue) override;
627 
628  bool IsScalarType(lldb::opaque_compiler_type_t type) override;
629 
630  bool IsTypedefType(lldb::opaque_compiler_type_t type) override;
631 
632  bool IsVoidType(lldb::opaque_compiler_type_t type) override;
633 
634  bool CanPassInRegisters(const CompilerType &type) override;
635 
636  bool SupportsLanguage(lldb::LanguageType language) override;
637 
638  static llvm::Optional<std::string> GetCXXClassName(const CompilerType &type);
639 
640  // Type Completion
641 
642  bool GetCompleteType(lldb::opaque_compiler_type_t type) override;
643 
644  // Accessors
645 
647 
649 
651  CompilerType *pointee_or_element_compiler_type) override;
652 
655 
656  lldb::TypeClass GetTypeClass(lldb::opaque_compiler_type_t type) override;
657 
658  unsigned GetTypeQualifiers(lldb::opaque_compiler_type_t type) override;
659 
660  // Creating related types
661 
663  ExecutionContextScope *exe_scope) override;
664 
666  uint64_t size) override;
667 
669 
672 
675 
676  // Returns -1 if this isn't a function of if the function doesn't have a
677  // prototype Returns a value >= 0 if there is a prototype.
679 
681  size_t idx) override;
682 
685 
687 
690  size_t idx) override;
691 
693 
695 
697 
700 
703 
705 
707 
709 
711 
712  /// Using the current type, create a new typedef to that type using
713  /// "typedef_name" as the name and "decl_ctx" as the decl context.
714  /// \param opaque_payload is an opaque TypePayloadClang.
716  const char *name,
717  const CompilerDeclContext &decl_ctx,
718  uint32_t opaque_payload) override;
719 
720  // If the current object represents a typedef type, get the underlying type
722 
723  // Create related types using the current type's AST
724  CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type) override;
725 
726  // Exploring the type
727 
728  const llvm::fltSemantics &GetFloatTypeSemantics(size_t byte_size) override;
729 
730  llvm::Optional<uint64_t> GetByteSize(lldb::opaque_compiler_type_t type,
731  ExecutionContextScope *exe_scope) {
732  if (llvm::Optional<uint64_t> bit_size = GetBitSize(type, exe_scope))
733  return (*bit_size + 7) / 8;
734  return llvm::None;
735  }
736 
737  llvm::Optional<uint64_t>
739  ExecutionContextScope *exe_scope) override;
740 
742  uint64_t &count) override;
743 
745 
746  llvm::Optional<size_t>
748  ExecutionContextScope *exe_scope) override;
749 
751  bool omit_empty_base_classes,
752  const ExecutionContext *exe_ctx) override;
753 
755 
758 
759  static lldb::BasicType
761  ConstString name);
762 
763  void ForEachEnumerator(
765  std::function<bool(const CompilerType &integer_type,
766  ConstString name,
767  const llvm::APSInt &value)> const &callback) override;
768 
770 
772  std::string &name, uint64_t *bit_offset_ptr,
773  uint32_t *bitfield_bit_size_ptr,
774  bool *is_bitfield_ptr) override;
775 
777 
779 
781  size_t idx,
782  uint32_t *bit_offset_ptr) override;
783 
785  size_t idx,
786  uint32_t *bit_offset_ptr) override;
787 
788  static uint32_t GetNumPointeeChildren(clang::QualType type);
789 
791  lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, size_t idx,
792  bool transparent_pointers, bool omit_empty_base_classes,
793  bool ignore_array_bounds, std::string &child_name,
794  uint32_t &child_byte_size, int32_t &child_byte_offset,
795  uint32_t &child_bitfield_bit_size, uint32_t &child_bitfield_bit_offset,
796  bool &child_is_base_class, bool &child_is_deref_of_parent,
797  ValueObject *valobj, uint64_t &language_flags) override;
798 
799  // Lookup a child given a name. This function will match base class names and
800  // member member names in "clang_type" only, not descendants.
802  const char *name,
803  bool omit_empty_base_classes) override;
804 
805  // Lookup a child member given a name. This function will match member names
806  // only and will descend into "clang_type" children in search for the first
807  // member in this class, or any base class that matches "name".
808  // TODO: Return all matches for a given name by returning a
809  // vector<vector<uint32_t>>
810  // so we catch all names that match a given child name, not just the first.
811  size_t
813  const char *name, bool omit_empty_base_classes,
814  std::vector<uint32_t> &child_indexes) override;
815 
817  bool expand_pack) override;
818 
821  bool expand_pack) override;
823  size_t idx, bool expand_pack) override;
824  llvm::Optional<CompilerType::IntegralTemplateArgument>
826  bool expand_pack) override;
827 
828  CompilerType GetTypeForFormatters(void *type) override;
829 
830 #define LLDB_INVALID_DECL_LEVEL UINT32_MAX
831  // LLDB_INVALID_DECL_LEVEL is returned by CountDeclLevels if child_decl_ctx
832  // could not be found in decl_ctx.
833  uint32_t CountDeclLevels(clang::DeclContext *frame_decl_ctx,
834  clang::DeclContext *child_decl_ctx,
835  ConstString *child_name = nullptr,
836  CompilerType *child_type = nullptr);
837 
838  // Modifying RecordType
839  static clang::FieldDecl *AddFieldToRecordType(const CompilerType &type,
840  llvm::StringRef name,
841  const CompilerType &field_type,
842  lldb::AccessType access,
843  uint32_t bitfield_bit_size);
844 
845  static void BuildIndirectFields(const CompilerType &type);
846 
847  static void SetIsPacked(const CompilerType &type);
848 
849  static clang::VarDecl *AddVariableToRecordType(const CompilerType &type,
850  llvm::StringRef name,
851  const CompilerType &var_type,
852  lldb::AccessType access);
853 
854  /// Initializes a variable with an integer value.
855  /// \param var The variable to initialize. Must not already have an
856  /// initializer and must have an integer or enum type.
857  /// \param init_value The integer value that the variable should be
858  /// initialized to. Has to match the bit width of the
859  /// variable type.
860  static void SetIntegerInitializerForVariable(clang::VarDecl *var,
861  const llvm::APInt &init_value);
862 
863  /// Initializes a variable with a floating point value.
864  /// \param var The variable to initialize. Must not already have an
865  /// initializer and must have a floating point type.
866  /// \param init_value The float value that the variable should be
867  /// initialized to.
868  static void
869  SetFloatingInitializerForVariable(clang::VarDecl *var,
870  const llvm::APFloat &init_value);
871 
872  clang::CXXMethodDecl *AddMethodToCXXRecordType(
873  lldb::opaque_compiler_type_t type, llvm::StringRef name,
874  const char *mangled_name, const CompilerType &method_type,
875  lldb::AccessType access, bool is_virtual, bool is_static, bool is_inline,
876  bool is_explicit, bool is_attr_used, bool is_artificial);
877 
879 
880  // C++ Base Classes
881  std::unique_ptr<clang::CXXBaseSpecifier>
883  lldb::AccessType access, bool is_virtual,
884  bool base_of_class);
885 
886  bool TransferBaseClasses(
888  std::vector<std::unique_ptr<clang::CXXBaseSpecifier>> bases);
889 
890  static bool SetObjCSuperClass(const CompilerType &type,
891  const CompilerType &superclass_compiler_type);
892 
893  static bool AddObjCClassProperty(const CompilerType &type,
894  const char *property_name,
895  const CompilerType &property_compiler_type,
896  clang::ObjCIvarDecl *ivar_decl,
897  const char *property_setter_name,
898  const char *property_getter_name,
899  uint32_t property_attributes,
900  ClangASTMetadata *metadata);
901 
902  static clang::ObjCMethodDecl *AddMethodToObjCObjectType(
903  const CompilerType &type,
904  const char *name, // the full symbol name as seen in the symbol table
905  // (lldb::opaque_compiler_type_t type, "-[NString
906  // stringWithCString:]")
907  const CompilerType &method_compiler_type, lldb::AccessType access,
908  bool is_artificial, bool is_variadic, bool is_objc_direct_call);
909 
911  bool has_extern);
912 
913  // Tag Declarations
914  static bool StartTagDeclarationDefinition(const CompilerType &type);
915 
916  static bool CompleteTagDeclarationDefinition(const CompilerType &type);
917 
918  // Modifying Enumeration types
919  clang::EnumConstantDecl *AddEnumerationValueToEnumerationType(
920  const CompilerType &enum_type, const Declaration &decl, const char *name,
921  int64_t enum_value, uint32_t enum_value_bit_size);
922  clang::EnumConstantDecl *AddEnumerationValueToEnumerationType(
923  const CompilerType &enum_type, const Declaration &decl, const char *name,
924  const llvm::APSInt &value);
925 
926  /// Returns the underlying integer type for an enum type. If the given type
927  /// is invalid or not an enum-type, the function returns an invalid
928  /// CompilerType.
929  CompilerType GetEnumerationIntegerType(CompilerType type);
930 
931  // Pointers & References
932 
933  // Call this function using the class type when you want to make a member
934  // pointer type to pointee_type.
935  static CompilerType CreateMemberPointerType(const CompilerType &type,
936  const CompilerType &pointee_type);
937 
938  // Dumping types
939 #ifndef NDEBUG
940  /// Convenience LLVM-style dump method for use in the debugger only.
941  /// In contrast to the other \p Dump() methods this directly invokes
942  /// \p clang::QualType::dump().
943  LLVM_DUMP_METHOD void dump(lldb::opaque_compiler_type_t type) const override;
944 #endif
945 
946  /// \see lldb_private::TypeSystem::Dump
947  void Dump(llvm::raw_ostream &output) override;
948 
949  /// Dump clang AST types from the symbol file.
950  ///
951  /// \param[in] s
952  /// A stream to send the dumped AST node(s) to
953  /// \param[in] symbol_name
954  /// The name of the symbol to dump, if it is empty dump all the symbols
955  void DumpFromSymbolFile(Stream &s, llvm::StringRef symbol_name);
956 
957  void DumpValue(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx,
958  Stream *s, lldb::Format format, const DataExtractor &data,
959  lldb::offset_t data_offset, size_t data_byte_size,
960  uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset,
961  bool show_types, bool show_summary, bool verbose,
962  uint32_t depth) override;
963 
964  bool DumpTypeValue(lldb::opaque_compiler_type_t type, Stream *s,
965  lldb::Format format, const DataExtractor &data,
966  lldb::offset_t data_offset, size_t data_byte_size,
967  uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset,
968  ExecutionContextScope *exe_scope) override;
969 
970  void DumpSummary(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx,
971  Stream *s, const DataExtractor &data,
972  lldb::offset_t data_offset, size_t data_byte_size) override;
973 
974  void DumpTypeDescription(
977 
978  void DumpTypeDescription(
979  lldb::opaque_compiler_type_t type, Stream *s,
981 
982  static void DumpTypeName(const CompilerType &type);
983 
984  static clang::EnumDecl *GetAsEnumDecl(const CompilerType &type);
985 
986  static clang::RecordDecl *GetAsRecordDecl(const CompilerType &type);
987 
988  static clang::TagDecl *GetAsTagDecl(const CompilerType &type);
989 
990  static clang::TypedefNameDecl *GetAsTypedefDecl(const CompilerType &type);
991 
992  static clang::CXXRecordDecl *
994 
995  static clang::ObjCInterfaceDecl *
996  GetAsObjCInterfaceDecl(const CompilerType &type);
997 
998  clang::ClassTemplateDecl *ParseClassTemplateDecl(
999  clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module,
1000  lldb::AccessType access_type, const char *parent_name, int tag_decl_kind,
1001  const TypeSystemClang::TemplateParameterInfos &template_param_infos);
1002 
1003  clang::BlockDecl *CreateBlockDeclaration(clang::DeclContext *ctx,
1004  OptionalClangModuleID owning_module);
1005 
1006  clang::UsingDirectiveDecl *
1007  CreateUsingDirectiveDeclaration(clang::DeclContext *decl_ctx,
1008  OptionalClangModuleID owning_module,
1009  clang::NamespaceDecl *ns_decl);
1010 
1011  clang::UsingDecl *CreateUsingDeclaration(clang::DeclContext *current_decl_ctx,
1012  OptionalClangModuleID owning_module,
1013  clang::NamedDecl *target);
1014 
1015  clang::VarDecl *CreateVariableDeclaration(clang::DeclContext *decl_context,
1016  OptionalClangModuleID owning_module,
1017  const char *name,
1018  clang::QualType type);
1019 
1021  GetOpaqueCompilerType(clang::ASTContext *ast, lldb::BasicType basic_type);
1022 
1023  static clang::QualType GetQualType(lldb::opaque_compiler_type_t type) {
1024  if (type)
1025  return clang::QualType::getFromOpaquePtr(type);
1026  return clang::QualType();
1027  }
1028 
1029  static clang::QualType
1031  if (type)
1032  return clang::QualType::getFromOpaquePtr(type).getCanonicalType();
1033  return clang::QualType();
1034  }
1035 
1036  clang::DeclarationName
1037  GetDeclarationName(llvm::StringRef name,
1038  const CompilerType &function_clang_type);
1039 
1040  clang::LangOptions *GetLangOpts() const {
1041  return m_language_options_up.get();
1042  }
1043  clang::SourceManager *GetSourceMgr() const {
1044  return m_source_manager_up.get();
1045  }
1046 
1047 private:
1048  /// Returns the PrintingPolicy used when generating the internal type names.
1049  /// These type names are mostly used for the formatter selection.
1050  clang::PrintingPolicy GetTypePrintingPolicy();
1051  /// Returns the internal type name for the given NamedDecl using the
1052  /// type printing policy.
1053  std::string GetTypeNameForDecl(const clang::NamedDecl *named_decl);
1054 
1055  const clang::ClassTemplateSpecializationDecl *
1057 
1058  // Classes that inherit from TypeSystemClang can see and modify these
1060  std::unique_ptr<clang::ASTContext> m_ast_up;
1061  std::unique_ptr<clang::LangOptions> m_language_options_up;
1062  std::unique_ptr<clang::FileManager> m_file_manager_up;
1063  std::unique_ptr<clang::SourceManager> m_source_manager_up;
1064  std::unique_ptr<clang::DiagnosticsEngine> m_diagnostics_engine_up;
1065  std::unique_ptr<clang::DiagnosticConsumer> m_diagnostic_consumer_up;
1066  std::shared_ptr<clang::TargetOptions> m_target_options_rp;
1067  std::unique_ptr<clang::TargetInfo> m_target_info_up;
1068  std::unique_ptr<clang::IdentifierTable> m_identifier_table_up;
1069  std::unique_ptr<clang::SelectorTable> m_selector_table_up;
1070  std::unique_ptr<clang::Builtin::Context> m_builtins_up;
1071  std::unique_ptr<clang::HeaderSearch> m_header_search_up;
1072  std::unique_ptr<clang::ModuleMap> m_module_map_up;
1073  std::unique_ptr<DWARFASTParserClang> m_dwarf_ast_parser_up;
1074  std::unique_ptr<PDBASTParser> m_pdb_ast_parser_up;
1075  std::unique_ptr<npdb::PdbAstBuilder> m_native_pdb_ast_parser_up;
1076  std::unique_ptr<clang::MangleContext> m_mangle_ctx_up;
1078  bool m_ast_owned = false;
1079  /// A string describing what this TypeSystemClang represents (e.g.,
1080  /// AST for debug information, an expression, some other utility ClangAST).
1081  /// Useful for logging and debugging.
1083 
1084  typedef llvm::DenseMap<const clang::Decl *, ClangASTMetadata> DeclMetadataMap;
1085  /// Maps Decls to their associated ClangASTMetadata.
1087 
1088  typedef llvm::DenseMap<const clang::Type *, ClangASTMetadata> TypeMetadataMap;
1089  /// Maps Types to their associated ClangASTMetadata.
1091 
1092  typedef llvm::DenseMap<const clang::CXXRecordDecl *, clang::AccessSpecifier>
1094  /// Maps CXXRecordDecl to their most recent added method/field's
1095  /// AccessSpecifier.
1097 
1098  /// The sema associated that is currently used to build this ASTContext.
1099  /// May be null if we are already done parsing this ASTContext or the
1100  /// ASTContext wasn't created by parsing source code.
1101  clang::Sema *m_sema = nullptr;
1102 
1103  // For TypeSystemClang only
1105  const TypeSystemClang &operator=(const TypeSystemClang &);
1106  /// Creates the internal ASTContext.
1107  void CreateASTContext();
1108  void SetTargetTriple(llvm::StringRef target_triple);
1109 };
1110 
1111 /// The TypeSystemClang instance used for the scratch ASTContext in a
1112 /// lldb::Target.
1114  /// LLVM RTTI support
1115  static char ID;
1116 
1117 public:
1118  ScratchTypeSystemClang(Target &target, llvm::Triple triple);
1119 
1120  ~ScratchTypeSystemClang() override = default;
1121 
1122  void Finalize() override;
1123 
1124  /// The different kinds of isolated ASTs within the scratch TypeSystem.
1125  ///
1126  /// These ASTs are isolated from the main scratch AST and are each
1127  /// dedicated to a special language option/feature that makes the contained
1128  /// AST nodes incompatible with other AST nodes.
1130  /// The isolated AST for declarations/types from expressions that imported
1131  /// type information from a C++ module. The templates from a C++ module
1132  /// often conflict with the templates we generate from debug information,
1133  /// so we put these types in their own AST.
1135  };
1136 
1137  /// Alias for requesting the default scratch TypeSystemClang in GetForTarget.
1138  // This isn't constexpr as gtest/llvm::Optional comparison logic is trying
1139  // to get the address of this for pretty-printing.
1140  static const llvm::NoneType DefaultAST;
1141 
1142  /// Infers the appropriate sub-AST from Clang's LangOptions.
1143  static llvm::Optional<IsolatedASTKind>
1144  InferIsolatedASTKindFromLangOpts(const clang::LangOptions &l) {
1145  // If modules are activated we want the dedicated C++ module AST.
1146  // See IsolatedASTKind::CppModules for more info.
1147  if (l.Modules)
1148  return IsolatedASTKind::CppModules;
1149  return DefaultAST;
1150  }
1151 
1152  /// Returns the scratch TypeSystemClang for the given target.
1153  /// \param target The Target which scratch TypeSystemClang should be returned.
1154  /// \param ast_kind Allows requesting a specific sub-AST instead of the
1155  /// default scratch AST. See also `IsolatedASTKind`.
1156  /// \param create_on_demand If the scratch TypeSystemClang instance can be
1157  /// created by this call if it doesn't exist yet. If it doesn't exist yet and
1158  /// this parameter is false, this function returns a nullptr.
1159  /// \return The scratch type system of the target or a nullptr in case an
1160  /// error occurred.
1161  static TypeSystemClang *
1162  GetForTarget(Target &target,
1163  llvm::Optional<IsolatedASTKind> ast_kind = DefaultAST,
1164  bool create_on_demand = true);
1165 
1166  /// Returns the scratch TypeSystemClang for the given target. The returned
1167  /// TypeSystemClang will be the scratch AST or a sub-AST, depending on which
1168  /// fits best to the passed LangOptions.
1169  /// \param target The Target which scratch TypeSystemClang should be returned.
1170  /// \param lang_opts The LangOptions of a clang ASTContext that the caller
1171  /// wants to export type information from. This is used to
1172  /// find the best matching sub-AST that will be returned.
1174  const clang::LangOptions &lang_opts) {
1175  return GetForTarget(target, InferIsolatedASTKindFromLangOpts(lang_opts));
1176  }
1177 
1178  /// \see lldb_private::TypeSystem::Dump
1179  void Dump(llvm::raw_ostream &output) override;
1180 
1181  UserExpression *
1182  GetUserExpression(llvm::StringRef expr, llvm::StringRef prefix,
1183  lldb::LanguageType language,
1184  Expression::ResultType desired_type,
1185  const EvaluateExpressionOptions &options,
1186  ValueObject *ctx_obj) override;
1187 
1188  FunctionCaller *GetFunctionCaller(const CompilerType &return_type,
1189  const Address &function_address,
1190  const ValueList &arg_value_list,
1191  const char *name) override;
1192 
1193  std::unique_ptr<UtilityFunction>
1194  CreateUtilityFunction(std::string text, std::string name) override;
1195 
1197 
1198  /// Unregisters the given ASTContext as a source from the scratch AST (and
1199  /// all sub-ASTs).
1200  /// \see ClangASTImporter::ForgetSource
1201  void ForgetSource(clang::ASTContext *src_ctx, ClangASTImporter &importer);
1202 
1203  // llvm casting support
1204  bool isA(const void *ClassID) const override {
1205  return ClassID == &ID || TypeSystemClang::isA(ClassID);
1206  }
1207  static bool classof(const TypeSystem *ts) { return ts->isA(&ID); }
1208 
1209 private:
1210  std::unique_ptr<ClangASTSource> CreateASTSource();
1211  /// Returns the requested sub-AST.
1212  /// Will lazily create the sub-AST if it hasn't been created before.
1214 
1215  /// The target triple.
1216  /// This was potentially adjusted and might not be identical to the triple
1217  /// of `m_target_wp`.
1218  llvm::Triple m_triple;
1219  lldb::TargetWP m_target_wp;
1220  /// The persistent variables associated with this process for the expression
1221  /// parser.
1222  std::unique_ptr<ClangPersistentVariables> m_persistent_variables;
1223  /// The ExternalASTSource that performs lookups and completes minimally
1224  /// imported types.
1225  std::unique_ptr<ClangASTSource> m_scratch_ast_source_up;
1226 
1227  // FIXME: GCC 5.x doesn't support enum as map keys.
1228  typedef int IsolatedASTKey;
1229 
1230  /// Map from IsolatedASTKind to their actual TypeSystemClang instance.
1231  /// This map is lazily filled with sub-ASTs and should be accessed via
1232  /// `GetSubAST` (which lazily fills this map).
1233  std::unordered_map<IsolatedASTKey, std::unique_ptr<TypeSystemClang>>
1235 };
1236 
1237 } // namespace lldb_private
1238 
1239 #endif // LLDB_SOURCE_PLUGINS_TYPESYSTEM_CLANG_TYPESYSTEMCLANG_H
lldb_private::TypeSystemClang::GetIndexOfChildMemberWithName
size_t GetIndexOfChildMemberWithName(lldb::opaque_compiler_type_t type, const char *name, bool omit_empty_base_classes, std::vector< uint32_t > &child_indexes) override
Definition: TypeSystemClang.cpp:6668
lldb_private::TypeSystemClang::GetNumberOfFunctionArguments
size_t GetNumberOfFunctionArguments(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:3119
lldb_private::TypePayloadClang::ObjCClassBit
static constexpr unsigned ObjCClassBit
Definition: TypeSystemClang.h:83
lldb_private::TypeSystemClang::CreateBlockPointerType
CompilerType CreateBlockPointerType(const CompilerType &function_type)
Definition: TypeSystemClang.cpp:2235
lldb_private::TypeSystemClang::IsPossibleDynamicType
bool IsPossibleDynamicType(lldb::opaque_compiler_type_t type, CompilerType *target_type, bool check_cplusplus, bool check_objc) override
Definition: TypeSystemClang.cpp:3535
lldb_private::TypeSystemClang::IsReferenceType
bool IsReferenceType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type, bool *is_rvalue) override
Definition: TypeSystemClang.cpp:3374
lldb_private::TypeSystemClang::CreateParameterDeclaration
clang::ParmVarDecl * CreateParameterDeclaration(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, const char *name, const CompilerType &param_type, int storage, bool add_decl=false)
Definition: TypeSystemClang.cpp:2210
lldb_private::TypePayloadClang::TypePayloadClang
TypePayloadClang()=default
lldb_private::TypeSystemClang::DeclGetName
ConstString DeclGetName(void *opaque_decl) override
Definition: TypeSystemClang.cpp:9398
lldb_private::TypeSystemClang::CreateBlockDeclaration
clang::BlockDecl * CreateBlockDeclaration(clang::DeclContext *ctx, OptionalClangModuleID owning_module)
Definition: TypeSystemClang.cpp:1922
lldb_private::TypeSystemClang::CreateObjCClass
CompilerType CreateObjCClass(llvm::StringRef name, clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, bool isForwardDecl, bool isInternal, ClangASTMetadata *metadata=nullptr)
Definition: TypeSystemClang.cpp:1809
lldb_private::TypeSystemClang::m_target_triple
std::string m_target_triple
Definition: TypeSystemClang.h:1059
lldb_private::TypeSystemClang::IsScalarType
bool IsScalarType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:3664
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::OptionalClangModuleID::OptionalClangModuleID
OptionalClangModuleID(unsigned id)
Definition: TypeSystemClang.h:62
lldb_private::TypeSystemClang::GetPDBParser
PDBASTParser * GetPDBParser() override
Definition: TypeSystemClang.cpp:9362
lldb_private::TypeSystemClang::m_pdb_ast_parser_up
std::unique_ptr< PDBASTParser > m_pdb_ast_parser_up
Definition: TypeSystemClang.h:1074
ExpressionVariable.h
lldb_private::OptionalClangModuleID::HasValue
bool HasValue() const
Definition: TypeSystemClang.h:63
lldb_private::TypeSystemClang::DumpTypeValue
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) override
Definition: TypeSystemClang.cpp:8973
lldb_private::TypeSystemClang::GetNumPointeeChildren
static uint32_t GetNumPointeeChildren(clang::QualType type)
Definition: TypeSystemClang.cpp:6016
lldb_private::TypeSystemClang::GetAsTagDecl
static clang::TagDecl * GetAsTagDecl(const CompilerType &type)
Definition: TypeSystemClang.cpp:7292
lldb_private::TypeSystemClang::GetAtomicType
CompilerType GetAtomicType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4569
lldb_private::TypeSystemClang::m_diagnostic_consumer_up
std::unique_ptr< clang::DiagnosticConsumer > m_diagnostic_consumer_up
Definition: TypeSystemClang.h:1065
lldb_private::TypeSystemClang::IsCompleteType
bool IsCompleteType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:2971
lldb_private::TypeSystemClang::m_ast_owned
bool m_ast_owned
Definition: TypeSystemClang.h:1078
lldb_private::TypeSystemClang::TransferBaseClasses
bool TransferBaseClasses(lldb::opaque_compiler_type_t type, std::vector< std::unique_ptr< clang::CXXBaseSpecifier >> bases)
Definition: TypeSystemClang.cpp:7825
lldb_private::TypeSystemClang::GetTypeTemplateArgument
CompilerType GetTypeTemplateArgument(lldb::opaque_compiler_type_t type, size_t idx, bool expand_pack) override
Definition: TypeSystemClang.cpp:7241
lldb_private::TypeSystemClang::GetCompilerDecl
CompilerDecl GetCompilerDecl(clang::Decl *decl)
Creates a CompilerDecl from the given Decl with the current TypeSystemClang instance as its typesyste...
Definition: TypeSystemClang.h:465
lldb_private::TypeSystemClang::m_pointer_byte_size
uint32_t m_pointer_byte_size
Definition: TypeSystemClang.h:1077
lldb_private::TypeSystemClang::getASTContext
clang::ASTContext & getASTContext()
Returns the clang::ASTContext instance managed by this TypeSystemClang.
Definition: TypeSystemClang.cpp:687
lldb_private::TypeSystemClang::SetFloatingInitializerForVariable
static void SetFloatingInitializerForVariable(clang::VarDecl *var, const llvm::APFloat &init_value)
Initializes a variable with a floating point value.
Definition: TypeSystemClang.cpp:7595
lldb_private::TypeSystemClang::CreateInstance
static lldb::TypeSystemSP CreateInstance(lldb::LanguageType language, Module *module, Target *target)
Definition: TypeSystemClang.cpp:576
lldb_private::TypeSystemClang::CreateDeclContext
CompilerDeclContext CreateDeclContext(clang::DeclContext *ctx)
Creates a CompilerDeclContext from the given DeclContext with the current TypeSystemClang instance as...
Definition: TypeSystemClang.cpp:1201
lldb::Format
Format
Display format definitions.
Definition: lldb-enumerations.h:155
lldb_private::TypeSystemClang::IsAnonymousType
bool IsAnonymousType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:2823
lldb_private::ScratchTypeSystemClang::GetPersistentExpressionState
PersistentExpressionState * GetPersistentExpressionState() override
Definition: TypeSystemClang.cpp:9942
lldb_private::TypeSystemClang::GetDirectBaseClassAtIndex
CompilerType GetDirectBaseClassAtIndex(lldb::opaque_compiler_type_t type, size_t idx, uint32_t *bit_offset_ptr) override
Definition: TypeSystemClang.cpp:5873
lldb_private::TypeSystemClang::GetNonReferenceType
CompilerType GetNonReferenceType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4521
lldb_private::TypeSystemClang::GetSupportedLanguagesForExpressions
static LanguageSet GetSupportedLanguagesForExpressions()
Definition: TypeSystemClang.cpp:630
lldb_private::TypeSystemClang::CreateTemplateTemplateParmDecl
clang::TemplateTemplateParmDecl * CreateTemplateTemplateParmDecl(const char *template_name)
Definition: TypeSystemClang.cpp:1641
lldb_private::TypeSystemClang::GetNativePDBParser
npdb::PdbAstBuilder * GetNativePDBParser() override
Definition: TypeSystemClang.cpp:9368
lldb_private::TypeSystemClang::GetIntTypeFromBitSize
CompilerType GetIntTypeFromBitSize(size_t bit_size, bool is_signed)
Definition: TypeSystemClang.cpp:2338
lldb_private::TypeSystemClang::m_language_options_up
std::unique_ptr< clang::LangOptions > m_language_options_up
Definition: TypeSystemClang.h:1061
lldb_private::TypeSystemClang::GetPointerByteSize
uint32_t GetPointerByteSize() override
Definition: TypeSystemClang.cpp:922
lldb_private::TypeSystemClang::DeclContextGetScopeQualifiedName
ConstString DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) override
Definition: TypeSystemClang.cpp:9676
lldb_private::TypeSystemClang::GetMetadata
ClangASTMetadata * GetMetadata(const clang::Decl *object)
Definition: TypeSystemClang.cpp:2566
lldb_private::TypeSystemClang::m_builtins_up
std::unique_ptr< clang::Builtin::Context > m_builtins_up
Definition: TypeSystemClang.h:1070
lldb_private::TypeSystemClang::AddRestrictModifier
CompilerType AddRestrictModifier(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4596
lldb_private::TypeSystemClang::CreateFunctionDeclaration
clang::FunctionDecl * CreateFunctionDeclaration(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, llvm::StringRef name, const CompilerType &function_Type, clang::StorageClass storage, bool is_inline)
Definition: TypeSystemClang.cpp:2140
lldb_private::TypeSystemClang::GetTranslationUnitDecl
clang::TranslationUnitDecl * GetTranslationUnitDecl()
Definition: TypeSystemClang.h:224
lldb_private::TypeSystemClang::GetFullyUnqualifiedType
CompilerType GetFullyUnqualifiedType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4292
lldb_private::TypeSystemClang::DeclContextGetMetaData
static ClangASTMetadata * DeclContextGetMetaData(const CompilerDeclContext &dc, const clang::Decl *object)
Definition: TypeSystemClang.cpp:9787
lldb_private::TypeSystemClang::GetArrayType
CompilerType GetArrayType(lldb::opaque_compiler_type_t type, uint64_t size) override
Definition: TypeSystemClang.cpp:4248
lldb_private::TypeSystemClang::GetNumTemplateArguments
size_t GetNumTemplateArguments(lldb::opaque_compiler_type_t type, bool expand_pack) override
Definition: TypeSystemClang.cpp:7103
lldb_private::ScratchTypeSystemClang::IsolatedASTKey
int IsolatedASTKey
Definition: TypeSystemClang.h:1228
lldb_private::TypeSystemClang::GetASTContext
static TypeSystemClang * GetASTContext(clang::ASTContext *ast_ctx)
Definition: TypeSystemClang.cpp:759
lldb_private::OptionalClangModuleID::GetValue
unsigned GetValue() const
Definition: TypeSystemClang.h:64
lldb_private::TypeSystemClang::m_target_info_up
std::unique_ptr< clang::TargetInfo > m_target_info_up
Definition: TypeSystemClang.h:1067
lldb_private::TypeSystemClang::GetNumBaseClasses
static uint32_t GetNumBaseClasses(const clang::CXXRecordDecl *cxx_record_decl, bool omit_empty_base_classes)
Definition: TypeSystemClang.cpp:1836
lldb_private::TypeSystemClang::CreateFunctionType
CompilerType CreateFunctionType(const CompilerType &result_type, const CompilerType *args, unsigned num_args, bool is_variadic, unsigned type_quals, clang::CallingConv cc=clang::CC_C, clang::RefQualifierKind ref_qual=clang::RQ_None)
Definition: TypeSystemClang.cpp:2172
lldb_private::Flags::Clear
ValueType Clear(ValueType mask=~static_cast< ValueType >(0))
Clear one or more flags.
Definition: Flags.h:61
lldb_private::TypeSystemClang::GetBuiltinTypeForEncodingAndBitSize
CompilerType GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size) override
Definition: TypeSystemClang.cpp:796
lldb_private::ScratchTypeSystemClang::CppModules
@ CppModules
The isolated AST for declarations/types from expressions that imported type information from a C++ mo...
Definition: TypeSystemClang.h:1134
lldb_private::ScratchTypeSystemClang::ScratchTypeSystemClang
ScratchTypeSystemClang(Target &target, llvm::Triple triple)
Definition: TypeSystemClang.cpp:9832
lldb_private::TypeSystemClang::IsArrayType
bool IsArrayType(lldb::opaque_compiler_type_t type, CompilerType *element_type, uint64_t *size, bool *is_incomplete) override
Definition: TypeSystemClang.cpp:2845
lldb_private::TypeSystemClang::IsConst
bool IsConst(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:2982
lldb_private::TypeSystemClang::GetCanonicalQualType
static clang::QualType GetCanonicalQualType(lldb::opaque_compiler_type_t type)
Definition: TypeSystemClang.h:1030
lldb_private::ScratchTypeSystemClang::m_triple
llvm::Triple m_triple
The target triple.
Definition: TypeSystemClang.h:1218
lldb_private::EvaluateExpressionOptions
Definition: Target.h:277
lldb_private::ScratchTypeSystemClang::m_scratch_ast_source_up
std::unique_ptr< ClangASTSource > m_scratch_ast_source_up
The ExternalASTSource that performs lookups and completes minimally imported types.
Definition: TypeSystemClang.h:1225
lldb_private::TypeSystemClang::CreateEnumerationType
CompilerType CreateEnumerationType(llvm::StringRef name, clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, const Declaration &decl, const CompilerType &integer_qual_type, bool is_scoped)
Definition: TypeSystemClang.cpp:2309
lldb_private::ScratchTypeSystemClang::DefaultAST
static const llvm::NoneType DefaultAST
Alias for requesting the default scratch TypeSystemClang in GetForTarget.
Definition: TypeSystemClang.h:1140
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::Flags
Definition: Flags.h:22
lldb_private::TypeSystemClang::DeclContextIsContainedInLookup
bool DeclContextIsContainedInLookup(void *opaque_decl_ctx, void *other_opaque_decl_ctx) override
Definition: TypeSystemClang.cpp:9726
lldb_private::TypeSystemClang::getSema
clang::Sema * getSema()
Definition: TypeSystemClang.h:171
lldb_private::TypeSystemClang::m_target_options_rp
std::shared_ptr< clang::TargetOptions > m_target_options_rp
Definition: TypeSystemClang.h:1066
lldb_private::CompilerDecl
Represents a generic declaration such as a function declaration.
Definition: CompilerDecl.h:28
lldb_private::Module
Definition: Module.h:85
lldb_private::TypeSystemClang::m_dwarf_ast_parser_up
std::unique_ptr< DWARFASTParserClang > m_dwarf_ast_parser_up
Definition: TypeSystemClang.h:1073
lldb_private::TypeSystemClang::GetTypeForIdentifier
CompilerType GetTypeForIdentifier(ConstString type_name, clang::DeclContext *decl_context=nullptr)
Definition: TypeSystemClang.h:255
lldb_private::ScratchTypeSystemClang::isA
bool isA(const void *ClassID) const override
Definition: TypeSystemClang.h:1204
lldb_private::TypeSystemClang::LayoutRecordType
bool LayoutRecordType(const clang::RecordDecl *record_decl, uint64_t &size, uint64_t &alignment, llvm::DenseMap< const clang::FieldDecl *, uint64_t > &field_offsets, llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > &base_offsets, llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > &vbase_offsets)
Definition: TypeSystemClang.cpp:9374
lldb::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
lldb_private::Flags::Test
bool Test(ValueType bit) const
Test a single flag bit.
Definition: Flags.h:96
lldb_private::TypeSystemClang::GetBuiltinTypeByName
CompilerType GetBuiltinTypeByName(ConstString name) override
Definition: TypeSystemClang.cpp:5476
lldb_private::ValueList
Definition: Value.h:157
lldb_private::TypeSystemClang::IsPointerOrReferenceType
bool IsPointerOrReferenceType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type) override
Definition: TypeSystemClang.cpp:3309
lldb_private::TypeSystemClang::IsObjCObjectPointerType
static bool IsObjCObjectPointerType(const CompilerType &type, CompilerType *target_type=nullptr)
Definition: TypeSystemClang.cpp:3730
lldb_private::TypeSystemClang::m_selector_table_up
std::unique_ptr< clang::SelectorTable > m_selector_table_up
Definition: TypeSystemClang.h:1069
lldb_private::TypeSystemClang::m_ast_up
std::unique_ptr< clang::ASTContext > m_ast_up
Definition: TypeSystemClang.h:1060
lldb_private::TypePayloadClang::GetOwningModule
OptionalClangModuleID GetOwningModule()
Definition: TypeSystemClang.h:89
lldb_private::UserExpression
Definition: UserExpression.h:35
lldb_private::TypePayloadClang::SetIsCompleteObjCClass
void SetIsCompleteObjCClass(bool is_complete_objc_class)
Definition: TypeSystemClang.h:85
lldb_private::TypeSystemClang::GetNumChildren
uint32_t GetNumChildren(lldb::opaque_compiler_type_t type, bool omit_empty_base_classes, const ExecutionContext *exe_ctx) override
Definition: TypeSystemClang.cpp:5322
lldb_private::TypeSystemClang::IsFunctionPointerType
bool IsFunctionPointerType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:3146
lldb_private::TypeSystemClang::AddVariableToRecordType
static clang::VarDecl * AddVariableToRecordType(const CompilerType &type, llvm::StringRef name, const CompilerType &var_type, lldb::AccessType access)
Definition: TypeSystemClang.cpp:7540
lldb_private::TypePayloadClang
The implementation of lldb::Type's m_payload field for TypeSystemClang.
Definition: TypeSystemClang.h:68
lldb::BasicType
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
Definition: lldb-enumerations.h:747
lldb_private::TypeSystemClang::m_file_manager_up
std::unique_ptr< clang::FileManager > m_file_manager_up
Definition: TypeSystemClang.h:1062
lldb_private::TypeSystemClang::GetTypeNameForDecl
std::string GetTypeNameForDecl(const clang::NamedDecl *named_decl)
Returns the internal type name for the given NamedDecl using the type printing policy.
Definition: TypeSystemClang.cpp:2132
lldb_private::TypeSystem::isA
virtual bool isA(const void *ClassID) const =0
lldb_private::TypeSystemClang::DeclContextGetAsCXXMethodDecl
static clang::CXXMethodDecl * DeclContextGetAsCXXMethodDecl(const CompilerDeclContext &dc)
Definition: TypeSystemClang.cpp:9763
lldb_private::Target
Definition: Target.h:469
lldb_private::TypeSystemClang::DeclContextFindDeclByName
std::vector< CompilerDecl > DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString name, const bool ignore_using_decls) override
Definition: TypeSystemClang.cpp:9486
lldb_private::TypeSystemClang::DeclsAreEquivalent
static bool DeclsAreEquivalent(clang::Decl *lhs_decl, clang::Decl *rhs_decl)
Definition: TypeSystemClang.cpp:2423
lldb_private::TypeSystemClang::GetAsEnumDecl
static clang::EnumDecl * GetAsEnumDecl(const CompilerType &type)
Definition: TypeSystemClang.cpp:7276
lldb_private::TypeSystemClang::GetFloatTypeSemantics
const llvm::fltSemantics & GetFloatTypeSemantics(size_t byte_size) override
Definition: TypeSystemClang.cpp:4666
lldb_private::TypeSystemClang::CreateArrayType
CompilerType CreateArrayType(const CompilerType &element_type, size_t element_count, bool is_vector)
Definition: TypeSystemClang.cpp:2244
lldb_private::TypeSystemClang::GetPluginNameStatic
static llvm::StringRef GetPluginNameStatic()
Definition: TypeSystemClang.h:143
lldb_private::TypeSystemClang::GetNumDirectBaseClasses
uint32_t GetNumDirectBaseClasses(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:5801
lldb_private::TypeSystemClang::Initialize
static void Initialize()
Definition: TypeSystemClang.cpp:640
lldb_private::TypeSystemClang::IsCStringType
bool IsCStringType(lldb::opaque_compiler_type_t type, uint32_t &length) override
Definition: TypeSystemClang.cpp:2986
lldb_private::TypeSystemClang::CompleteObjCInterfaceDecl
void CompleteObjCInterfaceDecl(clang::ObjCInterfaceDecl *)
Definition: TypeSystemClang.cpp:9346
lldb_private::Expression::ResultType
ResultType
Definition: Expression.h:35
lldb_private::TypeSystemClang::ConvertAccessTypeToAccessSpecifier
static clang::AccessSpecifier ConvertAccessTypeToAccessSpecifier(lldb::AccessType access)
Definition: TypeSystemClang.cpp:441
Target.h
lldb_private::ScratchTypeSystemClang::~ScratchTypeSystemClang
~ScratchTypeSystemClang() override=default
lldb_private::TypeSystemClang::CreateStructForIdentifier
CompilerType CreateStructForIdentifier(ConstString type_name, const std::initializer_list< std::pair< const char *, CompilerType >> &type_fields, bool packed=false)
Definition: TypeSystemClang.cpp:2269
lldb_private::TypeSystemClang::m_module_map_up
std::unique_ptr< clang::ModuleMap > m_module_map_up
Definition: TypeSystemClang.h:1072
lldb_private::TypeSystemClang::GetBasicTypeFromAST
CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type) override
Definition: TypeSystemClang.cpp:4660
lldb_private::OptionalClangModuleID::m_id
unsigned m_id
Definition: TypeSystemClang.h:58
lldb_private::TypeSystemClang::DeclContextGetAsFunctionDecl
static clang::FunctionDecl * DeclContextGetAsFunctionDecl(const CompilerDeclContext &dc)
Definition: TypeSystemClang.cpp:9771
lldb_private::TypeSystemClang::DumpDeclContextHiearchy
static void DumpDeclContextHiearchy(clang::DeclContext *decl_ctx)
Definition: TypeSystemClang.cpp:2387
lldb_private::ScratchTypeSystemClang::m_isolated_asts
std::unordered_map< IsolatedASTKey, std::unique_ptr< TypeSystemClang > > m_isolated_asts
Map from IsolatedASTKind to their actual TypeSystemClang instance.
Definition: TypeSystemClang.h:1234
lldb_private::TypeSystemClang::m_sema
clang::Sema * m_sema
The sema associated that is currently used to build this ASTContext.
Definition: TypeSystemClang.h:1101
lldb_private::TypeSystemClang::GetMinimumLanguage
lldb::LanguageType GetMinimumLanguage(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4009
lldb_private::TypeSystemClang::m_display_name
std::string m_display_name
A string describing what this TypeSystemClang represents (e.g., AST for debug information,...
Definition: TypeSystemClang.h:1082
lldb_private::TypeSystemClang::CreateTypedef
CompilerType CreateTypedef(lldb::opaque_compiler_type_t type, const char *name, const CompilerDeclContext &decl_ctx, uint32_t opaque_payload) override
Using the current type, create a new typedef to that type using "typedef_name" as the name and "decl_...
Definition: TypeSystemClang.cpp:4605
lldb_private::TypeSystemClang::CompleteTagDecl
void CompleteTagDecl(clang::TagDecl *)
Definition: TypeSystemClang.cpp:9337
lldb_private::TypeSystemClang::m_source_manager_up
std::unique_ptr< clang::SourceManager > m_source_manager_up
Definition: TypeSystemClang.h:1063
lldb_private::TypeSystemClang::getMangleContext
clang::MangleContext * getMangleContext()
Definition: TypeSystemClang.cpp:764
lldb_private::TypeSystemClang::operator=
const TypeSystemClang & operator=(const TypeSystemClang &)
lldb_private::TypeSystemClang::GetFloatTypeFromBitSize
static CompilerType GetFloatTypeFromBitSize(clang::ASTContext *ast, size_t bit_size)
lldb_private::TypeSystemClang::DeclContextGetAsNamespaceDecl
static clang::NamespaceDecl * DeclContextGetAsNamespaceDecl(const CompilerDeclContext &dc)
Definition: TypeSystemClang.cpp:9779
lldb_private::TypeSystemClang::DeclContextGetAsObjCMethodDecl
static clang::ObjCMethodDecl * DeclContextGetAsObjCMethodDecl(const CompilerDeclContext &dc)
Definition: TypeSystemClang.cpp:9755
lldb_private::TypeSystemClang::IsCXXClassType
static bool IsCXXClassType(const CompilerType &type)
Definition: TypeSystemClang.cpp:3712
lldb_private::TypeSystemClang::GetAsCXXRecordDecl
static clang::CXXRecordDecl * GetAsCXXRecordDecl(lldb::opaque_compiler_type_t type)
Definition: TypeSystemClang.cpp:7306
lldb_private::ScratchTypeSystemClang::Finalize
void Finalize() override
Definition: TypeSystemClang.cpp:9845
lldb_private::TypeSystemClang::IsCharType
bool IsCharType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:2967
lldb_private::TypeSystemClang::DeclContextGetTypeSystemClang
static clang::ASTContext * DeclContextGetTypeSystemClang(const CompilerDeclContext &dc)
Definition: TypeSystemClang.cpp:9794
Log.h
lldb_private::ExecutionContextScope
Definition: ExecutionContextScope.h:32
lldb_private::TypeSystemClang::IsObjCObjectOrInterfaceType
static bool IsObjCObjectOrInterfaceType(const CompilerType &type)
Definition: TypeSystemClang.cpp:3487
lldb_private::TypeSystemClang::GetFunctionReturnType
CompilerType GetFunctionReturnType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4332
lldb_private::TypeSystemClang::CreateClassTemplateDecl
clang::ClassTemplateDecl * CreateClassTemplateDecl(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, lldb::AccessType access_type, llvm::StringRef class_name, int kind, const TemplateParameterInfos &infos)
Definition: TypeSystemClang.cpp:1568
lldb_private::TypeSystemClang::GetFormat
lldb::Format GetFormat(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:5142
lldb_private::TypeSystemClang::AddFieldToRecordType
static clang::FieldDecl * AddFieldToRecordType(const CompilerType &type, llvm::StringRef name, const CompilerType &field_type, lldb::AccessType access, uint32_t bitfield_bit_size)
Definition: TypeSystemClang.cpp:7320
lldb_private::TypeSystemClang::GetFunctionArgumentCount
int GetFunctionArgumentCount(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4306
lldb_private::TypeSystemClang::GetCStringType
CompilerType GetCStringType(bool is_const)
Definition: TypeSystemClang.cpp:1160
lldb_private::ScratchTypeSystemClang::Dump
void Dump(llvm::raw_ostream &output) override
Definition: TypeSystemClang.cpp:9880
lldb_private::TypeSystemClang::IsOperator
static bool IsOperator(llvm::StringRef name, clang::OverloadedOperatorKind &op_kind)
Definition: TypeSystemClang.cpp:360
lldb_private::TypeSystemClang::CreateASTContext
void CreateASTContext()
Creates the internal ASTContext.
Definition: TypeSystemClang.cpp:714
lldb_private::TypeSystemClang::SetMetadata
void SetMetadata(const clang::Decl *object, ClangASTMetadata &meta_data)
Definition: TypeSystemClang.cpp:2556
lldb_private::TypeSystemClang::TemplateParameterInfos::hasParameterPack
bool hasParameterPack() const
Definition: TypeSystemClang.h:334
lldb_private::TypeSystemClang::SetObjCSuperClass
static bool SetObjCSuperClass(const CompilerType &type, const CompilerType &superclass_compiler_type)
Definition: TypeSystemClang.cpp:7844
lldb_private::TypeSystemClang::GetNumMemberFunctions
size_t GetNumMemberFunctions(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4344
ClangPersistentVariables.h
lldb_private::TypeSystemClang::GetFunctionArgumentTypeAtIndex
CompilerType GetFunctionArgumentTypeAtIndex(lldb::opaque_compiler_type_t type, size_t idx) override
Definition: TypeSystemClang.cpp:4317
lldb_private::TypeSystemClang::ForEachEnumerator
void ForEachEnumerator(lldb::opaque_compiler_type_t type, std::function< bool(const CompilerType &integer_type, ConstString name, const llvm::APSInt &value)> const &callback) override
Definition: TypeSystemClang.cpp:5555
lldb_private::TypeSystemClang::getDisplayName
llvm::StringRef getDisplayName() const
Returns the display name of this TypeSystemClang that indicates what purpose it serves in LLDB.
Definition: TypeSystemClang.h:159
lldb_private::ScratchTypeSystemClang::classof
static bool classof(const TypeSystem *ts)
Definition: TypeSystemClang.h:1207
lldb_private::TypeSystemClang::GetDWARFParser
DWARFASTParser * GetDWARFParser() override
Definition: TypeSystemClang.cpp:9356
lldb_private::TypeSystemClang::GetTemplateArgumentKind
lldb::TemplateArgumentKind GetTemplateArgumentKind(lldb::opaque_compiler_type_t type, size_t idx, bool expand_pack) override
Definition: TypeSystemClang.cpp:7198
lldb_private::ConstString
Definition: ConstString.h:39
lldb_private::TypeSystemClang::GetIntegralTemplateArgument
llvm::Optional< CompilerType::IntegralTemplateArgument > GetIntegralTemplateArgument(lldb::opaque_compiler_type_t type, size_t idx, bool expand_pack) override
Definition: TypeSystemClang.cpp:7256
lldb_private::TypeSystemClang::GetTypeForDecl
CompilerType GetTypeForDecl(clang::NamedDecl *decl)
Definition: TypeSystemClang.cpp:1207
lldb_private::TypeSystemClang::IsObjCClassTypeAndHasIVars
static bool IsObjCClassTypeAndHasIVars(const CompilerType &type, bool check_superclass)
Definition: TypeSystemClang.cpp:8072
lldb::eDescriptionLevelFull
@ eDescriptionLevelFull
Definition: lldb-enumerations.h:209
lldb-enumerations.h
lldb_private::ScratchTypeSystemClang::GetUserExpression
UserExpression * GetUserExpression(llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language, Expression::ResultType desired_type, const EvaluateExpressionOptions &options, ValueObject *ctx_obj) override
Definition: TypeSystemClang.cpp:9902
lldb_private::TypeSystemClang::SetTargetTriple
void SetTargetTriple(llvm::StringRef target_triple)
Definition: TypeSystemClang.cpp:676
lldb_private::TypeSystemClang::GetTypeBitAlign
llvm::Optional< size_t > GetTypeBitAlign(lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope) override
Definition: TypeSystemClang.cpp:4747
lldb_private::TypeSystemClang::GetNumFields
uint32_t GetNumFields(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:5581
lldb_private::TypeSystemClang::GetOrCreateStructForIdentifier
CompilerType GetOrCreateStructForIdentifier(ConstString type_name, const std::initializer_list< std::pair< const char *, CompilerType >> &type_fields, bool packed=false)
Definition: TypeSystemClang.cpp:2295
lldb_private::ScratchTypeSystemClang::GetForTarget
static TypeSystemClang * GetForTarget(Target &target, const clang::LangOptions &lang_opts)
Returns the scratch TypeSystemClang for the given target.
Definition: TypeSystemClang.h:1173
lldb_private::TypeSystemClang::CheckOverloadedOperatorKindParameterCount
static bool CheckOverloadedOperatorKindParameterCount(bool is_method, clang::OverloadedOperatorKind op_kind, uint32_t num_params)
Definition: TypeSystemClang.cpp:1726
lldb_private::TypeSystemClang::CreateClassTemplateSpecializationType
CompilerType CreateClassTemplateSpecializationType(clang::ClassTemplateSpecializationDecl *class_template_specialization_decl)
Definition: TypeSystemClang.cpp:1698
lldb_private::TypeSystemClang::DeclGetFunctionArgumentType
CompilerType DeclGetFunctionArgumentType(void *opaque_decl, size_t arg_idx) override
Definition: TypeSystemClang.cpp:9466
lldb_private::TypeSystemClang::IsIntegerType
bool IsIntegerType(lldb::opaque_compiler_type_t type, bool &is_signed) override
Definition: TypeSystemClang.cpp:3208
lldb_private::TypeSystemClang::GetTypeQualifiers
unsigned GetTypeQualifiers(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4223
lldb_private::TypeSystemClang::m_identifier_table_up
std::unique_ptr< clang::IdentifierTable > m_identifier_table_up
Definition: TypeSystemClang.h:1068
lldb_private::TypeSystemClang::AddObjCClassProperty
static bool AddObjCClassProperty(const CompilerType &type, const char *property_name, const CompilerType &property_compiler_type, clang::ObjCIvarDecl *ivar_decl, const char *property_setter_name, const char *property_getter_name, uint32_t property_attributes, ClangASTMetadata *metadata)
Definition: TypeSystemClang.cpp:7867
lldb_private::TypeSystemClang::TemplateParameterInfos::IsValid
bool IsValid() const
Definition: TypeSystemClang.h:325
lldb_private::ScratchTypeSystemClang::CreateUtilityFunction
std::unique_ptr< UtilityFunction > CreateUtilityFunction(std::string text, std::string name) override
Definition: TypeSystemClang.cpp:9930
lldb_private::TypeSystemClang::GetUniqueNamespaceDeclaration
clang::NamespaceDecl * GetUniqueNamespaceDeclaration(const char *name, clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, bool is_inline=false)
Definition: TypeSystemClang.cpp:1858
lldb_private::TypeSystemClang::GetLValueReferenceType
CompilerType GetLValueReferenceType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4554
lldb_private::TypeSystemClang::GetPointerType
CompilerType GetPointerType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4537
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::TypeSystemClang::TemplateParameterInfos::pack_name
const char * pack_name
Definition: TypeSystemClang.h:339
lldb_private::ScratchTypeSystemClang::GetIsolatedAST
TypeSystemClang & GetIsolatedAST(IsolatedASTKind feature)
Returns the requested sub-AST.
Definition: TypeSystemClang.cpp:9970
lldb_private::TypeSystemClang::GetBuiltinTypeForDWARFEncodingAndBitSize
CompilerType GetBuiltinTypeForDWARFEncodingAndBitSize(llvm::StringRef type_name, uint32_t dw_ate, uint32_t bit_size)
Definition: TypeSystemClang.cpp:942
lldb_private::ConstString::GetLength
size_t GetLength() const
Get the length in bytes of string value.
Definition: ConstString.cpp:237
lldb_private::ClangASTMetadata
Definition: ClangASTMetadata.h:18
lldb_private::TypeSystemClang::GetPluginName
llvm::StringRef GetPluginName() override
Definition: TypeSystemClang.h:141
lldb_private::TypeSystemClang::IsEnumerationType
bool IsEnumerationType(lldb::opaque_compiler_type_t type, bool &is_signed) override
Definition: TypeSystemClang.cpp:3227
TypeSystem.h
lldb_private::TypeSystemClang::GetAsDeclContext
static clang::DeclContext * GetAsDeclContext(clang::FunctionDecl *function_decl)
lldb_private::TypeSystemClang::m_diagnostics_engine_up
std::unique_ptr< clang::DiagnosticsEngine > m_diagnostics_engine_up
Definition: TypeSystemClang.h:1064
lldb::TemplateArgumentKind
TemplateArgumentKind
Definition: lldb-enumerations.h:821
CompilerType.h
lldb_private::TypeSystemClang::CountDeclLevels
uint32_t CountDeclLevels(clang::DeclContext *frame_decl_ctx, clang::DeclContext *child_decl_ctx, ConstString *child_name=nullptr, CompilerType *child_type=nullptr)
Definition: TypeSystemClang.cpp:9583
lldb_private::TypeSystemClang::GetOrCreateClangModule
OptionalClangModuleID GetOrCreateClangModule(llvm::StringRef name, OptionalClangModuleID parent, bool is_framework=false, bool is_explicit=false)
Synthesize a clang::Module and return its ID or a default-constructed ID.
Definition: TypeSystemClang.cpp:1237
lldb_private::TypeSystemClang::m_cxx_record_decl_access
CXXRecordDeclAccessMap m_cxx_record_decl_access
Maps CXXRecordDecl to their most recent added method/field's AccessSpecifier.
Definition: TypeSystemClang.h:1096
lldb_private::TypeSystemClang::SetOwningModule
static void SetOwningModule(clang::Decl *decl, OptionalClangModuleID owning_module)
Set the owning module for decl.
Definition: TypeSystemClang.cpp:1226
lldb_private::TypeSystemClang::GetAsObjCInterfaceDecl
static clang::ObjCInterfaceDecl * GetAsObjCInterfaceDecl(const CompilerType &type)
Definition: TypeSystemClang.cpp:7311
lldb_private::CompilerDeclContext
Represents a generic declaration context in a program.
Definition: CompilerDeclContext.h:30
lldb_private::TypeSystemClang::SetIsPacked
static void SetIsPacked(const CompilerType &type)
Definition: TypeSystemClang.cpp:7524
lldb_private::TypeSystemClang::GetCXXRecordDeclAccess
clang::AccessSpecifier GetCXXRecordDeclAccess(const clang::CXXRecordDecl *object)
Definition: TypeSystemClang.cpp:2589
lldb_private::TypePayloadClang::TypePayloadClang
TypePayloadClang(uint32_t opaque_payload)
Definition: TypeSystemClang.h:80
lldb_private::TypeSystemClang::GetTypeInfo
uint32_t GetTypeInfo(lldb::opaque_compiler_type_t type, CompilerType *pointee_or_element_compiler_type) override
Definition: TypeSystemClang.cpp:3808
lldb_private::TypeSystemClang::GetType
CompilerType GetType(clang::QualType qt)
Creates a CompilerType form the given QualType with the current TypeSystemClang instance as the Compi...
Definition: TypeSystemClang.h:238
lldb_private::ScratchTypeSystemClang::InferIsolatedASTKindFromLangOpts
static llvm::Optional< IsolatedASTKind > InferIsolatedASTKindFromLangOpts(const clang::LangOptions &l)
Infers the appropriate sub-AST from Clang's LangOptions.
Definition: TypeSystemClang.h:1144
lldb_private::TypeSystemClang::getTargetInfo
clang::TargetInfo * getTargetInfo()
Definition: TypeSystemClang.cpp:779
lldb_private::TypeSystemClang::IsVectorType
bool IsVectorType(lldb::opaque_compiler_type_t type, CompilerType *element_type, uint64_t *size) override
Definition: TypeSystemClang.cpp:2914
lldb_private::TypeSystemClang::AddMethodOverridesForCXXRecordType
void AddMethodOverridesForCXXRecordType(lldb::opaque_compiler_type_t type)
Definition: TypeSystemClang.cpp:7802
lldb_private::ScratchTypeSystemClang::IsolatedASTKind
IsolatedASTKind
The different kinds of isolated ASTs within the scratch TypeSystem.
Definition: TypeSystemClang.h:1129
lldb_private::TypeSystemClang::DumpSummary
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) override
Definition: TypeSystemClang.cpp:9097
lldb_private::TypeSystemClang::GetTypeForFormatters
CompilerType GetTypeForFormatters(void *type) override
Definition: TypeSystemClang.cpp:7270
lldb_private::TypeSystemClang::GetTypedefedType
CompilerType GetTypedefedType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4648
lldb_private::TypeSystemClang::GetAsTemplateSpecialization
const clang::ClassTemplateSpecializationDecl * GetAsTemplateSpecialization(lldb::opaque_compiler_type_t type)
Definition: TypeSystemClang.cpp:7142
lldb_private::TypeSystemClang::SetFunctionParameters
void SetFunctionParameters(clang::FunctionDecl *function_decl, llvm::ArrayRef< clang::ParmVarDecl * > params)
Definition: TypeSystemClang.cpp:2228
lldb_private::TypeSystemClang::GetOpaqueCompilerType
static lldb::opaque_compiler_type_t GetOpaqueCompilerType(clang::ASTContext *ast, lldb::BasicType basic_type)
Definition: TypeSystemClang.cpp:2009
lldb_private::TypeSystemClang::UnifyAccessSpecifiers
static clang::AccessSpecifier UnifyAccessSpecifiers(clang::AccessSpecifier lhs, clang::AccessSpecifier rhs)
Definition: TypeSystemClang.cpp:1752
lldb_private::ScratchTypeSystemClang::ForgetSource
void ForgetSource(clang::ASTContext *src_ctx, ClangASTImporter &importer)
Unregisters the given ASTContext as a source from the scratch AST (and all sub-ASTs).
Definition: TypeSystemClang.cpp:9946
lldb_private::TypeSystemClang::AreTypesSame
static bool AreTypesSame(CompilerType type1, CompilerType type2, bool ignore_qualifiers=false)
Definition: TypeSystemClang.cpp:1170
lldb_private::TypeSystemClang::GetIndexOfChildWithName
uint32_t GetIndexOfChildWithName(lldb::opaque_compiler_type_t type, const char *name, bool omit_empty_base_classes) override
Definition: TypeSystemClang.cpp:6908
lldb_private::TypeSystemClang::IsFloatingPointType
bool IsFloatingPointType(lldb::opaque_compiler_type_t type, uint32_t &count, bool &is_complex) override
Definition: TypeSystemClang.cpp:3410
lldb_private::TypeSystemClang::SetCXXRecordDeclAccess
void SetCXXRecordDeclAccess(const clang::CXXRecordDecl *object, clang::AccessSpecifier access)
Definition: TypeSystemClang.cpp:2580
DWARFASTParserClang
Definition: DWARFASTParserClang.h:38
lldb_private::TypeSystemClang::GetRValueReferenceType
CompilerType GetRValueReferenceType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4562
lldb_private::TypeSystemClang::ParseClassTemplateDecl
clang::ClassTemplateDecl * ParseClassTemplateDecl(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, lldb::AccessType access_type, const char *parent_name, int tag_decl_kind, const TypeSystemClang::TemplateParameterInfos &template_param_infos)
Definition: TypeSystemClang.cpp:9322
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
lldb_private::TypeSystemClang::RecordHasFields
static bool RecordHasFields(const clang::RecordDecl *record_decl)
Definition: TypeSystemClang.cpp:1784
lldb_private::ScratchTypeSystemClang
The TypeSystemClang instance used for the scratch ASTContext in a lldb::Target.
Definition: TypeSystemClang.h:1113
lldb_private::OptionalClangModuleID
A Clang module ID.
Definition: TypeSystemClang.h:57
lldb_private::TypeSystemClang::GetAsTypedefDecl
static clang::TypedefNameDecl * GetAsTypedefDecl(const CompilerType &type)
Definition: TypeSystemClang.cpp:7297
uint32_t
DWARFASTParser
Definition: DWARFASTParser.h:26
lldb_private::TypeSystemClang::GetCompleteDecl
bool GetCompleteDecl(clang::Decl *decl)
Definition: TypeSystemClang.h:178
lldb_private::TypeSystemClang::CompleteTagDeclCallback
void(* CompleteTagDeclCallback)(void *baton, clang::TagDecl *)
Definition: TypeSystemClang.h:111
lldb_private::Type::Payload
uint32_t Payload
Definition: Type.h:214
lldb_private::CompilerType::SetCompilerType
void SetCompilerType(TypeSystem *type_system, lldb::opaque_compiler_type_t type)
Definition: CompilerType.cpp:312
lldb_private::TypeSystemClang::GetEnumerationIntegerType
CompilerType GetEnumerationIntegerType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4300
lldb_private::TypeSystemClang::CreateMemberPointerType
static CompilerType CreateMemberPointerType(const CompilerType &type, const CompilerType &pointee_type)
Definition: TypeSystemClang.cpp:8446
lldb_private::Address
Definition: Address.h:59
lldb_private::ScratchTypeSystemClang::ID
static char ID
LLVM RTTI support.
Definition: TypeSystemClang.h:1115
id
void * id
Definition: PlatformiOSSimulatorCoreSimulatorSupport.h:20
lldb_private::TypeSystemClang::CreateVariableDeclaration
clang::VarDecl * CreateVariableDeclaration(clang::DeclContext *decl_context, OptionalClangModuleID owning_module, const char *name, clang::QualType type)
Definition: TypeSystemClang.cpp:1990
PDBASTParser
Definition: PDBASTParser.h:43
lldb_private::TypeSystemClang::DumpValue
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) override
Definition: TypeSystemClang.cpp:8519
lldb_private::TypePayloadClang::IsCompleteObjCClass
bool IsCompleteObjCClass()
Definition: TypeSystemClang.h:84
lldb_private::TypeSystemClang::DeclMetadataMap
llvm::DenseMap< const clang::Decl *, ClangASTMetadata > DeclMetadataMap
Definition: TypeSystemClang.h:1084
lldb_private::TypeSystemClang::DeclGetFunctionNumArguments
size_t DeclGetFunctionNumArguments(void *opaque_decl) override
Definition: TypeSystemClang.cpp:9455
lldb_private::TypeSystemClang::IsDefined
bool IsDefined(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:3448
lldb_private::TypeSystemClang::GetCompleteType
bool GetCompleteType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:3760
lldb_private::TypeSystemClang::GetSupportedLanguagesForTypes
static LanguageSet GetSupportedLanguagesForTypes()
Definition: TypeSystemClang.cpp:614
lldb_private::TypeSystemClang::CreateFunctionTemplateDecl
clang::FunctionTemplateDecl * CreateFunctionTemplateDecl(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, clang::FunctionDecl *func_decl, const TemplateParameterInfos &infos)
Definition: TypeSystemClang.cpp:1433
lldb_private::TypePayloadClang::SetOwningModule
void SetOwningModule(OptionalClangModuleID id)
Definition: TypeSystemClang.cpp:330
lldb_private::TypeSystemClang::BuildIndirectFields
static void BuildIndirectFields(const CompilerType &type)
Definition: TypeSystemClang.cpp:7416
lldb_private::TypeSystemClang::GetAsRecordDecl
static clang::RecordDecl * GetAsRecordDecl(const CompilerType &type)
Definition: TypeSystemClang.cpp:7284
lldb_private::TypeSystemClang::IsHomogeneousAggregate
uint32_t IsHomogeneousAggregate(lldb::opaque_compiler_type_t type, CompilerType *base_type_ptr) override
Definition: TypeSystemClang.cpp:3038
lldb_private::TypeSystemClang::m_header_search_up
std::unique_ptr< clang::HeaderSearch > m_header_search_up
Definition: TypeSystemClang.h:1071
lldb_private::TypeSystemClang::GetNumVirtualBaseClasses
uint32_t GetNumVirtualBaseClasses(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:5853
lldb_private::TypeSystemClang::GetByteSize
llvm::Optional< uint64_t > GetByteSize(lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope)
Definition: TypeSystemClang.h:730
lldb_private::TypeSystemClang::dump
LLVM_DUMP_METHOD void dump(lldb::opaque_compiler_type_t type) const override
Convenience LLVM-style dump method for use in the debugger only.
Definition: TypeSystemClang.cpp:8466
lldb_private::ScratchTypeSystemClang::GetForTarget
static TypeSystemClang * GetForTarget(Target &target, llvm::Optional< IsolatedASTKind > ast_kind=DefaultAST, bool create_on_demand=true)
Returns the scratch TypeSystemClang for the given target.
Definition: TypeSystemClang.cpp:9851
lldb_private::TypeSystemClang::GetFunctionArgumentAtIndex
CompilerType GetFunctionArgumentAtIndex(lldb::opaque_compiler_type_t type, const size_t index) override
Definition: TypeSystemClang.cpp:3132
lldb_private::TypeSystemClang::CanPassInRegisters
bool CanPassInRegisters(const CompilerType &type) override
Definition: TypeSystemClang.cpp:3684
lldb_private::TypeSystemClang::m_native_pdb_ast_parser_up
std::unique_ptr< npdb::PdbAstBuilder > m_native_pdb_ast_parser_up
Definition: TypeSystemClang.h:1075
lldb::Encoding
Encoding
Register encoding definitions.
Definition: lldb-enumerations.h:146
lldb_private::ClangASTImporter
Manages and observes all Clang AST node importing in LLDB.
Definition: ClangASTImporter.h:64
lldb_private::TypeSystemClang::IsBlockPointerType
bool IsBlockPointerType(lldb::opaque_compiler_type_t type, CompilerType *function_pointer_type_ptr) override
Definition: TypeSystemClang.cpp:3171
lldb_private::ConstString::GetCString
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:215
lldb_private::TypeSystemClang::DeclContextGetName
ConstString DeclContextGetName(void *opaque_decl_ctx) override
Definition: TypeSystemClang.cpp:9665
lldb_private::TypeSystemClang::CreateRecordType
CompilerType CreateRecordType(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, lldb::AccessType access_type, llvm::StringRef name, int kind, lldb::LanguageType language, ClangASTMetadata *metadata=nullptr, bool exports_symbols=false)
Definition: TypeSystemClang.cpp:1271
clang
Definition: ASTResultSynthesizer.h:15
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb_private::TypeSystemClang::IsTypedefType
bool IsTypedefType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:3671
lldb_private::TypeSystemClang::~TypeSystemClang
~TypeSystemClang() override
Definition: TypeSystemClang.cpp:574
lldb_private::TypeSystemClang::GetBasicTypeEnumeration
static lldb::BasicType GetBasicTypeEnumeration(ConstString name)
Definition: TypeSystemClang.cpp:857
lldb_private::TypeSystemClang::DumpTypeName
static void DumpTypeName(const CompilerType &type)
Definition: TypeSystemClang.cpp:9250
lldb_private::TypeSystemClang::TypeMetadataMap
llvm::DenseMap< const clang::Type *, ClangASTMetadata > TypeMetadataMap
Definition: TypeSystemClang.h:1088
lldb_private::TypeSystemClang::TemplateParameterInfos::args
llvm::SmallVector< clang::TemplateArgument, 2 > args
Definition: TypeSystemClang.h:337
lldb_private::TypeSystemClang::DeclContextIsClassMethod
bool DeclContextIsClassMethod(void *opaque_decl_ctx, lldb::LanguageType *language_ptr, bool *is_instance_method_ptr, ConstString *language_object_name_ptr) override
Definition: TypeSystemClang.cpp:9686
lldb_private::PersistentExpressionState
Definition: ExpressionVariable.h:203
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb_private::TypeSystemClang::StartTagDeclarationDefinition
static bool StartTagDeclarationDefinition(const CompilerType &type)
Definition: TypeSystemClang.cpp:8267
lldb_private::TypeSystemClang::IsVoidType
bool IsVoidType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:3678
lldb_private::TypeSystemClang::IsAggregateType
bool IsAggregateType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:2802
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::TypeSystemClang::DeclGetFunctionReturnType
CompilerType DeclGetFunctionReturnType(void *opaque_decl) override
Definition: TypeSystemClang.cpp:9444
lldb_private::TypeSystemClang::GetLangOpts
clang::LangOptions * GetLangOpts() const
Definition: TypeSystemClang.h:1040
lldb_private::TypeSystemClang::DeclContextGetAsDeclContext
static clang::DeclContext * DeclContextGetAsDeclContext(const CompilerDeclContext &dc)
Definition: TypeSystemClang.cpp:9748
lldb_private::OptionalClangModuleID::OptionalClangModuleID
OptionalClangModuleID()=default
lldb_private::ScratchTypeSystemClang::m_persistent_variables
std::unique_ptr< ClangPersistentVariables > m_persistent_variables
The persistent variables associated with this process for the expression parser.
Definition: TypeSystemClang.h:1222
lldb_private::TypeSystemClang::GetTypeName
ConstString GetTypeName(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:3768
lldb_private::TypeSystemClang::m_decl_metadata
DeclMetadataMap m_decl_metadata
Maps Decls to their associated ClangASTMetadata.
Definition: TypeSystemClang.h:1086
lldb_private::TypeSystemClang::IsPolymorphicClass
bool IsPolymorphicClass(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:3509
lldb_private::TypeSystem
Interface for representing a type system.
Definition: TypeSystem.h:74
lldb_private::TypeSystemClang::GetSourceMgr
clang::SourceManager * GetSourceMgr() const
Definition: TypeSystemClang.h:1043
lldb_private::TypeSystemClang::IsRuntimeGeneratedType
bool IsRuntimeGeneratedType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:2949
lldb_private::TypeSystemClang::m_type_metadata
TypeMetadataMap m_type_metadata
Maps Types to their associated ClangASTMetadata.
Definition: TypeSystemClang.h:1090
lldb_private::TypeSystemClang::GetDisplayTypeName
ConstString GetDisplayTypeName(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:3794
lldb_private::TypeSystemClang::SetIntegerInitializerForVariable
static void SetIntegerInitializerForVariable(clang::VarDecl *var, const llvm::APInt &init_value)
Initializes a variable with an integer value.
Definition: TypeSystemClang.cpp:7577
lldb_private::TypeSystemClang::setSema
void setSema(clang::Sema *s)
Definition: TypeSystemClang.cpp:666
lldb_private::TypeSystemClang::FieldIsBitfield
bool FieldIsBitfield(clang::FieldDecl *field, uint32_t &bitfield_bit_size)
Definition: TypeSystemClang.cpp:1765
lldb_private::TypeSystemClang::GetBasicType
CompilerType GetBasicType(lldb::BasicType type)
Definition: TypeSystemClang.cpp:931
lldb_private::TypeSystemClang::GetBitSize
llvm::Optional< uint64_t > GetBitSize(lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope) override
Definition: TypeSystemClang.cpp:4683
lldb_private::TypeSystemClang::GetPointeeType
CompilerType GetPointeeType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4528
lldb_private::TypeSystemClang::CreateUsingDirectiveDeclaration
clang::UsingDirectiveDecl * CreateUsingDirectiveDeclaration(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, clang::NamespaceDecl *ns_decl)
Definition: TypeSystemClang.cpp:1952
lldb_private::Flags::Set
ValueType Set(ValueType mask)
Set one or more flags by logical OR'ing mask with the current flags.
Definition: Flags.h:73
lldb_private::TypeSystemClang::getTargetOptions
std::shared_ptr< clang::TargetOptions > & getTargetOptions()
Definition: TypeSystemClang.cpp:770
lldb_private::TypeSystemClang
A TypeSystem implementation based on Clang.
Definition: TypeSystemClang.h:106
ConstString.h
lldb_private::TypeSystemClang::IsPointerType
bool IsPointerType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type) override
Definition: TypeSystemClang.cpp:3257
Flags.h
lldb_private::TypeSystemClang::TypeSystemClang
TypeSystemClang(llvm::StringRef name, llvm::Triple triple)
Constructs a TypeSystemClang with an ASTContext using the given triple.
Definition: TypeSystemClang.cpp:554
lldb_private::TypeSystemClang::AddEnumerationValueToEnumerationType
clang::EnumConstantDecl * AddEnumerationValueToEnumerationType(const CompilerType &enum_type, const Declaration &decl, const char *name, int64_t enum_value, uint32_t enum_value_bit_size)
Definition: TypeSystemClang.cpp:8422
lldb_private::LanguageSet
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
Definition: TypeSystem.h:43
lldb_private::TypeSystemClang::GetFieldAtIndex
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) override
Definition: TypeSystemClang.cpp:5698
lldb_private::TypeSystemClang::GetCXXClassName
static llvm::Optional< std::string > GetCXXClassName(const CompilerType &type)
Definition: TypeSystemClang.cpp:3697
lldb_private::TypeSystemClang::IsScopedEnumerationType
bool IsScopedEnumerationType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:3243
lldb_private::ScratchTypeSystemClang::GetFunctionCaller
FunctionCaller * GetFunctionCaller(const CompilerType &return_type, const Address &function_address, const ValueList &arg_value_list, const char *name) override
Definition: TypeSystemClang.cpp:9914
lldb_private::TypeSystemClang::isA
bool isA(const void *ClassID) const override
Definition: TypeSystemClang.h:116
lldb_private::TypeSystemClang::SetHasExternalStorage
static bool SetHasExternalStorage(lldb::opaque_compiler_type_t type, bool has_extern)
Definition: TypeSystemClang.cpp:8214
lldb_private::TypeSystemClang::TemplateParameterInfos
Definition: TypeSystemClang.h:323
lldb_private::ScratchTypeSystemClang::CreateASTSource
std::unique_ptr< ClangASTSource > CreateASTSource()
Definition: TypeSystemClang.cpp:9955
lldb_private::TypeSystemClang::Finalize
void Finalize() override
Definition: TypeSystemClang.cpp:650
lldb_private::TypeSystemClang::SupportsLanguage
bool SupportsLanguage(lldb::LanguageType language) override
Definition: TypeSystemClang.cpp:3692
lldb_private::TypeSystemClang::DumpFromSymbolFile
void DumpFromSymbolFile(Stream &s, llvm::StringRef symbol_name)
Dump clang AST types from the symbol file.
Definition: TypeSystemClang.cpp:8478
lldb_private::TypeSystemClang::AddMethodToCXXRecordType
clang::CXXMethodDecl * AddMethodToCXXRecordType(lldb::opaque_compiler_type_t type, llvm::StringRef name, const char *mangled_name, const CompilerType &method_type, lldb::AccessType access, bool is_virtual, bool is_static, bool is_inline, bool is_explicit, bool is_attr_used, bool is_artificial)
Definition: TypeSystemClang.cpp:7606
lldb_private::TypeSystemClang::GetCanonicalType
CompilerType GetCanonicalType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4266
lldb_private::TypeSystemClang::Dump
void Dump(llvm::raw_ostream &output) override
Definition: TypeSystemClang.cpp:8474
lldb_private::TypeMemberFunctionImpl
Definition: Type.h:438
lldb_private::ScratchTypeSystemClang::m_target_wp
lldb::TargetWP m_target_wp
Definition: TypeSystemClang.h:1219
lldb_private::TypeSystemClang::AddMethodToObjCObjectType
static clang::ObjCMethodDecl * AddMethodToObjCObjectType(const CompilerType &type, const char *name, const CompilerType &method_compiler_type, lldb::AccessType access, bool is_artificial, bool is_variadic, bool is_objc_direct_call)
Definition: TypeSystemClang.cpp:8080
lldb_private::TypeSystemClang::GetDeclContextForType
static clang::DeclContext * GetDeclContextForType(clang::QualType type)
Definition: TypeSystemClang.cpp:2635
lldb_private::TypePayloadClang::m_payload
Type::Payload m_payload
The Layout is as follows:
Definition: TypeSystemClang.h:74
lldb_private::TypeSystemClang::IsFunctionType
bool IsFunctionType(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:3011
lldb_private::TypeSystemClang::IsEnumType
static bool IsEnumType(lldb::opaque_compiler_type_t type)
Definition: TypeSystemClang.cpp:3501
lldb_private::TypeSystemClang::CXXRecordDeclAccessMap
llvm::DenseMap< const clang::CXXRecordDecl *, clang::AccessSpecifier > CXXRecordDeclAccessMap
Definition: TypeSystemClang.h:1093
lldb_private::TypeSystemClang::ID
static char ID
Definition: TypeSystemClang.h:108
lldb_private::TypeSystemClang::GetVirtualBaseClassAtIndex
CompilerType GetVirtualBaseClassAtIndex(lldb::opaque_compiler_type_t type, size_t idx, uint32_t *bit_offset_ptr) override
Definition: TypeSystemClang.cpp:5968
lldb_private::Declaration
Definition: Declaration.h:24
lldb_private::TypeSystemClang::m_mangle_ctx_up
std::unique_ptr< clang::MangleContext > m_mangle_ctx_up
Definition: TypeSystemClang.h:1076
lldb_private::TypeSystemClang::CreateUsingDeclaration
clang::UsingDecl * CreateUsingDeclaration(clang::DeclContext *current_decl_ctx, OptionalClangModuleID owning_module, clang::NamedDecl *target)
Definition: TypeSystemClang.cpp:1971
lldb_private::TypeSystemClang::AddConstModifier
CompilerType AddConstModifier(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4576
lldb_private::TypeSystemClang::Terminate
static void Terminate()
Definition: TypeSystemClang.cpp:646
lldb_private::TypeSystemClang::CreateClassTemplateSpecializationDecl
clang::ClassTemplateSpecializationDecl * CreateClassTemplateSpecializationDecl(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, clang::ClassTemplateDecl *class_template_decl, int kind, const TemplateParameterInfos &infos)
Definition: TypeSystemClang.cpp:1664
lldb_private::TypeSystemClang::classof
static bool classof(const TypeSystem *ts)
Definition: TypeSystemClang.h:117
lldb_private::TypeSystemClang::AddVolatileModifier
CompilerType AddVolatileModifier(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4586
lldb_private::TypeSystemClang::GetEncoding
lldb::Encoding GetEncoding(lldb::opaque_compiler_type_t type, uint64_t &count) override
Definition: TypeSystemClang.cpp:4754
lldb_private::TypeSystemClang::CompleteTagDeclarationDefinition
static bool CompleteTagDeclarationDefinition(const CompilerType &type)
Definition: TypeSystemClang.cpp:8292
lldb_private::TypeSystemClang::GetPointerSizedIntType
CompilerType GetPointerSizedIntType(bool is_signed)
Definition: TypeSystemClang.cpp:2382
lldb_private::TypeSystemClang::IsBeingDefined
bool IsBeingDefined(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:3720
lldb_private::TypeSystemClang::GetTypeClass
lldb::TypeClass GetTypeClass(lldb::opaque_compiler_type_t type) override
Definition: TypeSystemClang.cpp:4093
lldb_private::TypeSystemClang::CreateFunctionTemplateSpecializationInfo
void CreateFunctionTemplateSpecializationInfo(clang::FunctionDecl *func_decl, clang::FunctionTemplateDecl *Template, const TemplateParameterInfos &infos)
Definition: TypeSystemClang.cpp:1465
lldb_private::TypeSystemClang::IsClassType
static bool IsClassType(lldb::opaque_compiler_type_t type)
Definition: TypeSystemClang.cpp:3493
lldb_private::TypeSystemClang::SetMetadataAsUserID
void SetMetadataAsUserID(const clang::Decl *decl, lldb::user_id_t user_id)
Definition: TypeSystemClang.cpp:2542
lldb::AccessType
AccessType
Definition: lldb-enumerations.h:507
lldb_private::TypeSystemClang::SetExternalSource
void SetExternalSource(llvm::IntrusiveRefCntPtr< clang::ExternalASTSource > &ast_source_up)
Definition: TypeSystemClang.cpp:680
lldb_private::TypeSystemClang::CreateBaseClassSpecifier
std::unique_ptr< clang::CXXBaseSpecifier > CreateBaseClassSpecifier(lldb::opaque_compiler_type_t type, lldb::AccessType access, bool is_virtual, bool base_of_class)
Definition: TypeSystemClang.cpp:7812
lldb::opaque_compiler_type_t
void * opaque_compiler_type_t
Definition: lldb-types.h:90
lldb_private::TypeSystemClang::GetDeclarationName
clang::DeclarationName GetDeclarationName(llvm::StringRef name, const CompilerType &function_clang_type)
Definition: TypeSystemClang.cpp:2084
lldb_private::TypeSystemClang::GetQualType
static clang::QualType GetQualType(lldb::opaque_compiler_type_t type)
Definition: TypeSystemClang.h:1023
lldb_private::npdb::PdbAstBuilder
Definition: PdbAstBuilder.h:51
lldb_private::TypeSystemClang::GetTypePrintingPolicy
clang::PrintingPolicy GetTypePrintingPolicy()
Returns the PrintingPolicy used when generating the internal type names.
Definition: TypeSystemClang.cpp:2110
lldb_private::TypeSystemClang::DumpDeclHiearchy
static void DumpDeclHiearchy(clang::Decl *decl)
Definition: TypeSystemClang.cpp:2401
lldb::DescriptionLevel
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
Definition: lldb-enumerations.h:207
lldb_private::TypeSystemClang::GetTargetTriple
const char * GetTargetTriple()
Definition: TypeSystemClang.cpp:672
lldb_private::TypeSystemClang::DeclGetDeclContext
CompilerDeclContext DeclGetDeclContext(void *opaque_decl) override
Definition: TypeSystemClang.cpp:9438
lldb_private::TypeSystemClang::Verify
bool Verify(lldb::opaque_compiler_type_t type) override
Verify the integrity of the type to catch CompilerTypes that mix and match invalid TypeSystem/Opaque ...
Definition: TypeSystemClang.cpp:2797
lldb_private::TypeSystemClang::GetChildCompilerTypeAtIndex
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) override
Definition: TypeSystemClang.cpp:6149
lldb_private::TypeSystemClang::DumpTypeDescription
void DumpTypeDescription(lldb::opaque_compiler_type_t type, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull) override
Dump the type to stdout.
Definition: TypeSystemClang.cpp:9142
lldb_private::TypeSystemClang::DeclGetMangledName
ConstString DeclGetMangledName(void *opaque_decl) override
Definition: TypeSystemClang.cpp:9408
lldb_private::TypeSystemClang::IsObjCClassType
static bool IsObjCClassType(const CompilerType &type)
Definition: TypeSystemClang.cpp:3474
lldb_private::FunctionCaller
Definition: FunctionCaller.h:56
lldb_private::TypeSystemClang::CompleteObjCInterfaceDeclCallback
void(* CompleteObjCInterfaceDeclCallback)(void *baton, clang::ObjCInterfaceDecl *)
Definition: TypeSystemClang.h:112
lldb_private::TypeSystemClang::TemplateParameterInfos::names
llvm::SmallVector< const char *, 2 > names
Definition: TypeSystemClang.h:336
lldb_private::TypeSystemClang::TemplateParameterInfos::packed_args
std::unique_ptr< TemplateParameterInfos > packed_args
Definition: TypeSystemClang.h:340
lldb_private::TypeSystemClang::GetMemberFunctionAtIndex
TypeMemberFunctionImpl GetMemberFunctionAtIndex(lldb::opaque_compiler_type_t type, size_t idx) override
Definition: TypeSystemClang.cpp:4404
lldb_private::TypeSystemClang::GetArrayElementType
CompilerType GetArrayElementType(lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope) override
Definition: TypeSystemClang.cpp:4232