clang  14.0.0git
ASTContext.h
Go to the documentation of this file.
1 //===- ASTContext.h - Context to hold long-lived AST nodes ------*- 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 /// \file
10 /// Defines the clang::ASTContext interface.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_AST_ASTCONTEXT_H
15 #define LLVM_CLANG_AST_ASTCONTEXT_H
16 
18 #include "clang/AST/ASTFwd.h"
22 #include "clang/AST/Decl.h"
23 #include "clang/AST/DeclBase.h"
29 #include "clang/AST/TemplateName.h"
30 #include "clang/AST/Type.h"
32 #include "clang/Basic/AttrKinds.h"
34 #include "clang/Basic/LLVM.h"
36 #include "clang/Basic/Linkage.h"
42 #include "clang/Basic/Specifiers.h"
44 #include "clang/Basic/XRayLists.h"
45 #include "llvm/ADT/APSInt.h"
46 #include "llvm/ADT/ArrayRef.h"
47 #include "llvm/ADT/DenseMap.h"
48 #include "llvm/ADT/DenseSet.h"
49 #include "llvm/ADT/FoldingSet.h"
50 #include "llvm/ADT/IntrusiveRefCntPtr.h"
51 #include "llvm/ADT/MapVector.h"
52 #include "llvm/ADT/None.h"
53 #include "llvm/ADT/Optional.h"
54 #include "llvm/ADT/PointerIntPair.h"
55 #include "llvm/ADT/PointerUnion.h"
56 #include "llvm/ADT/SmallVector.h"
57 #include "llvm/ADT/StringMap.h"
58 #include "llvm/ADT/StringRef.h"
59 #include "llvm/ADT/TinyPtrVector.h"
60 #include "llvm/ADT/Triple.h"
61 #include "llvm/ADT/iterator_range.h"
62 #include "llvm/Support/AlignOf.h"
63 #include "llvm/Support/Allocator.h"
64 #include "llvm/Support/Casting.h"
65 #include "llvm/Support/Compiler.h"
66 #include "llvm/Support/TypeSize.h"
67 #include <cassert>
68 #include <cstddef>
69 #include <cstdint>
70 #include <iterator>
71 #include <memory>
72 #include <string>
73 #include <type_traits>
74 #include <utility>
75 #include <vector>
76 
77 namespace llvm {
78 
79 class APFixedPoint;
80 class FixedPointSemantics;
81 struct fltSemantics;
82 template <typename T, unsigned N> class SmallPtrSet;
83 
84 } // namespace llvm
85 
86 namespace clang {
87 
88 class APValue;
89 class ASTMutationListener;
90 class ASTRecordLayout;
91 class AtomicExpr;
92 class BlockExpr;
93 class BuiltinTemplateDecl;
94 class CharUnits;
95 class ConceptDecl;
96 class CXXABI;
97 class CXXConstructorDecl;
98 class CXXMethodDecl;
99 class CXXRecordDecl;
100 class DiagnosticsEngine;
101 class ParentMapContext;
102 class DynTypedNode;
103 class DynTypedNodeList;
104 class Expr;
105 class GlobalDecl;
106 class ItaniumMangleContext;
107 class MangleContext;
108 class MangleNumberingContext;
109 class MaterializeTemporaryExpr;
110 class MemberSpecializationInfo;
111 class Module;
112 struct MSGuidDeclParts;
113 class ObjCCategoryDecl;
114 class ObjCCategoryImplDecl;
115 class ObjCContainerDecl;
116 class ObjCImplDecl;
117 class ObjCImplementationDecl;
118 class ObjCInterfaceDecl;
119 class ObjCIvarDecl;
120 class ObjCMethodDecl;
121 class ObjCPropertyDecl;
122 class ObjCPropertyImplDecl;
123 class ObjCProtocolDecl;
124 class ObjCTypeParamDecl;
125 class OMPTraitInfo;
126 struct ParsedTargetAttr;
127 class Preprocessor;
128 class Stmt;
129 class StoredDeclsMap;
130 class TargetAttr;
131 class TargetInfo;
132 class TemplateDecl;
133 class TemplateParameterList;
134 class TemplateTemplateParmDecl;
135 class TemplateTypeParmDecl;
136 class UnresolvedSetIterator;
137 class UsingShadowDecl;
138 class VarTemplateDecl;
139 class VTableContextBase;
140 struct BlockVarCopyInit;
141 
142 namespace Builtin {
143 
144 class Context;
145 
146 } // namespace Builtin
147 
148 enum BuiltinTemplateKind : int;
149 enum OpenCLTypeKind : uint8_t;
150 
151 namespace comments {
152 
153 class FullComment;
154 
155 } // namespace comments
156 
157 namespace interp {
158 
159 class Context;
160 
161 } // namespace interp
162 
163 namespace serialization {
164 template <class> class AbstractTypeReader;
165 } // namespace serialization
166 
168  /// The alignment was not explicit in code.
169  None,
170 
171  /// The alignment comes from an alignment attribute on a typedef.
173 
174  /// The alignment comes from an alignment attribute on a record type.
176 
177  /// The alignment comes from an alignment attribute on a enum type.
179 };
180 
181 struct TypeInfo {
182  uint64_t Width = 0;
183  unsigned Align = 0;
185 
187  TypeInfo(uint64_t Width, unsigned Align,
192  }
193 };
194 
199 
206  }
207 };
208 
209 /// Holds long-lived AST nodes (such as types and decls) that can be
210 /// referred to throughout the semantic analysis of a file.
211 class ASTContext : public RefCountedBase<ASTContext> {
212  friend class NestedNameSpecifier;
213 
214  mutable SmallVector<Type *, 0> Types;
215  mutable llvm::FoldingSet<ExtQuals> ExtQualNodes;
216  mutable llvm::FoldingSet<ComplexType> ComplexTypes;
217  mutable llvm::FoldingSet<PointerType> PointerTypes;
218  mutable llvm::FoldingSet<AdjustedType> AdjustedTypes;
219  mutable llvm::FoldingSet<BlockPointerType> BlockPointerTypes;
220  mutable llvm::FoldingSet<LValueReferenceType> LValueReferenceTypes;
221  mutable llvm::FoldingSet<RValueReferenceType> RValueReferenceTypes;
222  mutable llvm::FoldingSet<MemberPointerType> MemberPointerTypes;
223  mutable llvm::ContextualFoldingSet<ConstantArrayType, ASTContext &>
224  ConstantArrayTypes;
225  mutable llvm::FoldingSet<IncompleteArrayType> IncompleteArrayTypes;
226  mutable std::vector<VariableArrayType*> VariableArrayTypes;
227  mutable llvm::FoldingSet<DependentSizedArrayType> DependentSizedArrayTypes;
228  mutable llvm::FoldingSet<DependentSizedExtVectorType>
229  DependentSizedExtVectorTypes;
230  mutable llvm::FoldingSet<DependentAddressSpaceType>
231  DependentAddressSpaceTypes;
232  mutable llvm::FoldingSet<VectorType> VectorTypes;
233  mutable llvm::FoldingSet<DependentVectorType> DependentVectorTypes;
234  mutable llvm::FoldingSet<ConstantMatrixType> MatrixTypes;
235  mutable llvm::FoldingSet<DependentSizedMatrixType> DependentSizedMatrixTypes;
236  mutable llvm::FoldingSet<FunctionNoProtoType> FunctionNoProtoTypes;
237  mutable llvm::ContextualFoldingSet<FunctionProtoType, ASTContext&>
238  FunctionProtoTypes;
239  mutable llvm::FoldingSet<DependentTypeOfExprType> DependentTypeOfExprTypes;
240  mutable llvm::FoldingSet<DependentDecltypeType> DependentDecltypeTypes;
241  mutable llvm::FoldingSet<TemplateTypeParmType> TemplateTypeParmTypes;
242  mutable llvm::FoldingSet<ObjCTypeParamType> ObjCTypeParamTypes;
243  mutable llvm::FoldingSet<SubstTemplateTypeParmType>
244  SubstTemplateTypeParmTypes;
245  mutable llvm::FoldingSet<SubstTemplateTypeParmPackType>
246  SubstTemplateTypeParmPackTypes;
247  mutable llvm::ContextualFoldingSet<TemplateSpecializationType, ASTContext&>
248  TemplateSpecializationTypes;
249  mutable llvm::FoldingSet<ParenType> ParenTypes;
250  mutable llvm::FoldingSet<ElaboratedType> ElaboratedTypes;
251  mutable llvm::FoldingSet<DependentNameType> DependentNameTypes;
252  mutable llvm::ContextualFoldingSet<DependentTemplateSpecializationType,
253  ASTContext&>
254  DependentTemplateSpecializationTypes;
255  llvm::FoldingSet<PackExpansionType> PackExpansionTypes;
256  mutable llvm::FoldingSet<ObjCObjectTypeImpl> ObjCObjectTypes;
257  mutable llvm::FoldingSet<ObjCObjectPointerType> ObjCObjectPointerTypes;
258  mutable llvm::FoldingSet<DependentUnaryTransformType>
259  DependentUnaryTransformTypes;
260  mutable llvm::ContextualFoldingSet<AutoType, ASTContext&> AutoTypes;
261  mutable llvm::FoldingSet<DeducedTemplateSpecializationType>
262  DeducedTemplateSpecializationTypes;
263  mutable llvm::FoldingSet<AtomicType> AtomicTypes;
264  llvm::FoldingSet<AttributedType> AttributedTypes;
265  mutable llvm::FoldingSet<PipeType> PipeTypes;
266  mutable llvm::FoldingSet<ExtIntType> ExtIntTypes;
267  mutable llvm::FoldingSet<DependentExtIntType> DependentExtIntTypes;
268 
269  mutable llvm::FoldingSet<QualifiedTemplateName> QualifiedTemplateNames;
270  mutable llvm::FoldingSet<DependentTemplateName> DependentTemplateNames;
271  mutable llvm::FoldingSet<SubstTemplateTemplateParmStorage>
272  SubstTemplateTemplateParms;
273  mutable llvm::ContextualFoldingSet<SubstTemplateTemplateParmPackStorage,
274  ASTContext&>
275  SubstTemplateTemplateParmPacks;
276 
277  /// The set of nested name specifiers.
278  ///
279  /// This set is managed by the NestedNameSpecifier class.
280  mutable llvm::FoldingSet<NestedNameSpecifier> NestedNameSpecifiers;
281  mutable NestedNameSpecifier *GlobalNestedNameSpecifier = nullptr;
282 
283  /// A cache mapping from RecordDecls to ASTRecordLayouts.
284  ///
285  /// This is lazily created. This is intentionally not serialized.
286  mutable llvm::DenseMap<const RecordDecl*, const ASTRecordLayout*>
287  ASTRecordLayouts;
288  mutable llvm::DenseMap<const ObjCContainerDecl*, const ASTRecordLayout*>
289  ObjCLayouts;
290 
291  /// A cache from types to size and alignment information.
292  using TypeInfoMap = llvm::DenseMap<const Type *, struct TypeInfo>;
293  mutable TypeInfoMap MemoizedTypeInfo;
294 
295  /// A cache from types to unadjusted alignment information. Only ARM and
296  /// AArch64 targets need this information, keeping it separate prevents
297  /// imposing overhead on TypeInfo size.
298  using UnadjustedAlignMap = llvm::DenseMap<const Type *, unsigned>;
299  mutable UnadjustedAlignMap MemoizedUnadjustedAlign;
300 
301  /// A cache mapping from CXXRecordDecls to key functions.
302  llvm::DenseMap<const CXXRecordDecl*, LazyDeclPtr> KeyFunctions;
303 
304  /// Mapping from ObjCContainers to their ObjCImplementations.
305  llvm::DenseMap<ObjCContainerDecl*, ObjCImplDecl*> ObjCImpls;
306 
307  /// Mapping from ObjCMethod to its duplicate declaration in the same
308  /// interface.
309  llvm::DenseMap<const ObjCMethodDecl*,const ObjCMethodDecl*> ObjCMethodRedecls;
310 
311  /// Mapping from __block VarDecls to BlockVarCopyInit.
312  llvm::DenseMap<const VarDecl *, BlockVarCopyInit> BlockVarCopyInits;
313 
314  /// Mapping from GUIDs to the corresponding MSGuidDecl.
315  mutable llvm::FoldingSet<MSGuidDecl> MSGuidDecls;
316 
317  /// Mapping from APValues to the corresponding TemplateParamObjects.
318  mutable llvm::FoldingSet<TemplateParamObjectDecl> TemplateParamObjectDecls;
319 
320  /// A cache mapping a string value to a StringLiteral object with the same
321  /// value.
322  ///
323  /// This is lazily created. This is intentionally not serialized.
324  mutable llvm::StringMap<StringLiteral *> StringLiteralCache;
325 
326  /// MD5 hash of CUID. It is calculated when first used and cached by this
327  /// data member.
328  mutable std::string CUIDHash;
329 
330  /// Representation of a "canonical" template template parameter that
331  /// is used in canonical template names.
332  class CanonicalTemplateTemplateParm : public llvm::FoldingSetNode {
334 
335  public:
336  CanonicalTemplateTemplateParm(TemplateTemplateParmDecl *Parm)
337  : Parm(Parm) {}
338 
339  TemplateTemplateParmDecl *getParam() const { return Parm; }
340 
341  void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &C) {
342  Profile(ID, C, Parm);
343  }
344 
345  static void Profile(llvm::FoldingSetNodeID &ID,
346  const ASTContext &C,
347  TemplateTemplateParmDecl *Parm);
348  };
349  mutable llvm::ContextualFoldingSet<CanonicalTemplateTemplateParm,
350  const ASTContext&>
351  CanonTemplateTemplateParms;
352 
353  TemplateTemplateParmDecl *
354  getCanonicalTemplateTemplateParmDecl(TemplateTemplateParmDecl *TTP) const;
355 
356  /// The typedef for the __int128_t type.
357  mutable TypedefDecl *Int128Decl = nullptr;
358 
359  /// The typedef for the __uint128_t type.
360  mutable TypedefDecl *UInt128Decl = nullptr;
361 
362  /// The typedef for the target specific predefined
363  /// __builtin_va_list type.
364  mutable TypedefDecl *BuiltinVaListDecl = nullptr;
365 
366  /// The typedef for the predefined \c __builtin_ms_va_list type.
367  mutable TypedefDecl *BuiltinMSVaListDecl = nullptr;
368 
369  /// The typedef for the predefined \c id type.
370  mutable TypedefDecl *ObjCIdDecl = nullptr;
371 
372  /// The typedef for the predefined \c SEL type.
373  mutable TypedefDecl *ObjCSelDecl = nullptr;
374 
375  /// The typedef for the predefined \c Class type.
376  mutable TypedefDecl *ObjCClassDecl = nullptr;
377 
378  /// The typedef for the predefined \c Protocol class in Objective-C.
379  mutable ObjCInterfaceDecl *ObjCProtocolClassDecl = nullptr;
380 
381  /// The typedef for the predefined 'BOOL' type.
382  mutable TypedefDecl *BOOLDecl = nullptr;
383 
384  // Typedefs which may be provided defining the structure of Objective-C
385  // pseudo-builtins
386  QualType ObjCIdRedefinitionType;
387  QualType ObjCClassRedefinitionType;
388  QualType ObjCSelRedefinitionType;
389 
390  /// The identifier 'bool'.
391  mutable IdentifierInfo *BoolName = nullptr;
392 
393  /// The identifier 'NSObject'.
394  mutable IdentifierInfo *NSObjectName = nullptr;
395 
396  /// The identifier 'NSCopying'.
397  IdentifierInfo *NSCopyingName = nullptr;
398 
399  /// The identifier '__make_integer_seq'.
400  mutable IdentifierInfo *MakeIntegerSeqName = nullptr;
401 
402  /// The identifier '__type_pack_element'.
403  mutable IdentifierInfo *TypePackElementName = nullptr;
404 
405  QualType ObjCConstantStringType;
406  mutable RecordDecl *CFConstantStringTagDecl = nullptr;
407  mutable TypedefDecl *CFConstantStringTypeDecl = nullptr;
408 
409  mutable QualType ObjCSuperType;
410 
411  QualType ObjCNSStringType;
412 
413  /// The typedef declaration for the Objective-C "instancetype" type.
414  TypedefDecl *ObjCInstanceTypeDecl = nullptr;
415 
416  /// The type for the C FILE type.
417  TypeDecl *FILEDecl = nullptr;
418 
419  /// The type for the C jmp_buf type.
420  TypeDecl *jmp_bufDecl = nullptr;
421 
422  /// The type for the C sigjmp_buf type.
423  TypeDecl *sigjmp_bufDecl = nullptr;
424 
425  /// The type for the C ucontext_t type.
426  TypeDecl *ucontext_tDecl = nullptr;
427 
428  /// Type for the Block descriptor for Blocks CodeGen.
429  ///
430  /// Since this is only used for generation of debug info, it is not
431  /// serialized.
432  mutable RecordDecl *BlockDescriptorType = nullptr;
433 
434  /// Type for the Block descriptor for Blocks CodeGen.
435  ///
436  /// Since this is only used for generation of debug info, it is not
437  /// serialized.
438  mutable RecordDecl *BlockDescriptorExtendedType = nullptr;
439 
440  /// Declaration for the CUDA cudaConfigureCall function.
441  FunctionDecl *cudaConfigureCallDecl = nullptr;
442 
443  /// Keeps track of all declaration attributes.
444  ///
445  /// Since so few decls have attrs, we keep them in a hash map instead of
446  /// wasting space in the Decl class.
447  llvm::DenseMap<const Decl*, AttrVec*> DeclAttrs;
448 
449  /// A mapping from non-redeclarable declarations in modules that were
450  /// merged with other declarations to the canonical declaration that they were
451  /// merged into.
452  llvm::DenseMap<Decl*, Decl*> MergedDecls;
453 
454  /// A mapping from a defining declaration to a list of modules (other
455  /// than the owning module of the declaration) that contain merged
456  /// definitions of that entity.
457  llvm::DenseMap<NamedDecl*, llvm::TinyPtrVector<Module*>> MergedDefModules;
458 
459  /// Initializers for a module, in order. Each Decl will be either
460  /// something that has a semantic effect on startup (such as a variable with
461  /// a non-constant initializer), or an ImportDecl (which recursively triggers
462  /// initialization of another module).
463  struct PerModuleInitializers {
464  llvm::SmallVector<Decl*, 4> Initializers;
465  llvm::SmallVector<uint32_t, 4> LazyInitializers;
466 
467  void resolve(ASTContext &Ctx);
468  };
469  llvm::DenseMap<Module*, PerModuleInitializers*> ModuleInitializers;
470 
471  ASTContext &this_() { return *this; }
472 
473 public:
474  /// A type synonym for the TemplateOrInstantiation mapping.
476  llvm::PointerUnion<VarTemplateDecl *, MemberSpecializationInfo *>;
477 
478 private:
479  friend class ASTDeclReader;
480  friend class ASTReader;
481  friend class ASTWriter;
482  template <class> friend class serialization::AbstractTypeReader;
483  friend class CXXRecordDecl;
484  friend class IncrementalParser;
485 
486  /// A mapping to contain the template or declaration that
487  /// a variable declaration describes or was instantiated from,
488  /// respectively.
489  ///
490  /// For non-templates, this value will be NULL. For variable
491  /// declarations that describe a variable template, this will be a
492  /// pointer to a VarTemplateDecl. For static data members
493  /// of class template specializations, this will be the
494  /// MemberSpecializationInfo referring to the member variable that was
495  /// instantiated or specialized. Thus, the mapping will keep track of
496  /// the static data member templates from which static data members of
497  /// class template specializations were instantiated.
498  ///
499  /// Given the following example:
500  ///
501  /// \code
502  /// template<typename T>
503  /// struct X {
504  /// static T value;
505  /// };
506  ///
507  /// template<typename T>
508  /// T X<T>::value = T(17);
509  ///
510  /// int *x = &X<int>::value;
511  /// \endcode
512  ///
513  /// This mapping will contain an entry that maps from the VarDecl for
514  /// X<int>::value to the corresponding VarDecl for X<T>::value (within the
515  /// class template X) and will be marked TSK_ImplicitInstantiation.
516  llvm::DenseMap<const VarDecl *, TemplateOrSpecializationInfo>
517  TemplateOrInstantiation;
518 
519  /// Keeps track of the declaration from which a using declaration was
520  /// created during instantiation.
521  ///
522  /// The source and target declarations are always a UsingDecl, an
523  /// UnresolvedUsingValueDecl, or an UnresolvedUsingTypenameDecl.
524  ///
525  /// For example:
526  /// \code
527  /// template<typename T>
528  /// struct A {
529  /// void f();
530  /// };
531  ///
532  /// template<typename T>
533  /// struct B : A<T> {
534  /// using A<T>::f;
535  /// };
536  ///
537  /// template struct B<int>;
538  /// \endcode
539  ///
540  /// This mapping will contain an entry that maps from the UsingDecl in
541  /// B<int> to the UnresolvedUsingDecl in B<T>.
542  llvm::DenseMap<NamedDecl *, NamedDecl *> InstantiatedFromUsingDecl;
543 
544  /// Like InstantiatedFromUsingDecl, but for using-enum-declarations. Maps
545  /// from the instantiated using-enum to the templated decl from whence it
546  /// came.
547  /// Note that using-enum-declarations cannot be dependent and
548  /// thus will never be instantiated from an "unresolved"
549  /// version thereof (as with using-declarations), so each mapping is from
550  /// a (resolved) UsingEnumDecl to a (resolved) UsingEnumDecl.
551  llvm::DenseMap<UsingEnumDecl *, UsingEnumDecl *>
552  InstantiatedFromUsingEnumDecl;
553 
554  /// Simlarly maps instantiated UsingShadowDecls to their origin.
555  llvm::DenseMap<UsingShadowDecl*, UsingShadowDecl*>
556  InstantiatedFromUsingShadowDecl;
557 
558  llvm::DenseMap<FieldDecl *, FieldDecl *> InstantiatedFromUnnamedFieldDecl;
559 
560  /// Mapping that stores the methods overridden by a given C++
561  /// member function.
562  ///
563  /// Since most C++ member functions aren't virtual and therefore
564  /// don't override anything, we store the overridden functions in
565  /// this map on the side rather than within the CXXMethodDecl structure.
566  using CXXMethodVector = llvm::TinyPtrVector<const CXXMethodDecl *>;
567  llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector> OverriddenMethods;
568 
569  /// Mapping from each declaration context to its corresponding
570  /// mangling numbering context (used for constructs like lambdas which
571  /// need to be consistently numbered for the mangler).
572  llvm::DenseMap<const DeclContext *, std::unique_ptr<MangleNumberingContext>>
573  MangleNumberingContexts;
574  llvm::DenseMap<const Decl *, std::unique_ptr<MangleNumberingContext>>
575  ExtraMangleNumberingContexts;
576 
577  /// Side-table of mangling numbers for declarations which rarely
578  /// need them (like static local vars).
579  llvm::MapVector<const NamedDecl *, unsigned> MangleNumbers;
580  llvm::MapVector<const VarDecl *, unsigned> StaticLocalNumbers;
581  /// Mapping the associated device lambda mangling number if present.
582  mutable llvm::DenseMap<const CXXRecordDecl *, unsigned>
583  DeviceLambdaManglingNumbers;
584 
585  /// Mapping that stores parameterIndex values for ParmVarDecls when
586  /// that value exceeds the bitfield size of ParmVarDeclBits.ParameterIndex.
587  using ParameterIndexTable = llvm::DenseMap<const VarDecl *, unsigned>;
588  ParameterIndexTable ParamIndices;
589 
590  ImportDecl *FirstLocalImport = nullptr;
591  ImportDecl *LastLocalImport = nullptr;
592 
593  TranslationUnitDecl *TUDecl = nullptr;
594  mutable ExternCContextDecl *ExternCContext = nullptr;
595  mutable BuiltinTemplateDecl *MakeIntegerSeqDecl = nullptr;
596  mutable BuiltinTemplateDecl *TypePackElementDecl = nullptr;
597 
598  /// The associated SourceManager object.
599  SourceManager &SourceMgr;
600 
601  /// The language options used to create the AST associated with
602  /// this ASTContext object.
603  LangOptions &LangOpts;
604 
605  /// NoSanitizeList object that is used by sanitizers to decide which
606  /// entities should not be instrumented.
607  std::unique_ptr<NoSanitizeList> NoSanitizeL;
608 
609  /// Function filtering mechanism to determine whether a given function
610  /// should be imbued with the XRay "always" or "never" attributes.
611  std::unique_ptr<XRayFunctionFilter> XRayFilter;
612 
613  /// ProfileList object that is used by the profile instrumentation
614  /// to decide which entities should be instrumented.
615  std::unique_ptr<ProfileList> ProfList;
616 
617  /// The allocator used to create AST objects.
618  ///
619  /// AST objects are never destructed; rather, all memory associated with the
620  /// AST objects will be released when the ASTContext itself is destroyed.
621  mutable llvm::BumpPtrAllocator BumpAlloc;
622 
623  /// Allocator for partial diagnostics.
625 
626  /// The current C++ ABI.
627  std::unique_ptr<CXXABI> ABI;
628  CXXABI *createCXXABI(const TargetInfo &T);
629 
630  /// The logical -> physical address space map.
631  const LangASMap *AddrSpaceMap = nullptr;
632 
633  /// Address space map mangling must be used with language specific
634  /// address spaces (e.g. OpenCL/CUDA)
635  bool AddrSpaceMapMangling;
636 
637  const TargetInfo *Target = nullptr;
638  const TargetInfo *AuxTarget = nullptr;
640  std::unique_ptr<interp::Context> InterpContext;
641  std::unique_ptr<ParentMapContext> ParentMapCtx;
642 
643  /// Keeps track of the deallocated DeclListNodes for future reuse.
644  DeclListNode *ListNodeFreeList = nullptr;
645 
646 public:
654 
655  /// Returns the clang bytecode interpreter context.
657 
658  /// Returns the dynamic AST node parent map context.
660 
661  // A traversal scope limits the parts of the AST visible to certain analyses.
662  // RecursiveASTVisitor only visits specified children of TranslationUnitDecl.
663  // getParents() will only observe reachable parent edges.
664  //
665  // The scope is defined by a set of "top-level" declarations which will be
666  // visible under the TranslationUnitDecl.
667  // Initially, it is the entire TU, represented by {getTranslationUnitDecl()}.
668  //
669  // After setTraversalScope({foo, bar}), the exposed AST looks like:
670  // TranslationUnitDecl
671  // - foo
672  // - ...
673  // - bar
674  // - ...
675  // All other siblings of foo and bar are pruned from the tree.
676  // (However they are still accessible via TranslationUnitDecl->decls())
677  //
678  // Changing the scope clears the parent cache, which is expensive to rebuild.
679  std::vector<Decl *> getTraversalScope() const { return TraversalScope; }
680  void setTraversalScope(const std::vector<Decl *> &);
681 
682  /// Forwards to get node parents from the ParentMapContext. New callers should
683  /// use ParentMapContext::getParents() directly.
684  template <typename NodeT> DynTypedNodeList getParents(const NodeT &Node);
685 
687  return PrintingPolicy;
688  }
689 
691  PrintingPolicy = Policy;
692  }
693 
694  SourceManager& getSourceManager() { return SourceMgr; }
695  const SourceManager& getSourceManager() const { return SourceMgr; }
696 
697  llvm::BumpPtrAllocator &getAllocator() const {
698  return BumpAlloc;
699  }
700 
701  void *Allocate(size_t Size, unsigned Align = 8) const {
702  return BumpAlloc.Allocate(Size, Align);
703  }
704  template <typename T> T *Allocate(size_t Num = 1) const {
705  return static_cast<T *>(Allocate(Num * sizeof(T), alignof(T)));
706  }
707  void Deallocate(void *Ptr) const {}
708 
709  /// Allocates a \c DeclListNode or returns one from the \c ListNodeFreeList
710  /// pool.
712  if (DeclListNode *Alloc = ListNodeFreeList) {
713  ListNodeFreeList = Alloc->Rest.dyn_cast<DeclListNode*>();
714  Alloc->D = ND;
715  Alloc->Rest = nullptr;
716  return Alloc;
717  }
718  return new (*this) DeclListNode(ND);
719  }
720  /// Deallcates a \c DeclListNode by returning it to the \c ListNodeFreeList
721  /// pool.
723  N->Rest = ListNodeFreeList;
724  ListNodeFreeList = N;
725  }
726 
727  /// Return the total amount of physical memory allocated for representing
728  /// AST nodes and type information.
729  size_t getASTAllocatedMemory() const {
730  return BumpAlloc.getTotalMemory();
731  }
732 
733  /// Return the total memory used for various side tables.
734  size_t getSideTableAllocatedMemory() const;
735 
737  return DiagAllocator;
738  }
739 
740  const TargetInfo &getTargetInfo() const { return *Target; }
741  const TargetInfo *getAuxTargetInfo() const { return AuxTarget; }
742 
743  /// getIntTypeForBitwidth -
744  /// sets integer QualTy according to specified details:
745  /// bitwidth, signed/unsigned.
746  /// Returns empty type if there is no appropriate target types.
747  QualType getIntTypeForBitwidth(unsigned DestWidth,
748  unsigned Signed) const;
749 
750  /// getRealTypeForBitwidth -
751  /// sets floating point QualTy according to specified bitwidth.
752  /// Returns empty type if there is no appropriate target types.
753  QualType getRealTypeForBitwidth(unsigned DestWidth, bool ExplicitIEEE) const;
754 
755  bool AtomicUsesUnsupportedLibcall(const AtomicExpr *E) const;
756 
757  const LangOptions& getLangOpts() const { return LangOpts; }
758 
759  // If this condition is false, typo correction must be performed eagerly
760  // rather than delayed in many places, as it makes use of dependent types.
761  // the condition is false for clang's C-only codepath, as it doesn't support
762  // dependent types yet.
763  bool isDependenceAllowed() const {
764  return LangOpts.CPlusPlus || LangOpts.RecoveryAST;
765  }
766 
767  const NoSanitizeList &getNoSanitizeList() const { return *NoSanitizeL; }
768 
770  return *XRayFilter;
771  }
772 
773  const ProfileList &getProfileList() const { return *ProfList; }
774 
776 
778  return FullSourceLoc(Loc,SourceMgr);
779  }
780 
781  /// Return the C++ ABI kind that should be used. The C++ ABI can be overriden
782  /// at compile time with `-fc++-abi=`. If this is not provided, we instead use
783  /// the default ABI set by the target.
785 
786  /// All comments in this translation unit.
788 
789  /// True if comments are already loaded from ExternalASTSource.
790  mutable bool CommentsLoaded = false;
791 
792  /// Mapping from declaration to directly attached comment.
793  ///
794  /// Raw comments are owned by Comments list. This mapping is populated
795  /// lazily.
796  mutable llvm::DenseMap<const Decl *, const RawComment *> DeclRawComments;
797 
798  /// Mapping from canonical declaration to the first redeclaration in chain
799  /// that has a comment attached.
800  ///
801  /// Raw comments are owned by Comments list. This mapping is populated
802  /// lazily.
803  mutable llvm::DenseMap<const Decl *, const Decl *> RedeclChainComments;
804 
805  /// Keeps track of redeclaration chains that don't have any comment attached.
806  /// Mapping from canonical declaration to redeclaration chain that has no
807  /// comments attached to any redeclaration. Specifically it's mapping to
808  /// the last redeclaration we've checked.
809  ///
810  /// Shall not contain declarations that have comments attached to any
811  /// redeclaration in their chain.
812  mutable llvm::DenseMap<const Decl *, const Decl *> CommentlessRedeclChains;
813 
814  /// Mapping from declarations to parsed comments attached to any
815  /// redeclaration.
816  mutable llvm::DenseMap<const Decl *, comments::FullComment *> ParsedComments;
817 
818  /// Attaches \p Comment to \p OriginalD and to its redeclaration chain
819  /// and removes the redeclaration chain from the set of commentless chains.
820  ///
821  /// Don't do anything if a comment has already been attached to \p OriginalD
822  /// or its redeclaration chain.
823  void cacheRawCommentForDecl(const Decl &OriginalD,
824  const RawComment &Comment) const;
825 
826  /// \returns searches \p CommentsInFile for doc comment for \p D.
827  ///
828  /// \p RepresentativeLocForDecl is used as a location for searching doc
829  /// comments. \p CommentsInFile is a mapping offset -> comment of files in the
830  /// same file where \p RepresentativeLocForDecl is.
832  const Decl *D, const SourceLocation RepresentativeLocForDecl,
833  const std::map<unsigned, RawComment *> &CommentsInFile) const;
834 
835  /// Return the documentation comment attached to a given declaration,
836  /// without looking into cache.
838 
839 public:
840  void addComment(const RawComment &RC);
841 
842  /// Return the documentation comment attached to a given declaration.
843  /// Returns nullptr if no comment is attached.
844  ///
845  /// \param OriginalDecl if not nullptr, is set to declaration AST node that
846  /// had the comment, if the comment we found comes from a redeclaration.
847  const RawComment *
849  const Decl **OriginalDecl = nullptr) const;
850 
851  /// Searches existing comments for doc comments that should be attached to \p
852  /// Decls. If any doc comment is found, it is parsed.
853  ///
854  /// Requirement: All \p Decls are in the same file.
855  ///
856  /// If the last comment in the file is already attached we assume
857  /// there are not comments left to be attached to \p Decls.
859  const Preprocessor *PP);
860 
861  /// Return parsed documentation comment attached to a given declaration.
862  /// Returns nullptr if no comment is attached.
863  ///
864  /// \param PP the Preprocessor used with this TU. Could be nullptr if
865  /// preprocessor is not available.
867  const Preprocessor *PP) const;
868 
869  /// Return parsed documentation comment attached to a given declaration.
870  /// Returns nullptr if no comment is attached. Does not look at any
871  /// redeclarations of the declaration.
873 
875  const Decl *D) const;
876 
877 private:
878  mutable comments::CommandTraits CommentCommandTraits;
879 
880  /// Iterator that visits import declarations.
881  class import_iterator {
882  ImportDecl *Import = nullptr;
883 
884  public:
885  using value_type = ImportDecl *;
886  using reference = ImportDecl *;
887  using pointer = ImportDecl *;
888  using difference_type = int;
889  using iterator_category = std::forward_iterator_tag;
890 
891  import_iterator() = default;
892  explicit import_iterator(ImportDecl *Import) : Import(Import) {}
893 
894  reference operator*() const { return Import; }
895  pointer operator->() const { return Import; }
896 
897  import_iterator &operator++() {
898  Import = ASTContext::getNextLocalImport(Import);
899  return *this;
900  }
901 
902  import_iterator operator++(int) {
903  import_iterator Other(*this);
904  ++(*this);
905  return Other;
906  }
907 
908  friend bool operator==(import_iterator X, import_iterator Y) {
909  return X.Import == Y.Import;
910  }
911 
912  friend bool operator!=(import_iterator X, import_iterator Y) {
913  return X.Import != Y.Import;
914  }
915  };
916 
917 public:
919  return CommentCommandTraits;
920  }
921 
922  /// Retrieve the attributes for the given declaration.
923  AttrVec& getDeclAttrs(const Decl *D);
924 
925  /// Erase the attributes corresponding to the given declaration.
926  void eraseDeclAttrs(const Decl *D);
927 
928  /// If this variable is an instantiated static data member of a
929  /// class template specialization, returns the templated static data member
930  /// from which it was instantiated.
931  // FIXME: Remove ?
933  const VarDecl *Var);
934 
935  /// Note that the static data member \p Inst is an instantiation of
936  /// the static data member template \p Tmpl of a class template.
939  SourceLocation PointOfInstantiation = SourceLocation());
940 
943 
946 
947  /// If the given using decl \p Inst is an instantiation of
948  /// another (possibly unresolved) using decl, return it.
950 
951  /// Remember that the using decl \p Inst is an instantiation
952  /// of the using decl \p Pattern of a class template.
953  void setInstantiatedFromUsingDecl(NamedDecl *Inst, NamedDecl *Pattern);
954 
955  /// If the given using-enum decl \p Inst is an instantiation of
956  /// another using-enum decl, return it.
958 
959  /// Remember that the using enum decl \p Inst is an instantiation
960  /// of the using enum decl \p Pattern of a class template.
962  UsingEnumDecl *Pattern);
963 
966  UsingShadowDecl *Pattern);
967 
969 
971 
972  // Access to the set of methods overridden by the given C++ method.
973  using overridden_cxx_method_iterator = CXXMethodVector::const_iterator;
975  overridden_methods_begin(const CXXMethodDecl *Method) const;
976 
978  overridden_methods_end(const CXXMethodDecl *Method) const;
979 
980  unsigned overridden_methods_size(const CXXMethodDecl *Method) const;
981 
983  llvm::iterator_range<overridden_cxx_method_iterator>;
984 
986 
987  /// Note that the given C++ \p Method overrides the given \p
988  /// Overridden method.
989  void addOverriddenMethod(const CXXMethodDecl *Method,
990  const CXXMethodDecl *Overridden);
991 
992  /// Return C++ or ObjC overridden methods for the given \p Method.
993  ///
994  /// An ObjC method is considered to override any method in the class's
995  /// base classes, its protocols, or its categories' protocols, that has
996  /// the same selector and is of the same kind (class or instance).
997  /// A method in an implementation is not considered as overriding the same
998  /// method in the interface or its categories.
1000  const NamedDecl *Method,
1001  SmallVectorImpl<const NamedDecl *> &Overridden) const;
1002 
1003  /// Notify the AST context that a new import declaration has been
1004  /// parsed or implicitly created within this translation unit.
1005  void addedLocalImportDecl(ImportDecl *Import);
1006 
1008  return Import->getNextLocalImport();
1009  }
1010 
1011  using import_range = llvm::iterator_range<import_iterator>;
1012 
1014  return import_range(import_iterator(FirstLocalImport), import_iterator());
1015  }
1016 
1018  Decl *Result = MergedDecls.lookup(D);
1019  return Result ? Result : D;
1020  }
1021  void setPrimaryMergedDecl(Decl *D, Decl *Primary) {
1022  MergedDecls[D] = Primary;
1023  }
1024 
1025  /// Note that the definition \p ND has been merged into module \p M,
1026  /// and should be visible whenever \p M is visible.
1028  bool NotifyListeners = true);
1029 
1030  /// Clean up the merged definition list. Call this if you might have
1031  /// added duplicates into the list.
1033 
1034  /// Get the additional modules in which the definition \p Def has
1035  /// been merged.
1037 
1038  /// Add a declaration to the list of declarations that are initialized
1039  /// for a module. This will typically be a global variable (with internal
1040  /// linkage) that runs module initializers, such as the iostream initializer,
1041  /// or an ImportDecl nominating another module that has initializers.
1042  void addModuleInitializer(Module *M, Decl *Init);
1043 
1045 
1046  /// Get the initializations to perform when importing a module, if any.
1048 
1050  return TUDecl->getMostRecentDecl();
1051  }
1053  assert(!TUDecl || TUKind == TU_Incremental);
1055  if (TraversalScope.empty() || TraversalScope.back() == TUDecl)
1056  TraversalScope = {NewTUDecl};
1057  if (TUDecl)
1058  NewTUDecl->setPreviousDecl(TUDecl);
1059  TUDecl = NewTUDecl;
1060  }
1061 
1065 
1066  // Builtin Types.
1070  CanQualType WCharTy; // [C++ 3.9.1p5].
1071  CanQualType WideCharTy; // Same as WCharTy in C++, integer type in C99.
1072  CanQualType WIntTy; // [C99 7.24.1], integer type unchanged by default promotions.
1073  CanQualType Char8Ty; // [C++20 proposal]
1074  CanQualType Char16Ty; // [C++0x 3.9.1p5], integer type in C99.
1075  CanQualType Char32Ty; // [C++0x 3.9.1p5], integer type in C99.
1081  LongAccumTy; // ISO/IEC JTC1 SC22 WG14 N1169 Extension
1091  CanQualType HalfTy; // [OpenCL 6.1.1.1], ARM NEON
1093  CanQualType Float16Ty; // C11 extension ISO/IEC TS 18661-3
1102 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
1103  CanQualType SingletonId;
1104 #include "clang/Basic/OpenCLImageTypes.def"
1109 #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
1110  CanQualType Id##Ty;
1111 #include "clang/Basic/OpenCLExtensionTypes.def"
1112 #define SVE_TYPE(Name, Id, SingletonId) \
1113  CanQualType SingletonId;
1114 #include "clang/Basic/AArch64SVEACLETypes.def"
1115 #define PPC_VECTOR_TYPE(Name, Id, Size) \
1116  CanQualType Id##Ty;
1117 #include "clang/Basic/PPCTypes.def"
1118 #define RVV_TYPE(Name, Id, SingletonId) \
1119  CanQualType SingletonId;
1120 #include "clang/Basic/RISCVVTypes.def"
1121 
1122  // Types for deductions in C++0x [stmt.ranged]'s desugaring. Built on demand.
1123  mutable QualType AutoDeductTy; // Deduction against 'auto'.
1124  mutable QualType AutoRRefDeductTy; // Deduction against 'auto &&'.
1125 
1126  // Decl used to help define __builtin_va_list for some targets.
1127  // The decl is built when constructing 'BuiltinVaListDecl'.
1128  mutable Decl *VaListTagDecl = nullptr;
1129 
1130  // Implicitly-declared type 'struct _GUID'.
1131  mutable TagDecl *MSGuidTagDecl = nullptr;
1132 
1133  /// Keep track of CUDA/HIP device-side variables ODR-used by host code.
1135 
1137  SelectorTable &sels, Builtin::Context &builtins,
1139  ASTContext(const ASTContext &) = delete;
1140  ASTContext &operator=(const ASTContext &) = delete;
1141  ~ASTContext();
1142 
1143  /// Attach an external AST source to the AST context.
1144  ///
1145  /// The external AST source provides the ability to load parts of
1146  /// the abstract syntax tree as needed from some external storage,
1147  /// e.g., a precompiled header.
1149 
1150  /// Retrieve a pointer to the external AST source associated
1151  /// with this AST context, if any.
1153  return ExternalSource.get();
1154  }
1155 
1156  /// Attach an AST mutation listener to the AST context.
1157  ///
1158  /// The AST mutation listener provides the ability to track modifications to
1159  /// the abstract syntax tree entities committed after they were initially
1160  /// created.
1162  this->Listener = Listener;
1163  }
1164 
1165  /// Retrieve a pointer to the AST mutation listener associated
1166  /// with this AST context, if any.
1168 
1169  void PrintStats() const;
1170  const SmallVectorImpl<Type *>& getTypes() const { return Types; }
1171 
1173  const IdentifierInfo *II) const;
1174 
1175  /// Create a new implicit TU-level CXXRecordDecl or RecordDecl
1176  /// declaration.
1177  RecordDecl *buildImplicitRecord(StringRef Name,
1178  RecordDecl::TagKind TK = TTK_Struct) const;
1179 
1180  /// Create a new implicit TU-level typedef declaration.
1181  TypedefDecl *buildImplicitTypedef(QualType T, StringRef Name) const;
1182 
1183  /// Retrieve the declaration for the 128-bit signed integer type.
1184  TypedefDecl *getInt128Decl() const;
1185 
1186  /// Retrieve the declaration for the 128-bit unsigned integer type.
1187  TypedefDecl *getUInt128Decl() const;
1188 
1189  //===--------------------------------------------------------------------===//
1190  // Type Constructors
1191  //===--------------------------------------------------------------------===//
1192 
1193 private:
1194  /// Return a type with extended qualifiers.
1195  QualType getExtQualType(const Type *Base, Qualifiers Quals) const;
1196 
1197  QualType getTypeDeclTypeSlow(const TypeDecl *Decl) const;
1198 
1199  QualType getPipeType(QualType T, bool ReadOnly) const;
1200 
1201 public:
1202  /// Return the uniqued reference to the type for an address space
1203  /// qualified type with the specified type and address space.
1204  ///
1205  /// The resulting type has a union of the qualifiers from T and the address
1206  /// space. If T already has an address space specifier, it is silently
1207  /// replaced.
1208  QualType getAddrSpaceQualType(QualType T, LangAS AddressSpace) const;
1209 
1210  /// Remove any existing address space on the type and returns the type
1211  /// with qualifiers intact (or that's the idea anyway)
1212  ///
1213  /// The return type should be T with all prior qualifiers minus the address
1214  /// space.
1216 
1217  /// Apply Objective-C protocol qualifiers to the given type.
1218  /// \param allowOnPointerType specifies if we can apply protocol
1219  /// qualifiers on ObjCObjectPointerType. It can be set to true when
1220  /// constructing the canonical type of a Objective-C type parameter.
1222  ArrayRef<ObjCProtocolDecl *> protocols, bool &hasError,
1223  bool allowOnPointerType = false) const;
1224 
1225  /// Return the uniqued reference to the type for an Objective-C
1226  /// gc-qualified type.
1227  ///
1228  /// The resulting type has a union of the qualifiers from T and the gc
1229  /// attribute.
1231 
1232  /// Remove the existing address space on the type if it is a pointer size
1233  /// address space and return the type with qualifiers intact.
1235 
1236  /// Return the uniqued reference to the type for a \c restrict
1237  /// qualified type.
1238  ///
1239  /// The resulting type has a union of the qualifiers from \p T and
1240  /// \c restrict.
1243  }
1244 
1245  /// Return the uniqued reference to the type for a \c volatile
1246  /// qualified type.
1247  ///
1248  /// The resulting type has a union of the qualifiers from \p T and
1249  /// \c volatile.
1252  }
1253 
1254  /// Return the uniqued reference to the type for a \c const
1255  /// qualified type.
1256  ///
1257  /// The resulting type has a union of the qualifiers from \p T and \c const.
1258  ///
1259  /// It can be reasonably expected that this will always be equivalent to
1260  /// calling T.withConst().
1261  QualType getConstType(QualType T) const { return T.withConst(); }
1262 
1263  /// Change the ExtInfo on a function type.
1264  const FunctionType *adjustFunctionType(const FunctionType *Fn,
1265  FunctionType::ExtInfo EInfo);
1266 
1267  /// Adjust the given function result type.
1269 
1270  /// Change the result type of a function type once it is deduced.
1272 
1273  /// Get a function type and produce the equivalent function type with the
1274  /// specified exception specification. Type sugar that can be present on a
1275  /// declaration of a function with an exception specification is permitted
1276  /// and preserved. Other type sugar (for instance, typedefs) is not.
1279 
1280  /// Determine whether two function types are the same, ignoring
1281  /// exception specifications in cases where they're part of the type.
1283 
1284  /// Change the exception specification on a function once it is
1285  /// delay-parsed, instantiated, or computed.
1288  bool AsWritten = false);
1289 
1290  /// Get a function type and produce the equivalent function type where
1291  /// pointer size address spaces in the return type and parameter tyeps are
1292  /// replaced with the default address space.
1294 
1295  /// Determine whether two function types are the same, ignoring pointer sizes
1296  /// in the return type and parameter types.
1298 
1299  /// Return the uniqued reference to the type for a complex
1300  /// number with the specified element type.
1301  QualType getComplexType(QualType T) const;
1304  }
1305 
1306  /// Return the uniqued reference to the type for a pointer to
1307  /// the specified type.
1308  QualType getPointerType(QualType T) const;
1311  }
1312 
1313  /// Return the uniqued reference to a type adjusted from the original
1314  /// type to a new type.
1315  QualType getAdjustedType(QualType Orig, QualType New) const;
1318  getAdjustedType((QualType)Orig, (QualType)New));
1319  }
1320 
1321  /// Return the uniqued reference to the decayed version of the given
1322  /// type. Can only be called on array and function types which decay to
1323  /// pointer types.
1324  QualType getDecayedType(QualType T) const;
1327  }
1328 
1329  /// Return the uniqued reference to the atomic type for the specified
1330  /// type.
1331  QualType getAtomicType(QualType T) const;
1332 
1333  /// Return the uniqued reference to the type for a block of the
1334  /// specified type.
1336 
1337  /// Gets the struct used to keep track of the descriptor for pointer to
1338  /// blocks.
1340 
1341  /// Return a read_only pipe type for the specified type.
1343 
1344  /// Return a write_only pipe type for the specified type.
1346 
1347  /// Return an extended integer type with the specified signedness and bit
1348  /// count.
1349  QualType getExtIntType(bool Unsigned, unsigned NumBits) const;
1350 
1351  /// Return a dependent extended integer type with the specified signedness and
1352  /// bit count.
1353  QualType getDependentExtIntType(bool Unsigned, Expr *BitsExpr) const;
1354 
1355  /// Gets the struct used to keep track of the extended descriptor for
1356  /// pointer to blocks.
1358 
1359  /// Map an AST Type to an OpenCLTypeKind enum value.
1360  OpenCLTypeKind getOpenCLTypeKind(const Type *T) const;
1361 
1362  /// Get address space for OpenCL type.
1363  LangAS getOpenCLTypeAddrSpace(const Type *T) const;
1364 
1365  /// Returns default address space based on OpenCL version and enabled features
1367  return LangOpts.OpenCLGenericAddressSpace ? LangAS::opencl_generic
1369  }
1370 
1372  cudaConfigureCallDecl = FD;
1373  }
1374 
1376  return cudaConfigureCallDecl;
1377  }
1378 
1379  /// Returns true iff we need copy/dispose helpers for the given type.
1380  bool BlockRequiresCopying(QualType Ty, const VarDecl *D);
1381 
1382  /// Returns true, if given type has a known lifetime. HasByrefExtendedLayout
1383  /// is set to false in this case. If HasByrefExtendedLayout returns true,
1384  /// byref variable has extended lifetime.
1385  bool getByrefLifetime(QualType Ty,
1386  Qualifiers::ObjCLifetime &Lifetime,
1387  bool &HasByrefExtendedLayout) const;
1388 
1389  /// Return the uniqued reference to the type for an lvalue reference
1390  /// to the specified type.
1391  QualType getLValueReferenceType(QualType T, bool SpelledAsLValue = true)
1392  const;
1393 
1394  /// Return the uniqued reference to the type for an rvalue reference
1395  /// to the specified type.
1397 
1398  /// Return the uniqued reference to the type for a member pointer to
1399  /// the specified type in the specified class.
1400  ///
1401  /// The class \p Cls is a \c Type because it could be a dependent name.
1402  QualType getMemberPointerType(QualType T, const Type *Cls) const;
1403 
1404  /// Return a non-unique reference to the type for a variable array of
1405  /// the specified element type.
1406  QualType getVariableArrayType(QualType EltTy, Expr *NumElts,
1408  unsigned IndexTypeQuals,
1409  SourceRange Brackets) const;
1410 
1411  /// Return a non-unique reference to the type for a dependently-sized
1412  /// array of the specified element type.
1413  ///
1414  /// FIXME: We will need these to be uniqued, or at least comparable, at some
1415  /// point.
1418  unsigned IndexTypeQuals,
1419  SourceRange Brackets) const;
1420 
1421  /// Return a unique reference to the type for an incomplete array of
1422  /// the specified element type.
1425  unsigned IndexTypeQuals) const;
1426 
1427  /// Return the unique reference to the type for a constant array of
1428  /// the specified element type.
1429  QualType getConstantArrayType(QualType EltTy, const llvm::APInt &ArySize,
1430  const Expr *SizeExpr,
1432  unsigned IndexTypeQuals) const;
1433 
1434  /// Return a type for a constant array for a string literal of the
1435  /// specified element type and length.
1436  QualType getStringLiteralArrayType(QualType EltTy, unsigned Length) const;
1437 
1438  /// Returns a vla type where known sizes are replaced with [*].
1440 
1441  // Convenience struct to return information about a builtin vector type.
1444  llvm::ElementCount EC;
1445  unsigned NumVectors;
1447  unsigned NumVectors)
1449  };
1450 
1451  /// Returns the element type, element count and number of vectors
1452  /// (in case of tuple) for a builtin vector type.
1453  BuiltinVectorTypeInfo
1454  getBuiltinVectorTypeInfo(const BuiltinType *VecTy) const;
1455 
1456  /// Return the unique reference to a scalable vector type of the specified
1457  /// element type and scalable number of elements.
1458  ///
1459  /// \pre \p EltTy must be a built-in type.
1460  QualType getScalableVectorType(QualType EltTy, unsigned NumElts) const;
1461 
1462  /// Return the unique reference to a vector type of the specified
1463  /// element type and size.
1464  ///
1465  /// \pre \p VectorType must be a built-in type.
1466  QualType getVectorType(QualType VectorType, unsigned NumElts,
1467  VectorType::VectorKind VecKind) const;
1468  /// Return the unique reference to the type for a dependently sized vector of
1469  /// the specified element type.
1471  SourceLocation AttrLoc,
1472  VectorType::VectorKind VecKind) const;
1473 
1474  /// Return the unique reference to an extended vector type
1475  /// of the specified element type and size.
1476  ///
1477  /// \pre \p VectorType must be a built-in type.
1478  QualType getExtVectorType(QualType VectorType, unsigned NumElts) const;
1479 
1480  /// \pre Return a non-unique reference to the type for a dependently-sized
1481  /// vector of the specified element type.
1482  ///
1483  /// FIXME: We will need these to be uniqued, or at least comparable, at some
1484  /// point.
1486  Expr *SizeExpr,
1487  SourceLocation AttrLoc) const;
1488 
1489  /// Return the unique reference to the matrix type of the specified element
1490  /// type and size
1491  ///
1492  /// \pre \p ElementType must be a valid matrix element type (see
1493  /// MatrixType::isValidElementType).
1494  QualType getConstantMatrixType(QualType ElementType, unsigned NumRows,
1495  unsigned NumColumns) const;
1496 
1497  /// Return the unique reference to the matrix type of the specified element
1498  /// type and size
1499  QualType getDependentSizedMatrixType(QualType ElementType, Expr *RowExpr,
1500  Expr *ColumnExpr,
1501  SourceLocation AttrLoc) const;
1502 
1504  Expr *AddrSpaceExpr,
1505  SourceLocation AttrLoc) const;
1506 
1507  /// Return a K&R style C function type like 'int()'.
1509  const FunctionType::ExtInfo &Info) const;
1510 
1512  return getFunctionNoProtoType(ResultTy, FunctionType::ExtInfo());
1513  }
1514 
1515  /// Return a normal function type with a typed argument list.
1517  const FunctionProtoType::ExtProtoInfo &EPI) const {
1518  return getFunctionTypeInternal(ResultTy, Args, EPI, false);
1519  }
1520 
1522 
1523 private:
1524  /// Return a normal function type with a typed argument list.
1525  QualType getFunctionTypeInternal(QualType ResultTy, ArrayRef<QualType> Args,
1527  bool OnlyWantCanonical) const;
1528 
1529 public:
1530  /// Return the unique reference to the type for the specified type
1531  /// declaration.
1533  const TypeDecl *PrevDecl = nullptr) const {
1534  assert(Decl && "Passed null for Decl param");
1535  if (Decl->TypeForDecl) return QualType(Decl->TypeForDecl, 0);
1536 
1537  if (PrevDecl) {
1538  assert(PrevDecl->TypeForDecl && "previous decl has no TypeForDecl");
1539  Decl->TypeForDecl = PrevDecl->TypeForDecl;
1540  return QualType(PrevDecl->TypeForDecl, 0);
1541  }
1542 
1543  return getTypeDeclTypeSlow(Decl);
1544  }
1545 
1546  /// Return the unique reference to the type for the specified
1547  /// typedef-name decl.
1549  QualType Underlying = QualType()) const;
1550 
1551  QualType getRecordType(const RecordDecl *Decl) const;
1552 
1553  QualType getEnumType(const EnumDecl *Decl) const;
1554 
1556 
1558  QualType modifiedType,
1559  QualType equivalentType);
1560 
1562  QualType Replacement) const;
1564  const TemplateTypeParmType *Replaced,
1565  const TemplateArgument &ArgPack);
1566 
1567  QualType
1568  getTemplateTypeParmType(unsigned Depth, unsigned Index,
1569  bool ParameterPack,
1570  TemplateTypeParmDecl *ParmDecl = nullptr) const;
1571 
1574  QualType Canon = QualType()) const;
1575 
1576  QualType
1578  ArrayRef<TemplateArgument> Args) const;
1579 
1581  const TemplateArgumentListInfo &Args,
1582  QualType Canon = QualType()) const;
1583 
1584  TypeSourceInfo *
1586  const TemplateArgumentListInfo &Args,
1587  QualType Canon = QualType()) const;
1588 
1589  QualType getParenType(QualType NamedType) const;
1590 
1592  const IdentifierInfo *MacroII) const;
1593 
1595  NestedNameSpecifier *NNS, QualType NamedType,
1596  TagDecl *OwnedTagDecl = nullptr) const;
1598  NestedNameSpecifier *NNS,
1599  const IdentifierInfo *Name,
1600  QualType Canon = QualType()) const;
1601 
1603  NestedNameSpecifier *NNS,
1604  const IdentifierInfo *Name,
1605  const TemplateArgumentListInfo &Args) const;
1608  const IdentifierInfo *Name, ArrayRef<TemplateArgument> Args) const;
1609 
1611 
1612  /// Get a template argument list with one argument per template parameter
1613  /// in a template parameter list, such as for the injected class name of
1614  /// a class template.
1617 
1618  /// Form a pack expansion type with the given pattern.
1619  /// \param NumExpansions The number of expansions for the pack, if known.
1620  /// \param ExpectPackInType If \c false, we should not expect \p Pattern to
1621  /// contain an unexpanded pack. This only makes sense if the pack
1622  /// expansion is used in a context where the arity is inferred from
1623  /// elsewhere, such as if the pattern contains a placeholder type or
1624  /// if this is the canonical type of another pack expansion type.
1626  Optional<unsigned> NumExpansions,
1627  bool ExpectPackInType = true);
1628 
1630  ObjCInterfaceDecl *PrevDecl = nullptr) const;
1631 
1632  /// Legacy interface: cannot provide type arguments or __kindof.
1634  ObjCProtocolDecl * const *Protocols,
1635  unsigned NumProtocols) const;
1636 
1638  ArrayRef<QualType> typeArgs,
1639  ArrayRef<ObjCProtocolDecl *> protocols,
1640  bool isKindOf) const;
1641 
1643  ArrayRef<ObjCProtocolDecl *> protocols) const;
1645  ObjCTypeParamDecl *New) const;
1646 
1648 
1649  /// QIdProtocolsAdoptObjCObjectProtocols - Checks that protocols in
1650  /// QT's qualified-id protocol list adopt all protocols in IDecl's list
1651  /// of protocols.
1653  ObjCInterfaceDecl *IDecl);
1654 
1655  /// Return a ObjCObjectPointerType type for the given ObjCObjectType.
1657 
1658  /// GCC extension.
1659  QualType getTypeOfExprType(Expr *e) const;
1660  QualType getTypeOfType(QualType t) const;
1661 
1662  QualType getReferenceQualifiedType(const Expr *e) const;
1663 
1664  /// C++11 decltype.
1665  QualType getDecltypeType(Expr *e, QualType UnderlyingType) const;
1666 
1667  /// Unary type transforms
1668  QualType getUnaryTransformType(QualType BaseType, QualType UnderlyingType,
1669  UnaryTransformType::UTTKind UKind) const;
1670 
1671  /// C++11 deduced auto type.
1673  bool IsDependent, bool IsPack = false,
1674  ConceptDecl *TypeConstraintConcept = nullptr,
1675  ArrayRef<TemplateArgument> TypeConstraintArgs ={}) const;
1676 
1677  /// C++11 deduction pattern for 'auto' type.
1678  QualType getAutoDeductType() const;
1679 
1680  /// C++11 deduction pattern for 'auto &&' type.
1681  QualType getAutoRRefDeductType() const;
1682 
1683  /// C++17 deduced class template specialization type.
1684  QualType getDeducedTemplateSpecializationType(TemplateName Template,
1685  QualType DeducedType,
1686  bool IsDependent) const;
1687 
1688  /// Return the unique reference to the type for the specified TagDecl
1689  /// (struct/union/class/enum) decl.
1690  QualType getTagDeclType(const TagDecl *Decl) const;
1691 
1692  /// Return the unique type for "size_t" (C99 7.17), defined in
1693  /// <stddef.h>.
1694  ///
1695  /// The sizeof operator requires this (C99 6.5.3.4p4).
1696  CanQualType getSizeType() const;
1697 
1698  /// Return the unique signed counterpart of
1699  /// the integer type corresponding to size_t.
1701 
1702  /// Return the unique type for "intmax_t" (C99 7.18.1.5), defined in
1703  /// <stdint.h>.
1704  CanQualType getIntMaxType() const;
1705 
1706  /// Return the unique type for "uintmax_t" (C99 7.18.1.5), defined in
1707  /// <stdint.h>.
1708  CanQualType getUIntMaxType() const;
1709 
1710  /// Return the unique wchar_t type available in C++ (and available as
1711  /// __wchar_t as a Microsoft extension).
1712  QualType getWCharType() const { return WCharTy; }
1713 
1714  /// Return the type of wide characters. In C++, this returns the
1715  /// unique wchar_t type. In C99, this returns a type compatible with the type
1716  /// defined in <stddef.h> as defined by the target.
1718 
1719  /// Return the type of "signed wchar_t".
1720  ///
1721  /// Used when in C++, as a GCC extension.
1722  QualType getSignedWCharType() const;
1723 
1724  /// Return the type of "unsigned wchar_t".
1725  ///
1726  /// Used when in C++, as a GCC extension.
1728 
1729  /// In C99, this returns a type compatible with the type
1730  /// defined in <stddef.h> as defined by the target.
1731  QualType getWIntType() const { return WIntTy; }
1732 
1733  /// Return a type compatible with "intptr_t" (C99 7.18.1.4),
1734  /// as defined by the target.
1735  QualType getIntPtrType() const;
1736 
1737  /// Return a type compatible with "uintptr_t" (C99 7.18.1.4),
1738  /// as defined by the target.
1739  QualType getUIntPtrType() const;
1740 
1741  /// Return the unique type for "ptrdiff_t" (C99 7.17) defined in
1742  /// <stddef.h>. Pointer - pointer requires this (C99 6.5.6p9).
1743  QualType getPointerDiffType() const;
1744 
1745  /// Return the unique unsigned counterpart of "ptrdiff_t"
1746  /// integer type. The standard (C11 7.21.6.1p7) refers to this type
1747  /// in the definition of %tu format specifier.
1749 
1750  /// Return the unique type for "pid_t" defined in
1751  /// <sys/types.h>. We need this to compute the correct type for vfork().
1752  QualType getProcessIDType() const;
1753 
1754  /// Return the C structure type used to represent constant CFStrings.
1756 
1757  /// Returns the C struct type for objc_super
1758  QualType getObjCSuperType() const;
1759  void setObjCSuperType(QualType ST) { ObjCSuperType = ST; }
1760 
1761  /// Get the structure type used to representation CFStrings, or NULL
1762  /// if it hasn't yet been built.
1764  if (CFConstantStringTypeDecl)
1765  return getTypedefType(CFConstantStringTypeDecl);
1766  return QualType();
1767  }
1771 
1772  // This setter/getter represents the ObjC type for an NSConstantString.
1775  return ObjCConstantStringType;
1776  }
1777 
1779  return ObjCNSStringType;
1780  }
1781 
1783  ObjCNSStringType = T;
1784  }
1785 
1786  /// Retrieve the type that \c id has been defined to, which may be
1787  /// different from the built-in \c id if \c id has been typedef'd.
1789  if (ObjCIdRedefinitionType.isNull())
1790  return getObjCIdType();
1791  return ObjCIdRedefinitionType;
1792  }
1793 
1794  /// Set the user-written type that redefines \c id.
1796  ObjCIdRedefinitionType = RedefType;
1797  }
1798 
1799  /// Retrieve the type that \c Class has been defined to, which may be
1800  /// different from the built-in \c Class if \c Class has been typedef'd.
1802  if (ObjCClassRedefinitionType.isNull())
1803  return getObjCClassType();
1804  return ObjCClassRedefinitionType;
1805  }
1806 
1807  /// Set the user-written type that redefines 'SEL'.
1809  ObjCClassRedefinitionType = RedefType;
1810  }
1811 
1812  /// Retrieve the type that 'SEL' has been defined to, which may be
1813  /// different from the built-in 'SEL' if 'SEL' has been typedef'd.
1815  if (ObjCSelRedefinitionType.isNull())
1816  return getObjCSelType();
1817  return ObjCSelRedefinitionType;
1818  }
1819 
1820  /// Set the user-written type that redefines 'SEL'.
1822  ObjCSelRedefinitionType = RedefType;
1823  }
1824 
1825  /// Retrieve the identifier 'NSObject'.
1827  if (!NSObjectName) {
1828  NSObjectName = &Idents.get("NSObject");
1829  }
1830 
1831  return NSObjectName;
1832  }
1833 
1834  /// Retrieve the identifier 'NSCopying'.
1836  if (!NSCopyingName) {
1837  NSCopyingName = &Idents.get("NSCopying");
1838  }
1839 
1840  return NSCopyingName;
1841  }
1842 
1844 
1845  CanQualType getNSIntegerType() const;
1846 
1847  /// Retrieve the identifier 'bool'.
1849  if (!BoolName)
1850  BoolName = &Idents.get("bool");
1851  return BoolName;
1852  }
1853 
1855  if (!MakeIntegerSeqName)
1856  MakeIntegerSeqName = &Idents.get("__make_integer_seq");
1857  return MakeIntegerSeqName;
1858  }
1859 
1861  if (!TypePackElementName)
1862  TypePackElementName = &Idents.get("__type_pack_element");
1863  return TypePackElementName;
1864  }
1865 
1866  /// Retrieve the Objective-C "instancetype" type, if already known;
1867  /// otherwise, returns a NULL type;
1870  }
1871 
1872  /// Retrieve the typedef declaration corresponding to the Objective-C
1873  /// "instancetype" type.
1875 
1876  /// Set the type for the C FILE type.
1877  void setFILEDecl(TypeDecl *FILEDecl) { this->FILEDecl = FILEDecl; }
1878 
1879  /// Retrieve the C FILE type.
1881  if (FILEDecl)
1882  return getTypeDeclType(FILEDecl);
1883  return QualType();
1884  }
1885 
1886  /// Set the type for the C jmp_buf type.
1887  void setjmp_bufDecl(TypeDecl *jmp_bufDecl) {
1888  this->jmp_bufDecl = jmp_bufDecl;
1889  }
1890 
1891  /// Retrieve the C jmp_buf type.
1893  if (jmp_bufDecl)
1894  return getTypeDeclType(jmp_bufDecl);
1895  return QualType();
1896  }
1897 
1898  /// Set the type for the C sigjmp_buf type.
1899  void setsigjmp_bufDecl(TypeDecl *sigjmp_bufDecl) {
1900  this->sigjmp_bufDecl = sigjmp_bufDecl;
1901  }
1902 
1903  /// Retrieve the C sigjmp_buf type.
1905  if (sigjmp_bufDecl)
1906  return getTypeDeclType(sigjmp_bufDecl);
1907  return QualType();
1908  }
1909 
1910  /// Set the type for the C ucontext_t type.
1911  void setucontext_tDecl(TypeDecl *ucontext_tDecl) {
1912  this->ucontext_tDecl = ucontext_tDecl;
1913  }
1914 
1915  /// Retrieve the C ucontext_t type.
1917  if (ucontext_tDecl)
1918  return getTypeDeclType(ucontext_tDecl);
1919  return QualType();
1920  }
1921 
1922  /// The result type of logical operations, '<', '>', '!=', etc.
1924  return getLangOpts().CPlusPlus ? BoolTy : IntTy;
1925  }
1926 
1927  /// Emit the Objective-CC type encoding for the given type \p T into
1928  /// \p S.
1929  ///
1930  /// If \p Field is specified then record field names are also encoded.
1932  const FieldDecl *Field=nullptr,
1933  QualType *NotEncodedT=nullptr) const;
1934 
1935  /// Emit the Objective-C property type encoding for the given
1936  /// type \p T into \p S.
1938 
1939  void getLegacyIntegralTypeEncoding(QualType &t) const;
1940 
1941  /// Put the string version of the type qualifiers \p QT into \p S.
1943  std::string &S) const;
1944 
1945  /// Emit the encoded type for the function \p Decl into \p S.
1946  ///
1947  /// This is in the same format as Objective-C method encodings.
1948  ///
1949  /// \returns true if an error occurred (e.g., because one of the parameter
1950  /// types is incomplete), false otherwise.
1952 
1953  /// Emit the encoded type for the method declaration \p Decl into
1954  /// \p S.
1956  bool Extended = false) const;
1957 
1958  /// Return the encoded type for this block declaration.
1960 
1961  /// getObjCEncodingForPropertyDecl - Return the encoded type for
1962  /// this method declaration. If non-NULL, Container must be either
1963  /// an ObjCCategoryImplDecl or ObjCImplementationDecl; it should
1964  /// only be NULL when getting encodings for protocol properties.
1966  const Decl *Container) const;
1967 
1969  ObjCProtocolDecl *rProto) const;
1970 
1972  const ObjCPropertyDecl *PD,
1973  const Decl *Container) const;
1974 
1975  /// Return the size of type \p T for Objective-C encoding purpose,
1976  /// in characters.
1978 
1979  /// Retrieve the typedef corresponding to the predefined \c id type
1980  /// in Objective-C.
1981  TypedefDecl *getObjCIdDecl() const;
1982 
1983  /// Represents the Objective-CC \c id type.
1984  ///
1985  /// This is set up lazily, by Sema. \c id is always a (typedef for a)
1986  /// pointer type, a pointer to a struct.
1988  return getTypeDeclType(getObjCIdDecl());
1989  }
1990 
1991  /// Retrieve the typedef corresponding to the predefined 'SEL' type
1992  /// in Objective-C.
1993  TypedefDecl *getObjCSelDecl() const;
1994 
1995  /// Retrieve the type that corresponds to the predefined Objective-C
1996  /// 'SEL' type.
1998  return getTypeDeclType(getObjCSelDecl());
1999  }
2000 
2001  /// Retrieve the typedef declaration corresponding to the predefined
2002  /// Objective-C 'Class' type.
2003  TypedefDecl *getObjCClassDecl() const;
2004 
2005  /// Represents the Objective-C \c Class type.
2006  ///
2007  /// This is set up lazily, by Sema. \c Class is always a (typedef for a)
2008  /// pointer type, a pointer to a struct.
2011  }
2012 
2013  /// Retrieve the Objective-C class declaration corresponding to
2014  /// the predefined \c Protocol class.
2016 
2017  /// Retrieve declaration of 'BOOL' typedef
2019  return BOOLDecl;
2020  }
2021 
2022  /// Save declaration of 'BOOL' typedef
2024  BOOLDecl = TD;
2025  }
2026 
2027  /// type of 'BOOL' type.
2029  return getTypeDeclType(getBOOLDecl());
2030  }
2031 
2032  /// Retrieve the type of the Objective-C \c Protocol class.
2035  }
2036 
2037  /// Retrieve the C type declaration corresponding to the predefined
2038  /// \c __builtin_va_list type.
2040 
2041  /// Retrieve the type of the \c __builtin_va_list type.
2044  }
2045 
2046  /// Retrieve the C type declaration corresponding to the predefined
2047  /// \c __va_list_tag type used to help define the \c __builtin_va_list type
2048  /// for some targets.
2049  Decl *getVaListTagDecl() const;
2050 
2051  /// Retrieve the C type declaration corresponding to the predefined
2052  /// \c __builtin_ms_va_list type.
2054 
2055  /// Retrieve the type of the \c __builtin_ms_va_list type.
2058  }
2059 
2060  /// Retrieve the implicitly-predeclared 'struct _GUID' declaration.
2062 
2063  /// Retrieve the implicitly-predeclared 'struct _GUID' type.
2065  assert(MSGuidTagDecl && "asked for GUID type but MS extensions disabled");
2066  return getTagDeclType(MSGuidTagDecl);
2067  }
2068 
2069  /// Return whether a declaration to a builtin is allowed to be
2070  /// overloaded/redeclared.
2071  bool canBuiltinBeRedeclared(const FunctionDecl *) const;
2072 
2073  /// Return a type with additional \c const, \c volatile, or
2074  /// \c restrict qualifiers.
2075  QualType getCVRQualifiedType(QualType T, unsigned CVR) const {
2076  return getQualifiedType(T, Qualifiers::fromCVRMask(CVR));
2077  }
2078 
2079  /// Un-split a SplitQualType.
2081  return getQualifiedType(split.Ty, split.Quals);
2082  }
2083 
2084  /// Return a type with additional qualifiers.
2086  if (!Qs.hasNonFastQualifiers())
2087  return T.withFastQualifiers(Qs.getFastQualifiers());
2088  QualifierCollector Qc(Qs);
2089  const Type *Ptr = Qc.strip(T);
2090  return getExtQualType(Ptr, Qc);
2091  }
2092 
2093  /// Return a type with additional qualifiers.
2095  if (!Qs.hasNonFastQualifiers())
2096  return QualType(T, Qs.getFastQualifiers());
2097  return getExtQualType(T, Qs);
2098  }
2099 
2100  /// Return a type with the given lifetime qualifier.
2101  ///
2102  /// \pre Neither type.ObjCLifetime() nor \p lifetime may be \c OCL_None.
2104  Qualifiers::ObjCLifetime lifetime) {
2105  assert(type.getObjCLifetime() == Qualifiers::OCL_None);
2106  assert(lifetime != Qualifiers::OCL_None);
2107 
2108  Qualifiers qs;
2109  qs.addObjCLifetime(lifetime);
2110  return getQualifiedType(type, qs);
2111  }
2112 
2113  /// getUnqualifiedObjCPointerType - Returns version of
2114  /// Objective-C pointer type with lifetime qualifier removed.
2116  if (!type.getTypePtr()->isObjCObjectPointerType() ||
2117  !type.getQualifiers().hasObjCLifetime())
2118  return type;
2119  Qualifiers Qs = type.getQualifiers();
2120  Qs.removeObjCLifetime();
2121  return getQualifiedType(type.getUnqualifiedType(), Qs);
2122  }
2123 
2124  unsigned char getFixedPointScale(QualType Ty) const;
2125  unsigned char getFixedPointIBits(QualType Ty) const;
2126  llvm::FixedPointSemantics getFixedPointSemantics(QualType Ty) const;
2127  llvm::APFixedPoint getFixedPointMax(QualType Ty) const;
2128  llvm::APFixedPoint getFixedPointMin(QualType Ty) const;
2129 
2131  SourceLocation NameLoc) const;
2132 
2134  UnresolvedSetIterator End) const;
2136 
2138  bool TemplateKeyword,
2139  TemplateDecl *Template) const;
2140 
2142  const IdentifierInfo *Name) const;
2144  OverloadedOperatorKind Operator) const;
2146  TemplateName replacement) const;
2148  const TemplateArgument &ArgPack) const;
2149 
2151  /// No error
2153 
2154  /// Missing a type
2156 
2157  /// Missing a type from <stdio.h>
2159 
2160  /// Missing a type from <setjmp.h>
2162 
2163  /// Missing a type from <ucontext.h>
2165  };
2166 
2167  QualType DecodeTypeStr(const char *&Str, const ASTContext &Context,
2169  bool &RequireICE, bool AllowTypeModifiers) const;
2170 
2171  /// Return the type for the specified builtin.
2172  ///
2173  /// If \p IntegerConstantArgs is non-null, it is filled in with a bitmask of
2174  /// arguments to the builtin that are required to be integer constant
2175  /// expressions.
2176  QualType GetBuiltinType(unsigned ID, GetBuiltinTypeError &Error,
2177  unsigned *IntegerConstantArgs = nullptr) const;
2178 
2179  /// Types and expressions required to build C++2a three-way comparisons
2180  /// using operator<=>, including the values return by builtin <=> operators.
2182 
2183 private:
2184  CanQualType getFromTargetType(unsigned Type) const;
2185  TypeInfo getTypeInfoImpl(const Type *T) const;
2186 
2187  //===--------------------------------------------------------------------===//
2188  // Type Predicates.
2189  //===--------------------------------------------------------------------===//
2190 
2191 public:
2192  /// Return one of the GCNone, Weak or Strong Objective-C garbage
2193  /// collection attributes.
2195 
2196  /// Return true if the given vector types are of the same unqualified
2197  /// type or if they are equivalent to the same GCC vector type.
2198  ///
2199  /// \note This ignores whether they are target-specific (AltiVec or Neon)
2200  /// types.
2201  bool areCompatibleVectorTypes(QualType FirstVec, QualType SecondVec);
2202 
2203  /// Return true if the given types are an SVE builtin and a VectorType that
2204  /// is a fixed-length representation of the SVE builtin for a specific
2205  /// vector-length.
2206  bool areCompatibleSveTypes(QualType FirstType, QualType SecondType);
2207 
2208  /// Return true if the given vector types are lax-compatible SVE vector types,
2209  /// false otherwise.
2210  bool areLaxCompatibleSveTypes(QualType FirstType, QualType SecondType);
2211 
2212  /// Return true if the type has been explicitly qualified with ObjC ownership.
2213  /// A type may be implicitly qualified with ownership under ObjC ARC, and in
2214  /// some cases the compiler treats these differently.
2215  bool hasDirectOwnershipQualifier(QualType Ty) const;
2216 
2217  /// Return true if this is an \c NSObject object with its \c NSObject
2218  /// attribute set.
2219  static bool isObjCNSObjectType(QualType Ty) {
2220  return Ty->isObjCNSObjectType();
2221  }
2222 
2223  //===--------------------------------------------------------------------===//
2224  // Type Sizing and Analysis
2225  //===--------------------------------------------------------------------===//
2226 
2227  /// Return the APFloat 'semantics' for the specified scalar floating
2228  /// point type.
2229  const llvm::fltSemantics &getFloatTypeSemantics(QualType T) const;
2230 
2231  /// Get the size and alignment of the specified complete type in bits.
2232  TypeInfo getTypeInfo(const Type *T) const;
2234 
2235  /// Get default simd alignment of the specified complete type in bits.
2236  unsigned getOpenMPDefaultSimdAlign(QualType T) const;
2237 
2238  /// Return the size of the specified (complete) type \p T, in bits.
2239  uint64_t getTypeSize(QualType T) const { return getTypeInfo(T).Width; }
2240  uint64_t getTypeSize(const Type *T) const { return getTypeInfo(T).Width; }
2241 
2242  /// Return the size of the character type, in bits.
2243  uint64_t getCharWidth() const {
2244  return getTypeSize(CharTy);
2245  }
2246 
2247  /// Convert a size in bits to a size in characters.
2248  CharUnits toCharUnitsFromBits(int64_t BitSize) const;
2249 
2250  /// Convert a size in characters to a size in bits.
2251  int64_t toBits(CharUnits CharSize) const;
2252 
2253  /// Return the size of the specified (complete) type \p T, in
2254  /// characters.
2256  CharUnits getTypeSizeInChars(const Type *T) const;
2257 
2259  if (Ty->isIncompleteType() || Ty->isDependentType())
2260  return None;
2261  return getTypeSizeInChars(Ty);
2262  }
2263 
2265  return getTypeSizeInCharsIfKnown(QualType(Ty, 0));
2266  }
2267 
2268  /// Return the ABI-specified alignment of a (complete) type \p T, in
2269  /// bits.
2270  unsigned getTypeAlign(QualType T) const { return getTypeInfo(T).Align; }
2271  unsigned getTypeAlign(const Type *T) const { return getTypeInfo(T).Align; }
2272 
2273  /// Return the ABI-specified natural alignment of a (complete) type \p T,
2274  /// before alignment adjustments, in bits.
2275  ///
2276  /// This alignment is curently used only by ARM and AArch64 when passing
2277  /// arguments of a composite type.
2278  unsigned getTypeUnadjustedAlign(QualType T) const {
2279  return getTypeUnadjustedAlign(T.getTypePtr());
2280  }
2281  unsigned getTypeUnadjustedAlign(const Type *T) const;
2282 
2283  /// Return the alignment of a type, in bits, or 0 if
2284  /// the type is incomplete and we cannot determine the alignment (for
2285  /// example, from alignment attributes). The returned alignment is the
2286  /// Preferred alignment if NeedsPreferredAlignment is true, otherwise is the
2287  /// ABI alignment.
2288  unsigned getTypeAlignIfKnown(QualType T,
2289  bool NeedsPreferredAlignment = false) const;
2290 
2291  /// Return the ABI-specified alignment of a (complete) type \p T, in
2292  /// characters.
2294  CharUnits getTypeAlignInChars(const Type *T) const;
2295 
2296  /// Return the PreferredAlignment of a (complete) type \p T, in
2297  /// characters.
2300  }
2301 
2302  /// getTypeUnadjustedAlignInChars - Return the ABI-specified alignment of a type,
2303  /// in characters, before alignment adjustments. This method does not work on
2304  /// incomplete types.
2307 
2308  // getTypeInfoDataSizeInChars - Return the size of a type, in chars. If the
2309  // type is a record, its data size is returned.
2311 
2312  TypeInfoChars getTypeInfoInChars(const Type *T) const;
2314 
2315  /// Determine if the alignment the type has was required using an
2316  /// alignment attribute.
2317  bool isAlignmentRequired(const Type *T) const;
2318  bool isAlignmentRequired(QualType T) const;
2319 
2320  /// Return the "preferred" alignment of the specified type \p T for
2321  /// the current target, in bits.
2322  ///
2323  /// This can be different than the ABI alignment in cases where it is
2324  /// beneficial for performance or backwards compatibility preserving to
2325  /// overalign a data type. (Note: despite the name, the preferred alignment
2326  /// is ABI-impacting, and not an optimization.)
2327  unsigned getPreferredTypeAlign(QualType T) const {
2328  return getPreferredTypeAlign(T.getTypePtr());
2329  }
2330  unsigned getPreferredTypeAlign(const Type *T) const;
2331 
2332  /// Return the default alignment for __attribute__((aligned)) on
2333  /// this target, to be used if no alignment value is specified.
2335 
2336  /// Return the alignment in bits that should be given to a
2337  /// global variable with type \p T.
2338  unsigned getAlignOfGlobalVar(QualType T) const;
2339 
2340  /// Return the alignment in characters that should be given to a
2341  /// global variable with type \p T.
2343 
2344  /// Return a conservative estimate of the alignment of the specified
2345  /// decl \p D.
2346  ///
2347  /// \pre \p D must not be a bitfield type, as bitfields do not have a valid
2348  /// alignment.
2349  ///
2350  /// If \p ForAlignof, references are treated like their underlying type
2351  /// and large arrays don't get any special treatment. If not \p ForAlignof
2352  /// it computes the value expected by CodeGen: references are treated like
2353  /// pointers and large arrays get extra alignment.
2354  CharUnits getDeclAlign(const Decl *D, bool ForAlignof = false) const;
2355 
2356  /// Return the alignment (in bytes) of the thrown exception object. This is
2357  /// only meaningful for targets that allocate C++ exceptions in a system
2358  /// runtime, such as those using the Itanium C++ ABI.
2360 
2361  /// Get or compute information about the layout of the specified
2362  /// record (struct/union/class) \p D, which indicates its size and field
2363  /// position information.
2364  const ASTRecordLayout &getASTRecordLayout(const RecordDecl *D) const;
2365 
2366  /// Get or compute information about the layout of the specified
2367  /// Objective-C interface.
2369  const;
2370 
2371  void DumpRecordLayout(const RecordDecl *RD, raw_ostream &OS,
2372  bool Simple = false) const;
2373 
2374  /// Get or compute information about the layout of the specified
2375  /// Objective-C implementation.
2376  ///
2377  /// This may differ from the interface if synthesized ivars are present.
2378  const ASTRecordLayout &
2380 
2381  /// Get our current best idea for the key function of the
2382  /// given record decl, or nullptr if there isn't one.
2383  ///
2384  /// The key function is, according to the Itanium C++ ABI section 5.2.3:
2385  /// ...the first non-pure virtual function that is not inline at the
2386  /// point of class definition.
2387  ///
2388  /// Other ABIs use the same idea. However, the ARM C++ ABI ignores
2389  /// virtual functions that are defined 'inline', which means that
2390  /// the result of this computation can change.
2392 
2393  /// Observe that the given method cannot be a key function.
2394  /// Checks the key-function cache for the method's class and clears it
2395  /// if matches the given declaration.
2396  ///
2397  /// This is used in ABIs where out-of-line definitions marked
2398  /// inline are not considered to be key functions.
2399  ///
2400  /// \param method should be the declaration from the class definition
2401  void setNonKeyFunction(const CXXMethodDecl *method);
2402 
2403  /// Loading virtual member pointers using the virtual inheritance model
2404  /// always results in an adjustment using the vbtable even if the index is
2405  /// zero.
2406  ///
2407  /// This is usually OK because the first slot in the vbtable points
2408  /// backwards to the top of the MDC. However, the MDC might be reusing a
2409  /// vbptr from an nv-base. In this case, the first slot in the vbtable
2410  /// points to the start of the nv-base which introduced the vbptr and *not*
2411  /// the MDC. Modify the NonVirtualBaseAdjustment to account for this.
2413 
2414  /// Get the offset of a FieldDecl or IndirectFieldDecl, in bits.
2415  uint64_t getFieldOffset(const ValueDecl *FD) const;
2416 
2417  /// Get the offset of an ObjCIvarDecl in bits.
2418  uint64_t lookupFieldBitOffset(const ObjCInterfaceDecl *OID,
2419  const ObjCImplementationDecl *ID,
2420  const ObjCIvarDecl *Ivar) const;
2421 
2422  /// Find the 'this' offset for the member path in a pointer-to-member
2423  /// APValue.
2425 
2426  bool isNearlyEmpty(const CXXRecordDecl *RD) const;
2427 
2429 
2430  /// If \p T is null pointer, assume the target in ASTContext.
2431  MangleContext *createMangleContext(const TargetInfo *T = nullptr);
2432 
2433  /// Creates a device mangle context to correctly mangle lambdas in a mixed
2434  /// architecture compile by setting the lambda mangling number source to the
2435  /// DeviceLambdaManglingNumber. Currently this asserts that the TargetInfo
2436  /// (from the AuxTargetInfo) is a an itanium target.
2438 
2439  void DeepCollectObjCIvars(const ObjCInterfaceDecl *OI, bool leafClass,
2441 
2442  unsigned CountNonClassIvars(const ObjCInterfaceDecl *OI) const;
2443  void CollectInheritedProtocols(const Decl *CDecl,
2445 
2446  /// Return true if the specified type has unique object representations
2447  /// according to (C++17 [meta.unary.prop]p9)
2449 
2450  //===--------------------------------------------------------------------===//
2451  // Type Operators
2452  //===--------------------------------------------------------------------===//
2453 
2454  /// Return the canonical (structural) type corresponding to the
2455  /// specified potentially non-canonical type \p T.
2456  ///
2457  /// The non-canonical version of a type may have many "decorated" versions of
2458  /// types. Decorators can include typedefs, 'typeof' operators, etc. The
2459  /// returned type is guaranteed to be free of any of these, allowing two
2460  /// canonical types to be compared for exact equality with a simple pointer
2461  /// comparison.
2464  }
2465 
2466  const Type *getCanonicalType(const Type *T) const {
2467  return T->getCanonicalTypeInternal().getTypePtr();
2468  }
2469 
2470  /// Return the canonical parameter type corresponding to the specific
2471  /// potentially non-canonical one.
2472  ///
2473  /// Qualifiers are stripped off, functions are turned into function
2474  /// pointers, and arrays decay one level into pointers.
2476 
2477  /// Determine whether the given types \p T1 and \p T2 are equivalent.
2478  bool hasSameType(QualType T1, QualType T2) const {
2479  return getCanonicalType(T1) == getCanonicalType(T2);
2480  }
2481  bool hasSameType(const Type *T1, const Type *T2) const {
2482  return getCanonicalType(T1) == getCanonicalType(T2);
2483  }
2484 
2485  /// Return this type as a completely-unqualified array type,
2486  /// capturing the qualifiers in \p Quals.
2487  ///
2488  /// This will remove the minimal amount of sugaring from the types, similar
2489  /// to the behavior of QualType::getUnqualifiedType().
2490  ///
2491  /// \param T is the qualified type, which may be an ArrayType
2492  ///
2493  /// \param Quals will receive the full set of qualifiers that were
2494  /// applied to the array.
2495  ///
2496  /// \returns if this is an array type, the completely unqualified array type
2497  /// that corresponds to it. Otherwise, returns T.getUnqualifiedType().
2499 
2500  /// Determine whether the given types are equivalent after
2501  /// cvr-qualifiers have been removed.
2503  return getCanonicalType(T1).getTypePtr() ==
2505  }
2506 
2508  bool IsParam) const {
2509  auto SubTnullability = SubT->getNullability(*this);
2510  auto SuperTnullability = SuperT->getNullability(*this);
2511  if (SubTnullability.hasValue() == SuperTnullability.hasValue()) {
2512  // Neither has nullability; return true
2513  if (!SubTnullability)
2514  return true;
2515  // Both have nullability qualifier.
2516  if (*SubTnullability == *SuperTnullability ||
2517  *SubTnullability == NullabilityKind::Unspecified ||
2518  *SuperTnullability == NullabilityKind::Unspecified)
2519  return true;
2520 
2521  if (IsParam) {
2522  // Ok for the superclass method parameter to be "nonnull" and the subclass
2523  // method parameter to be "nullable"
2524  return (*SuperTnullability == NullabilityKind::NonNull &&
2525  *SubTnullability == NullabilityKind::Nullable);
2526  }
2527  // For the return type, it's okay for the superclass method to specify
2528  // "nullable" and the subclass method specify "nonnull"
2529  return (*SuperTnullability == NullabilityKind::Nullable &&
2530  *SubTnullability == NullabilityKind::NonNull);
2531  }
2532  return true;
2533  }
2534 
2535  bool ObjCMethodsAreEqual(const ObjCMethodDecl *MethodDecl,
2536  const ObjCMethodDecl *MethodImp);
2537 
2538  bool UnwrapSimilarTypes(QualType &T1, QualType &T2);
2539  void UnwrapSimilarArrayTypes(QualType &T1, QualType &T2);
2540 
2541  /// Determine if two types are similar, according to the C++ rules. That is,
2542  /// determine if they are the same other than qualifiers on the initial
2543  /// sequence of pointer / pointer-to-member / array (and in Clang, object
2544  /// pointer) types and their element types.
2545  ///
2546  /// Clang offers a number of qualifiers in addition to the C++ qualifiers;
2547  /// those qualifiers are also ignored in the 'similarity' check.
2548  bool hasSimilarType(QualType T1, QualType T2);
2549 
2550  /// Determine if two types are similar, ignoring only CVR qualifiers.
2551  bool hasCvrSimilarType(QualType T1, QualType T2);
2552 
2553  /// Retrieves the "canonical" nested name specifier for a
2554  /// given nested name specifier.
2555  ///
2556  /// The canonical nested name specifier is a nested name specifier
2557  /// that uniquely identifies a type or namespace within the type
2558  /// system. For example, given:
2559  ///
2560  /// \code
2561  /// namespace N {
2562  /// struct S {
2563  /// template<typename T> struct X { typename T* type; };
2564  /// };
2565  /// }
2566  ///
2567  /// template<typename T> struct Y {
2568  /// typename N::S::X<T>::type member;
2569  /// };
2570  /// \endcode
2571  ///
2572  /// Here, the nested-name-specifier for N::S::X<T>:: will be
2573  /// S::X<template-param-0-0>, since 'S' and 'X' are uniquely defined
2574  /// by declarations in the type system and the canonical type for
2575  /// the template type parameter 'T' is template-param-0-0.
2578 
2579  /// Retrieves the default calling convention for the current target.
2580  CallingConv getDefaultCallingConvention(bool IsVariadic,
2581  bool IsCXXMethod,
2582  bool IsBuiltin = false) const;
2583 
2584  /// Retrieves the "canonical" template name that refers to a
2585  /// given template.
2586  ///
2587  /// The canonical template name is the simplest expression that can
2588  /// be used to refer to a given template. For most templates, this
2589  /// expression is just the template declaration itself. For example,
2590  /// the template std::vector can be referred to via a variety of
2591  /// names---std::vector, \::std::vector, vector (if vector is in
2592  /// scope), etc.---but all of these names map down to the same
2593  /// TemplateDecl, which is used to form the canonical template name.
2594  ///
2595  /// Dependent template names are more interesting. Here, the
2596  /// template name could be something like T::template apply or
2597  /// std::allocator<T>::template rebind, where the nested name
2598  /// specifier itself is dependent. In this case, the canonical
2599  /// template name uses the shortest form of the dependent
2600  /// nested-name-specifier, which itself contains all canonical
2601  /// types, values, and templates.
2603 
2604  /// Determine whether the given template names refer to the same
2605  /// template.
2607 
2608  /// Retrieve the "canonical" template argument.
2609  ///
2610  /// The canonical template argument is the simplest template argument
2611  /// (which may be a type, value, expression, or declaration) that
2612  /// expresses the value of the argument.
2614  const;
2615 
2616  /// Type Query functions. If the type is an instance of the specified class,
2617  /// return the Type pointer for the underlying maximally pretty type. This
2618  /// is a member of ASTContext because this may need to do some amount of
2619  /// canonicalization, e.g. to move type qualifiers into the element type.
2620  const ArrayType *getAsArrayType(QualType T) const;
2622  return dyn_cast_or_null<ConstantArrayType>(getAsArrayType(T));
2623  }
2625  return dyn_cast_or_null<VariableArrayType>(getAsArrayType(T));
2626  }
2628  return dyn_cast_or_null<IncompleteArrayType>(getAsArrayType(T));
2629  }
2631  const {
2632  return dyn_cast_or_null<DependentSizedArrayType>(getAsArrayType(T));
2633  }
2634 
2635  /// Return the innermost element type of an array type.
2636  ///
2637  /// For example, will return "int" for int[m][n]
2638  QualType getBaseElementType(const ArrayType *VAT) const;
2639 
2640  /// Return the innermost element type of a type (which needn't
2641  /// actually be an array type).
2643 
2644  /// Return number of constant array elements.
2645  uint64_t getConstantArrayElementCount(const ConstantArrayType *CA) const;
2646 
2647  /// Perform adjustment on the parameter type of a function.
2648  ///
2649  /// This routine adjusts the given parameter type @p T to the actual
2650  /// parameter type used by semantic analysis (C99 6.7.5.3p[7,8],
2651  /// C++ [dcl.fct]p3). The adjusted parameter type is returned.
2653 
2654  /// Retrieve the parameter type as adjusted for use in the signature
2655  /// of a function, decaying array and function types and removing top-level
2656  /// cv-qualifiers.
2658 
2660 
2661  /// Return the properly qualified result of decaying the specified
2662  /// array type to a pointer.
2663  ///
2664  /// This operation is non-trivial when handling typedefs etc. The canonical
2665  /// type of \p T must be an array type, this returns a pointer to a properly
2666  /// qualified element of the array.
2667  ///
2668  /// See C99 6.7.5.3p7 and C99 6.3.2.1p3.
2670 
2671  /// Return the type that \p PromotableType will promote to: C99
2672  /// 6.3.1.1p2, assuming that \p PromotableType is a promotable integer type.
2673  QualType getPromotedIntegerType(QualType PromotableType) const;
2674 
2675  /// Recurses in pointer/array types until it finds an Objective-C
2676  /// retainable type and returns its ownership.
2678 
2679  /// Whether this is a promotable bitfield reference according
2680  /// to C99 6.3.1.1p2, bullet 2 (and GCC extensions).
2681  ///
2682  /// \returns the type this bit-field will promote to, or NULL if no
2683  /// promotion occurs.
2685 
2686  /// Return the highest ranked integer type, see C99 6.3.1.8p1.
2687  ///
2688  /// If \p LHS > \p RHS, returns 1. If \p LHS == \p RHS, returns 0. If
2689  /// \p LHS < \p RHS, return -1.
2690  int getIntegerTypeOrder(QualType LHS, QualType RHS) const;
2691 
2692  /// Compare the rank of the two specified floating point types,
2693  /// ignoring the domain of the type (i.e. 'double' == '_Complex double').
2694  ///
2695  /// If \p LHS > \p RHS, returns 1. If \p LHS == \p RHS, returns 0. If
2696  /// \p LHS < \p RHS, return -1.
2697  int getFloatingTypeOrder(QualType LHS, QualType RHS) const;
2698 
2699  /// Compare the rank of two floating point types as above, but compare equal
2700  /// if both types have the same floating-point semantics on the target (i.e.
2701  /// long double and double on AArch64 will return 0).
2702  int getFloatingTypeSemanticOrder(QualType LHS, QualType RHS) const;
2703 
2704  /// Return a real floating point or a complex type (based on
2705  /// \p typeDomain/\p typeSize).
2706  ///
2707  /// \param typeDomain a real floating point or complex type.
2708  /// \param typeSize a real floating point or complex type.
2710  QualType typeDomain) const;
2711 
2712  unsigned getTargetAddressSpace(QualType T) const {
2714  }
2715 
2716  unsigned getTargetAddressSpace(Qualifiers Q) const {
2718  }
2719 
2720  unsigned getTargetAddressSpace(LangAS AS) const;
2721 
2722  LangAS getLangASForBuiltinAddressSpace(unsigned AS) const;
2723 
2724  /// Get target-dependent integer value for null pointer which is used for
2725  /// constant folding.
2726  uint64_t getTargetNullPointerValue(QualType QT) const;
2727 
2729  return AddrSpaceMapMangling || isTargetAddressSpace(AS);
2730  }
2731 
2732 private:
2733  // Helper for integer ordering
2734  unsigned getIntegerRank(const Type *T) const;
2735 
2736 public:
2737  //===--------------------------------------------------------------------===//
2738  // Type Compatibility Predicates
2739  //===--------------------------------------------------------------------===//
2740 
2741  /// Compatibility predicates used to check assignment expressions.
2742  bool typesAreCompatible(QualType T1, QualType T2,
2743  bool CompareUnqualified = false); // C99 6.2.7p1
2744 
2747 
2748  bool isObjCIdType(QualType T) const {
2749  return T == getObjCIdType();
2750  }
2751 
2752  bool isObjCClassType(QualType T) const {
2753  return T == getObjCClassType();
2754  }
2755 
2756  bool isObjCSelType(QualType T) const {
2757  return T == getObjCSelType();
2758  }
2759 
2761  const ObjCObjectPointerType *RHS,
2762  bool ForCompare);
2763 
2765  const ObjCObjectPointerType *RHS);
2766 
2767  // Check the safety of assignment from LHS to RHS
2769  const ObjCObjectPointerType *RHSOPT);
2770  bool canAssignObjCInterfaces(const ObjCObjectType *LHS,
2771  const ObjCObjectType *RHS);
2773  const ObjCObjectPointerType *LHSOPT,
2774  const ObjCObjectPointerType *RHSOPT,
2775  bool BlockReturnType);
2778  const ObjCObjectPointerType *RHSOPT);
2779  bool canBindObjCObjectType(QualType To, QualType From);
2780 
2781  // Functions for calculating composite types
2782  QualType mergeTypes(QualType, QualType, bool OfBlockPointer=false,
2783  bool Unqualified = false, bool BlockReturnType = false);
2784  QualType mergeFunctionTypes(QualType, QualType, bool OfBlockPointer=false,
2785  bool Unqualified = false, bool AllowCXX = false);
2787  bool OfBlockPointer = false,
2788  bool Unqualified = false);
2790  bool OfBlockPointer=false,
2791  bool Unqualified = false);
2792 
2794 
2795  /// This function merges the ExtParameterInfo lists of two functions. It
2796  /// returns true if the lists are compatible. The merged list is returned in
2797  /// NewParamInfos.
2798  ///
2799  /// \param FirstFnType The type of the first function.
2800  ///
2801  /// \param SecondFnType The type of the second function.
2802  ///
2803  /// \param CanUseFirst This flag is set to true if the first function's
2804  /// ExtParameterInfo list can be used as the composite list of
2805  /// ExtParameterInfo.
2806  ///
2807  /// \param CanUseSecond This flag is set to true if the second function's
2808  /// ExtParameterInfo list can be used as the composite list of
2809  /// ExtParameterInfo.
2810  ///
2811  /// \param NewParamInfos The composite list of ExtParameterInfo. The list is
2812  /// empty if none of the flags are set.
2813  ///
2814  bool mergeExtParameterInfo(
2815  const FunctionProtoType *FirstFnType,
2816  const FunctionProtoType *SecondFnType,
2817  bool &CanUseFirst, bool &CanUseSecond,
2819 
2820  void ResetObjCLayout(const ObjCContainerDecl *CD);
2821 
2822  //===--------------------------------------------------------------------===//
2823  // Integer Predicates
2824  //===--------------------------------------------------------------------===//
2825 
2826  // The width of an integer, as defined in C99 6.2.6.2. This is the number
2827  // of bits in an integer type excluding any padding bits.
2828  unsigned getIntWidth(QualType T) const;
2829 
2830  // Per C99 6.2.5p6, for every signed integer type, there is a corresponding
2831  // unsigned integer type. This method takes a signed type, and returns the
2832  // corresponding unsigned integer type.
2833  // With the introduction of fixed point types in ISO N1169, this method also
2834  // accepts fixed point types and returns the corresponding unsigned type for
2835  // a given fixed point type.
2837 
2838  // Per C99 6.2.5p6, for every signed integer type, there is a corresponding
2839  // unsigned integer type. This method takes an unsigned type, and returns the
2840  // corresponding signed integer type.
2841  // With the introduction of fixed point types in ISO N1169, this method also
2842  // accepts fixed point types and returns the corresponding signed type for
2843  // a given fixed point type.
2845 
2846  // Per ISO N1169, this method accepts fixed point types and returns the
2847  // corresponding saturated type for a given fixed point type.
2849 
2850  // This method accepts fixed point types and returns the corresponding signed
2851  // type. Unlike getCorrespondingUnsignedType(), this only accepts unsigned
2852  // fixed point types because there are unsigned integer types like bool and
2853  // char8_t that don't have signed equivalents.
2855 
2856  //===--------------------------------------------------------------------===//
2857  // Integer Values
2858  //===--------------------------------------------------------------------===//
2859 
2860  /// Make an APSInt of the appropriate width and signedness for the
2861  /// given \p Value and integer \p Type.
2863  // If Type is a signed integer type larger than 64 bits, we need to be sure
2864  // to sign extend Res appropriately.
2866  Res = Value;
2867  unsigned Width = getIntWidth(Type);
2868  if (Width != Res.getBitWidth())
2869  return Res.extOrTrunc(Width);
2870  return Res;
2871  }
2872 
2873  bool isSentinelNullExpr(const Expr *E);
2874 
2875  /// Get the implementation of the ObjCInterfaceDecl \p D, or nullptr if
2876  /// none exists.
2878 
2879  /// Get the implementation of the ObjCCategoryDecl \p D, or nullptr if
2880  /// none exists.
2882 
2883  /// Return true if there is at least one \@implementation in the TU.
2885  return !ObjCImpls.empty();
2886  }
2887 
2888  /// Set the implementation of ObjCInterfaceDecl.
2890  ObjCImplementationDecl *ImplD);
2891 
2892  /// Set the implementation of ObjCCategoryDecl.
2894  ObjCCategoryImplDecl *ImplD);
2895 
2896  /// Get the duplicate declaration of a ObjCMethod in the same
2897  /// interface, or null if none exists.
2898  const ObjCMethodDecl *
2899  getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const;
2900 
2902  const ObjCMethodDecl *Redecl);
2903 
2904  /// Returns the Objective-C interface that \p ND belongs to if it is
2905  /// an Objective-C method/property/ivar etc. that is part of an interface,
2906  /// otherwise returns null.
2907  const ObjCInterfaceDecl *getObjContainingInterface(const NamedDecl *ND) const;
2908 
2909  /// Set the copy initialization expression of a block var decl. \p CanThrow
2910  /// indicates whether the copy expression can throw or not.
2911  void setBlockVarCopyInit(const VarDecl* VD, Expr *CopyExpr, bool CanThrow);
2912 
2913  /// Get the copy initialization expression of the VarDecl \p VD, or
2914  /// nullptr if none exists.
2915  BlockVarCopyInit getBlockVarCopyInit(const VarDecl* VD) const;
2916 
2917  /// Allocate an uninitialized TypeSourceInfo.
2918  ///
2919  /// The caller should initialize the memory held by TypeSourceInfo using
2920  /// the TypeLoc wrappers.
2921  ///
2922  /// \param T the type that will be the basis for type source info. This type
2923  /// should refer to how the declarator was written in source code, not to
2924  /// what type semantic analysis resolved the declarator to.
2925  ///
2926  /// \param Size the size of the type info to create, or 0 if the size
2927  /// should be calculated based on the type.
2928  TypeSourceInfo *CreateTypeSourceInfo(QualType T, unsigned Size = 0) const;
2929 
2930  /// Allocate a TypeSourceInfo where all locations have been
2931  /// initialized to a given location, which defaults to the empty
2932  /// location.
2933  TypeSourceInfo *
2935  SourceLocation Loc = SourceLocation()) const;
2936 
2937  /// Add a deallocation callback that will be invoked when the
2938  /// ASTContext is destroyed.
2939  ///
2940  /// \param Callback A callback function that will be invoked on destruction.
2941  ///
2942  /// \param Data Pointer data that will be provided to the callback function
2943  /// when it is called.
2944  void AddDeallocation(void (*Callback)(void *), void *Data) const;
2945 
2946  /// If T isn't trivially destructible, calls AddDeallocation to register it
2947  /// for destruction.
2948  template <typename T> void addDestruction(T *Ptr) const {
2949  if (!std::is_trivially_destructible<T>::value) {
2950  auto DestroyPtr = [](void *V) { static_cast<T *>(V)->~T(); };
2951  AddDeallocation(DestroyPtr, Ptr);
2952  }
2953  }
2954 
2957 
2958  /// Determines if the decl can be CodeGen'ed or deserialized from PCH
2959  /// lazily, only when used; this is only relevant for function or file scoped
2960  /// var definitions.
2961  ///
2962  /// \returns true if the function/var must be CodeGen'ed/deserialized even if
2963  /// it is not used.
2964  bool DeclMustBeEmitted(const Decl *D);
2965 
2966  /// Visits all versions of a multiversioned function with the passed
2967  /// predicate.
2969  const FunctionDecl *FD,
2970  llvm::function_ref<void(FunctionDecl *)> Pred) const;
2971 
2972  const CXXConstructorDecl *
2974 
2976  CXXConstructorDecl *CD);
2977 
2979 
2981 
2983 
2985 
2986  void setManglingNumber(const NamedDecl *ND, unsigned Number);
2987  unsigned getManglingNumber(const NamedDecl *ND) const;
2988 
2989  void setStaticLocalNumber(const VarDecl *VD, unsigned Number);
2990  unsigned getStaticLocalNumber(const VarDecl *VD) const;
2991 
2992  /// Retrieve the context for computing mangling numbers in the given
2993  /// DeclContext.
2997  const Decl *D);
2998 
2999  std::unique_ptr<MangleNumberingContext> createMangleNumberingContext() const;
3000 
3001  /// Used by ParmVarDecl to store on the side the
3002  /// index of the parameter when it exceeds the size of the normal bitfield.
3003  void setParameterIndex(const ParmVarDecl *D, unsigned index);
3004 
3005  /// Used by ParmVarDecl to retrieve on the side the
3006  /// index of the parameter when it exceeds the size of the normal bitfield.
3007  unsigned getParameterIndex(const ParmVarDecl *D) const;
3008 
3009  /// Return a string representing the human readable name for the specified
3010  /// function declaration or file name. Used by SourceLocExpr and
3011  /// PredefinedExpr to cache evaluated results.
3012  StringLiteral *getPredefinedStringLiteralFromCache(StringRef Key) const;
3013 
3014  /// Return a declaration for the global GUID object representing the given
3015  /// GUID value.
3017 
3018  /// Return the template parameter object of the given type with the given
3019  /// value.
3021  const APValue &V) const;
3022 
3023  /// Parses the target attributes passed in, and returns only the ones that are
3024  /// valid feature names.
3025  ParsedTargetAttr filterFunctionTargetAttrs(const TargetAttr *TD) const;
3026 
3027  void getFunctionFeatureMap(llvm::StringMap<bool> &FeatureMap,
3028  const FunctionDecl *) const;
3029  void getFunctionFeatureMap(llvm::StringMap<bool> &FeatureMap,
3030  GlobalDecl GD) const;
3031 
3032  //===--------------------------------------------------------------------===//
3033  // Statistics
3034  //===--------------------------------------------------------------------===//
3035 
3036  /// The number of implicitly-declared default constructors.
3038 
3039  /// The number of implicitly-declared default constructors for
3040  /// which declarations were built.
3042 
3043  /// The number of implicitly-declared copy constructors.
3045 
3046  /// The number of implicitly-declared copy constructors for
3047  /// which declarations were built.
3049 
3050  /// The number of implicitly-declared move constructors.
3052 
3053  /// The number of implicitly-declared move constructors for
3054  /// which declarations were built.
3056 
3057  /// The number of implicitly-declared copy assignment operators.
3059 
3060  /// The number of implicitly-declared copy assignment operators for
3061  /// which declarations were built.
3063 
3064  /// The number of implicitly-declared move assignment operators.
3066 
3067  /// The number of implicitly-declared move assignment operators for
3068  /// which declarations were built.
3070 
3071  /// The number of implicitly-declared destructors.
3073 
3074  /// The number of implicitly-declared destructors for which
3075  /// declarations were built.
3077 
3078 public:
3079  /// Initialize built-in types.
3080  ///
3081  /// This routine may only be invoked once for a given ASTContext object.
3082  /// It is normally invoked after ASTContext construction.
3083  ///
3084  /// \param Target The target
3085  void InitBuiltinTypes(const TargetInfo &Target,
3086  const TargetInfo *AuxTarget = nullptr);
3087 
3088 private:
3089  void InitBuiltinType(CanQualType &R, BuiltinType::Kind K);
3090 
3091  class ObjCEncOptions {
3092  unsigned Bits;
3093 
3094  ObjCEncOptions(unsigned Bits) : Bits(Bits) {}
3095 
3096  public:
3097  ObjCEncOptions() : Bits(0) {}
3098  ObjCEncOptions(const ObjCEncOptions &RHS) : Bits(RHS.Bits) {}
3099 
3100 #define OPT_LIST(V) \
3101  V(ExpandPointedToStructures, 0) \
3102  V(ExpandStructures, 1) \
3103  V(IsOutermostType, 2) \
3104  V(EncodingProperty, 3) \
3105  V(IsStructField, 4) \
3106  V(EncodeBlockParameters, 5) \
3107  V(EncodeClassNames, 6) \
3108 
3109 #define V(N,I) ObjCEncOptions& set##N() { Bits |= 1 << I; return *this; }
3110 OPT_LIST(V)
3111 #undef V
3112 
3113 #define V(N,I) bool N() const { return Bits & 1 << I; }
3114 OPT_LIST(V)
3115 #undef V
3116 
3117 #undef OPT_LIST
3118 
3119  LLVM_NODISCARD ObjCEncOptions keepingOnly(ObjCEncOptions Mask) const {
3120  return Bits & Mask.Bits;
3121  }
3122 
3123  LLVM_NODISCARD ObjCEncOptions forComponentType() const {
3124  ObjCEncOptions Mask = ObjCEncOptions()
3125  .setIsOutermostType()
3126  .setIsStructField();
3127  return Bits & ~Mask.Bits;
3128  }
3129  };
3130 
3131  // Return the Objective-C type encoding for a given type.
3132  void getObjCEncodingForTypeImpl(QualType t, std::string &S,
3133  ObjCEncOptions Options,
3134  const FieldDecl *Field,
3135  QualType *NotEncodedT = nullptr) const;
3136 
3137  // Adds the encoding of the structure's members.
3138  void getObjCEncodingForStructureImpl(RecordDecl *RD, std::string &S,
3139  const FieldDecl *Field,
3140  bool includeVBases = true,
3141  QualType *NotEncodedT=nullptr) const;
3142 
3143 public:
3144  // Adds the encoding of a method parameter or return type.
3146  QualType T, std::string& S,
3147  bool Extended) const;
3148 
3149  /// Returns true if this is an inline-initialized static data member
3150  /// which is treated as a definition for MSVC compatibility.
3151  bool isMSStaticDataMemberInlineDefinition(const VarDecl *VD) const;
3152 
3154  /// Not an inline variable.
3155  None,
3156 
3157  /// Weak definition of inline variable.
3158  Weak,
3159 
3160  /// Weak for now, might become strong later in this TU.
3161  WeakUnknown,
3162 
3163  /// Strong definition.
3164  Strong
3165  };
3166 
3167  /// Determine whether a definition of this inline variable should
3168  /// be treated as a weak or strong definition. For compatibility with
3169  /// C++14 and before, for a constexpr static data member, if there is an
3170  /// out-of-line declaration of the member, we may promote it from weak to
3171  /// strong.
3173  getInlineVariableDefinitionKind(const VarDecl *VD) const;
3174 
3175 private:
3176  friend class DeclarationNameTable;
3177  friend class DeclContext;
3178 
3179  const ASTRecordLayout &
3180  getObjCLayout(const ObjCInterfaceDecl *D,
3181  const ObjCImplementationDecl *Impl) const;
3182 
3183  /// A set of deallocations that should be performed when the
3184  /// ASTContext is destroyed.
3185  // FIXME: We really should have a better mechanism in the ASTContext to
3186  // manage running destructors for types which do variable sized allocation
3187  // within the AST. In some places we thread the AST bump pointer allocator
3188  // into the datastructures which avoids this mess during deallocation but is
3189  // wasteful of memory, and here we require a lot of error prone book keeping
3190  // in order to track and run destructors while we're tearing things down.
3192  llvm::SmallVector<std::pair<void (*)(void *), void *>, 16>;
3193  mutable DeallocationFunctionsAndArguments Deallocations;
3194 
3195  // FIXME: This currently contains the set of StoredDeclMaps used
3196  // by DeclContext objects. This probably should not be in ASTContext,
3197  // but we include it here so that ASTContext can quickly deallocate them.
3198  llvm::PointerIntPair<StoredDeclsMap *, 1> LastSDM;
3199 
3200  std::vector<Decl *> TraversalScope;
3201 
3202  std::unique_ptr<VTableContextBase> VTContext;
3203 
3204  void ReleaseDeclContextMaps();
3205 
3206 public:
3207  enum PragmaSectionFlag : unsigned {
3209  PSF_Read = 0x1,
3210  PSF_Write = 0x2,
3214  PSF_Invalid = 0x80000000U,
3215  };
3216 
3217  struct SectionInfo {
3221 
3222  SectionInfo() = default;
3224  int SectionFlags)
3227  };
3228 
3229  llvm::StringMap<SectionInfo> SectionInfos;
3230 
3231  /// Return a new OMPTraitInfo object owned by this context.
3233 
3234  /// Whether a C++ static variable may be externalized.
3235  bool mayExternalizeStaticVar(const Decl *D) const;
3236 
3237  /// Whether a C++ static variable should be externalized.
3238  bool shouldExternalizeStaticVar(const Decl *D) const;
3239 
3240  StringRef getCUIDHash() const;
3241 
3242  void AddSYCLKernelNamingDecl(const CXXRecordDecl *RD);
3243  bool IsSYCLKernelNamingDecl(const NamedDecl *RD) const;
3244  unsigned GetSYCLKernelNamingIndex(const NamedDecl *RD);
3245  /// A SourceLocation to store whether we have evaluated a kernel name already,
3246  /// and where it happened. If so, we need to diagnose an illegal use of the
3247  /// builtin.
3248  llvm::MapVector<const SYCLUniqueStableNameExpr *, std::string>
3250 
3251 private:
3252  /// All OMPTraitInfo objects live in this collection, one per
3253  /// `pragma omp [begin] declare variant` directive.
3254  SmallVector<std::unique_ptr<OMPTraitInfo>, 4> OMPTraitInfoVector;
3255 
3256  /// A list of the (right now just lambda decls) declarations required to
3257  /// name all the SYCL kernels in the translation unit, so that we can get the
3258  /// correct kernel name, as well as implement
3259  /// __builtin_sycl_unique_stable_name.
3260  llvm::DenseMap<const DeclContext *,
3262  SYCLKernelNamingTypes;
3263  std::unique_ptr<ItaniumMangleContext> SYCLKernelFilterContext;
3264  void FilterSYCLKernelNamingDecls(
3265  const CXXRecordDecl *RD,
3267 };
3268 
3269 /// Insertion operator for diagnostics.
3271  const ASTContext::SectionInfo &Section);
3272 
3273 /// Utility function for constructing a nullary selector.
3274 inline Selector GetNullarySelector(StringRef name, ASTContext &Ctx) {
3275  IdentifierInfo* II = &Ctx.Idents.get(name);
3276  return Ctx.Selectors.getSelector(0, &II);
3277 }
3278 
3279 /// Utility function for constructing an unary selector.
3280 inline Selector GetUnarySelector(StringRef name, ASTContext &Ctx) {
3281  IdentifierInfo* II = &Ctx.Idents.get(name);
3282  return Ctx.Selectors.getSelector(1, &II);
3283 }
3284 
3285 } // namespace clang
3286 
3287 // operator new and delete aren't allowed inside namespaces.
3288 
3289 /// Placement new for using the ASTContext's allocator.
3290 ///
3291 /// This placement form of operator new uses the ASTContext's allocator for
3292 /// obtaining memory.
3293 ///
3294 /// IMPORTANT: These are also declared in clang/AST/ASTContextAllocate.h!
3295 /// Any changes here need to also be made there.
3296 ///
3297 /// We intentionally avoid using a nothrow specification here so that the calls
3298 /// to this operator will not perform a null check on the result -- the
3299 /// underlying allocator never returns null pointers.
3300 ///
3301 /// Usage looks like this (assuming there's an ASTContext 'Context' in scope):
3302 /// @code
3303 /// // Default alignment (8)
3304 /// IntegerLiteral *Ex = new (Context) IntegerLiteral(arguments);
3305 /// // Specific alignment
3306 /// IntegerLiteral *Ex2 = new (Context, 4) IntegerLiteral(arguments);
3307 /// @endcode
3308 /// Memory allocated through this placement new operator does not need to be
3309 /// explicitly freed, as ASTContext will free all of this memory when it gets
3310 /// destroyed. Please note that you cannot use delete on the pointer.
3311 ///
3312 /// @param Bytes The number of bytes to allocate. Calculated by the compiler.
3313 /// @param C The ASTContext that provides the allocator.
3314 /// @param Alignment The alignment of the allocated memory (if the underlying
3315 /// allocator supports it).
3316 /// @return The allocated memory. Could be nullptr.
3317 inline void *operator new(size_t Bytes, const clang::ASTContext &C,
3318  size_t Alignment /* = 8 */) {
3319  return C.Allocate(Bytes, Alignment);
3320 }
3321 
3322 /// Placement delete companion to the new above.
3323 ///
3324 /// This operator is just a companion to the new above. There is no way of
3325 /// invoking it directly; see the new operator for more details. This operator
3326 /// is called implicitly by the compiler if a placement new expression using
3327 /// the ASTContext throws in the object constructor.
3328 inline void operator delete(void *Ptr, const clang::ASTContext &C, size_t) {
3329  C.Deallocate(Ptr);
3330 }
3331 
3332 /// This placement form of operator new[] uses the ASTContext's allocator for
3333 /// obtaining memory.
3334 ///
3335 /// We intentionally avoid using a nothrow specification here so that the calls
3336 /// to this operator will not perform a null check on the result -- the
3337 /// underlying allocator never returns null pointers.
3338 ///
3339 /// Usage looks like this (assuming there's an ASTContext 'Context' in scope):
3340 /// @code
3341 /// // Default alignment (8)
3342 /// char *data = new (Context) char[10];
3343 /// // Specific alignment
3344 /// char *data = new (Context, 4) char[10];
3345 /// @endcode
3346 /// Memory allocated through this placement new[] operator does not need to be
3347 /// explicitly freed, as ASTContext will free all of this memory when it gets
3348 /// destroyed. Please note that you cannot use delete on the pointer.
3349 ///
3350 /// @param Bytes The number of bytes to allocate. Calculated by the compiler.
3351 /// @param C The ASTContext that provides the allocator.
3352 /// @param Alignment The alignment of the allocated memory (if the underlying
3353 /// allocator supports it).
3354 /// @return The allocated memory. Could be nullptr.
3355 inline void *operator new[](size_t Bytes, const clang::ASTContext& C,
3356  size_t Alignment /* = 8 */) {
3357  return C.Allocate(Bytes, Alignment);
3358 }
3359 
3360 /// Placement delete[] companion to the new[] above.
3361 ///
3362 /// This operator is just a companion to the new[] above. There is no way of
3363 /// invoking it directly; see the new[] operator for more details. This operator
3364 /// is called implicitly by the compiler if a placement new[] expression using
3365 /// the ASTContext throws in the object constructor.
3366 inline void operator delete[](void *Ptr, const clang::ASTContext &C, size_t) {
3367  C.Deallocate(Ptr);
3368 }
3369 
3370 /// Create the representation of a LazyGenerationalUpdatePtr.
3371 template <typename Owner, typename T,
3372  void (clang::ExternalASTSource::*Update)(Owner)>
3375  const clang::ASTContext &Ctx, T Value) {
3376  // Note, this is implemented here so that ExternalASTSource.h doesn't need to
3377  // include ASTContext.h. We explicitly instantiate it for all relevant types
3378  // in ASTContext.cpp.
3379  if (auto *Source = Ctx.getExternalSource())
3380  return new (Ctx) LazyData(Source, Value);
3381  return Value;
3382 }
3383 
3384 #endif // LLVM_CLANG_AST_ASTCONTEXT_H
clang::QualifierCollector::strip
const Type * strip(QualType type)
Collect any qualifiers on the given type and return an unqualified type.
Definition: Type.h:6372
clang::BuiltinType
This class is used for builtin types like 'int'.
Definition: Type.h:2493
clang::ASTContext::areCommonBaseCompatible
QualType areCommonBaseCompatible(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT)
Definition: ASTContext.cpp:9263
clang::operator!=
bool operator!=(CanQual< T > x, CanQual< U > y)
Definition: CanonicalType.h:207
clang::ElaboratedTypeKeyword
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
Definition: Type.h:5327
clang::ASTContext::getInjectedTemplateArg
TemplateArgument getInjectedTemplateArg(NamedDecl *ParamDecl)
Definition: ASTContext.cpp:5021
clang::ASTContext::getAutoType
QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent, bool IsPack=false, ConceptDecl *TypeConstraintConcept=nullptr, ArrayRef< TemplateArgument > TypeConstraintArgs={}) const
C++11 deduced auto type.
Definition: ASTContext.cpp:5601
clang::ASTContext::setObjCImplementation
void setObjCImplementation(ObjCInterfaceDecl *IFaceD, ObjCImplementationDecl *ImplD)
Set the implementation of ObjCInterfaceDecl.
Definition: ASTContext.cpp:2881
clang::ASTContext::getBuiltinVaListDecl
TypedefDecl * getBuiltinVaListDecl() const
Retrieve the C type declaration corresponding to the predefined __builtin_va_list type.
Definition: ASTContext.cpp:8442
clang::ObjCInterfaceDecl
Represents an ObjC class declaration.
Definition: DeclObjC.h:1148
clang::ASTContext::adjustDeducedFunctionResultType
void adjustDeducedFunctionResultType(FunctionDecl *FD, QualType ResultType)
Change the result type of a function type once it is deduced.
Definition: ASTContext.cpp:3114
clang::ASTContext::SatUnsignedLongFractTy
CanQualType SatUnsignedLongFractTy
Definition: ASTContext.h:1090
clang::ASTContext::getTypeSizeInChars
CharUnits getTypeSizeInChars(QualType T) const
Return the size of the specified (complete) type T, in characters.
Definition: ASTContext.cpp:2452
clang::ASTContext::OCLEventTy
CanQualType OCLEventTy
Definition: ASTContext.h:1105
clang::isTargetAddressSpace
bool isTargetAddressSpace(LangAS AS)
Definition: AddressSpaces.h:71
clang::ASTContext::getObjCEncodingForPropertyDecl
std::string getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD, const Decl *Container) const
getObjCEncodingForPropertyDecl - Return the encoded type for this method declaration.
Definition: ASTContext.cpp:7193
clang::ASTContext::LongDoubleTy
CanQualType LongDoubleTy
Definition: ASTContext.h:1079
clang::ASTContext::NumImplicitDestructorsDeclared
unsigned NumImplicitDestructorsDeclared
The number of implicitly-declared destructors for which declarations were built.
Definition: ASTContext.h:3076
clang::ASTContext::getCFConstantStringTagDecl
RecordDecl * getCFConstantStringTagDecl() const
Definition: ASTContext.cpp:6689
clang::Type::getNullability
Optional< NullabilityKind > getNullability(const ASTContext &context) const
Determine the nullability of the given type.
Definition: Type.cpp:4032
clang::ASTContext::getRawCommentForDeclNoCacheImpl
RawComment * getRawCommentForDeclNoCacheImpl(const Decl *D, const SourceLocation RepresentativeLocForDecl, const std::map< unsigned, RawComment * > &CommentsInFile) const
Definition: ASTContext.cpp:206
clang::ASTContext::getTypePackElementName
IdentifierInfo * getTypePackElementName() const
Definition: ASTContext.h:1860
clang::ASTContext::getQualifiedType
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
Definition: ASTContext.h:2080
clang::ASTContext::getTypedefType
QualType getTypedefType(const TypedefNameDecl *Decl, QualType Underlying=QualType()) const
Return the unique reference to the type for the specified typedef-name decl.
Definition: ASTContext.cpp:4584
clang::ASTContext::~ASTContext
~ASTContext()
Definition: ASTContext.cpp:993
clang::AtomicExpr
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition: Expr.h:6229
clang::ASTContext::NumImplicitMoveConstructorsDeclared
unsigned NumImplicitMoveConstructorsDeclared
The number of implicitly-declared move constructors for which declarations were built.
Definition: ASTContext.h:3055
clang::ASTContext::getASTObjCImplementationLayout
const ASTRecordLayout & getASTObjCImplementationLayout(const ObjCImplementationDecl *D) const
Get or compute information about the layout of the specified Objective-C implementation.
Definition: ASTContext.cpp:2965
clang::LangAS::opencl_private
@ opencl_private
clang::ASTContext::areLaxCompatibleSveTypes
bool areLaxCompatibleSveTypes(QualType FirstType, QualType SecondType)
Return true if the given vector types are lax-compatible SVE vector types, false otherwise.
Definition: ASTContext.cpp:8789
clang::ASTContext::getASTMutationListener
ASTMutationListener * getASTMutationListener() const
Retrieve a pointer to the AST mutation listener associated with this AST context, if any.
Definition: ASTContext.h:1167
clang::ASTContext::getDeclaratorForUnnamedTagDecl
DeclaratorDecl * getDeclaratorForUnnamedTagDecl(const TagDecl *TD)
Definition: ASTContext.cpp:11357
clang::ASTContext::getIntegerTypeOrder
int getIntegerTypeOrder(QualType LHS, QualType RHS) const
Return the highest ranked integer type, see C99 6.3.1.8p1.
Definition: ASTContext.cpp:6560
clang::ASTContext::GetGVALinkageForVariable
GVALinkage GetGVALinkageForVariable(const VarDecl *VD)
Definition: ASTContext.cpp:10981
clang::DynTypedNodeList
Container for either a single DynTypedNode or for an ArrayRef to DynTypedNode.
Definition: ParentMapContext.h:92
clang::ASTContext::getObjCInstanceTypeDecl
TypedefDecl * getObjCInstanceTypeDecl()
Retrieve the typedef declaration corresponding to the Objective-C "instancetype" type.
Definition: ASTContext.cpp:6914
clang::ASTContext::IncompleteMatrixIdxTy
CanQualType IncompleteMatrixIdxTy
Definition: ASTContext.h:1107
clang::ASTContext::isAlignmentRequired
bool isAlignmentRequired(const Type *T) const
Determine if the alignment the type has was required using an alignment attribute.
Definition: ASTContext.cpp:1888
clang::ASTContext::getBlockDescriptorExtendedType
QualType getBlockDescriptorExtendedType() const
Gets the struct used to keep track of the extended descriptor for pointer to blocks.
Definition: ASTContext.cpp:6752
clang::ASTContext::BuiltinVectorTypeInfo::NumVectors
unsigned NumVectors
Definition: ASTContext.h:1445
llvm
Definition: Dominators.h:30
clang::CXXConstructorDecl
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2401
clang::ASTContext::getTypeDeclType
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
Definition: ASTContext.h:1532
clang::ASTContext::getOpenMPDefaultSimdAlign
unsigned getOpenMPDefaultSimdAlign(QualType T) const
Get default simd alignment of the specified complete type in bits.
Definition: ASTContext.cpp:2435
clang::ASTContext::getInt128Decl
TypedefDecl * getInt128Decl() const
Retrieve the declaration for the 128-bit signed integer type.
Definition: ASTContext.cpp:1254
clang::TypeInfoChars::AlignRequirement
AlignRequirementKind AlignRequirement
Definition: ASTContext.h:198
clang::ASTContext::mergeTypes
QualType mergeTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false, bool BlockReturnType=false)
Definition: ASTContext.cpp:9728
clang::ASTContext::getBOOLType
QualType getBOOLType() const
type of 'BOOL' type.
Definition: ASTContext.h:2028
clang::ASTContext::getFILEType
QualType getFILEType() const
Retrieve the C FILE type.
Definition: ASTContext.h:1880
clang::ExternCContextDecl
Declaration context for names declared as extern "C" in C++.
Definition: Decl.h:222
clang::ASTContext::hasDirectOwnershipQualifier
bool hasDirectOwnershipQualifier(QualType Ty) const
Return true if the type has been explicitly qualified with ObjC ownership.
Definition: ASTContext.cpp:8841
clang::ASTContext::BFloat16Ty
CanQualType BFloat16Ty
Definition: ASTContext.h:1092
Specifiers.h
ASTContextAllocate.h
clang::interp::APInt
llvm::APInt APInt
Definition: Integral.h:27
clang::ast_matchers::blockExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, BlockExpr > blockExpr
Matches a reference to a block.
Definition: ASTMatchersInternal.cpp:879
clang::MSGuidDeclParts
Parts of a decomposed MSGuidDecl.
Definition: DeclCXX.h:4116
clang::ASTContext::getNSIntegerType
CanQualType getNSIntegerType() const
Definition: ASTContext.cpp:6905
clang::ASTContext::OCLReserveIDTy
CanQualType OCLReserveIDTy
Definition: ASTContext.h:1106
clang::ASTContext::getTemplateParamObjectDecl
TemplateParamObjectDecl * getTemplateParamObjectDecl(QualType T, const APValue &V) const
Return the template parameter object of the given type with the given value.
Definition: ASTContext.cpp:11415
clang::ASTContext::canAssignObjCInterfacesInBlockPointer
bool canAssignObjCInterfacesInBlockPointer(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT, bool BlockReturnType)
canAssignObjCInterfacesInBlockPointer - This routine is specifically written for providing type-safet...
Definition: ASTContext.cpp:9069
clang::ASTContext::getCharWidth
uint64_t getCharWidth() const
Return the size of the character type, in bits.
Definition: ASTContext.h:2243
clang::ASTContext::UnsignedShortTy
CanQualType UnsignedShortTy
Definition: ASTContext.h:1077
clang::ASTContext::GetGVALinkageForFunction
GVALinkage GetGVALinkageForFunction(const FunctionDecl *FD) const
Definition: ASTContext.cpp:10898
clang::ASTContext::getObjCInstanceType
QualType getObjCInstanceType()
Retrieve the Objective-C "instancetype" type, if already known; otherwise, returns a NULL type;.
Definition: ASTContext.h:1868
clang::ASTContext::ResetObjCLayout
void ResetObjCLayout(const ObjCContainerDecl *CD)
Definition: ASTContext.cpp:10126
type
clang::ASTContext::getNSObjectName
IdentifierInfo * getNSObjectName() const
Retrieve the identifier 'NSObject'.
Definition: ASTContext.h:1826
clang::ASTContext::hasSameType
bool hasSameType(const Type *T1, const Type *T2) const
Definition: ASTContext.h:2481
clang::MemberSpecializationInfo
Provides information a specialization of a member of a class template, which may be a member function...
Definition: DeclTemplate.h:619
clang::FullSourceLoc
A SourceLocation and its associated SourceManager.
Definition: SourceLocation.h:370
clang::ASTContext::buildImplicitRecord
RecordDecl * buildImplicitRecord(StringRef Name, RecordDecl::TagKind TK=TTK_Struct) const
Create a new implicit TU-level CXXRecordDecl or RecordDecl declaration.
Definition: ASTContext.cpp:1228
clang::ASTContext::getTemplateSpecializationTypeInfo
TypeSourceInfo * getTemplateSpecializationTypeInfo(TemplateName T, SourceLocation TLoc, const TemplateArgumentListInfo &Args, QualType Canon=QualType()) const
Definition: ASTContext.cpp:4735
clang::ASTContext::GE_Missing_setjmp
@ GE_Missing_setjmp
Missing a type from <setjmp.h>
Definition: ASTContext.h:2161
clang::SourceRange
A trivial tuple used to represent a source range.
Definition: SourceLocation.h:212
clang::ASTContext::CountNonClassIvars
unsigned CountNonClassIvars(const ObjCInterfaceDecl *OI) const
Definition: ASTContext.cpp:2828
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::DeclContext
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1347
clang::ASTContext::getFunctionFeatureMap
void getFunctionFeatureMap(llvm::StringMap< bool > &FeatureMap, const FunctionDecl *) const
Definition: ASTContext.cpp:11717
clang::ASTContext::getDependentNameType
QualType getDependentNameType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, QualType Canon=QualType()) const
Definition: ASTContext.cpp:4930
clang::ASTContext::GetBuiltinType
QualType GetBuiltinType(unsigned ID, GetBuiltinTypeError &Error, unsigned *IntegerConstantArgs=nullptr) const
Return the type for the specified builtin.
Definition: ASTContext.cpp:10719
clang::ASTContext::createMangleNumberingContext
std::unique_ptr< MangleNumberingContext > createMangleNumberingContext() const
Definition: ASTContext.cpp:11325
clang::Qualifiers::fromCVRMask
static Qualifiers fromCVRMask(unsigned CVR)
Definition: Type.h:238
clang::ObjCImplementationDecl
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2536
clang::ASTContext::InlineVariableDefinitionKind::Strong
@ Strong
Strong definition.
clang::ConstantArrayType
Represents the canonical version of C arrays with a specified constant size.
Definition: Type.h:2929
clang::ASTContext::BuiltinVectorTypeInfo::ElementType
QualType ElementType
Definition: ASTContext.h:1443
clang::ASTContext::getRawCommentForDeclNoCache
RawComment * getRawCommentForDeclNoCache(const Decl *D) const
Return the documentation comment attached to a given declaration, without looking into cache.
Definition: ASTContext.cpp:284
clang::ASTContext::NumImplicitDefaultConstructors
unsigned NumImplicitDefaultConstructors
The number of implicitly-declared default constructors.
Definition: ASTContext.h:3037
clang::ASTContext::ExternalSource
IntrusiveRefCntPtr< ExternalASTSource > ExternalSource
Definition: ASTContext.h:652
clang::ASTContext::getParents
DynTypedNodeList getParents(const NodeT &Node)
Forwards to get node parents from the ParentMapContext.
Definition: ParentMapContext.h:133
clang::ASTContext::getMacroQualifiedType
QualType getMacroQualifiedType(QualType UnderlyingTy, const IdentifierInfo *MacroII) const
Definition: ASTContext.cpp:4918
clang::ASTContext::UnsignedAccumTy
CanQualType UnsignedAccumTy
Definition: ASTContext.h:1082
clang::ASTContext::setcudaConfigureCallDecl
void setcudaConfigureCallDecl(FunctionDecl *FD)
Definition: ASTContext.h:1371
clang::ASTContext::shouldExternalizeStaticVar
bool shouldExternalizeStaticVar(const Decl *D) const
Whether a C++ static variable should be externalized.
Definition: ASTContext.cpp:11790
clang::serialization::AbstractTypeReader
Definition: ASTContext.h:164
clang::ASTContext::VoidTy
CanQualType VoidTy
Definition: ASTContext.h:1067
llvm::SmallVector
Definition: LLVM.h:38
clang::ASTContext::operator=
ASTContext & operator=(const ASTContext &)=delete
clang::ASTContext::getParameterIndex
unsigned getParameterIndex(const ParmVarDecl *D) const
Used by ParmVarDecl to retrieve on the side the index of the parameter when it exceeds the size of th...
Definition: ASTContext.cpp:11365
clang::ASTContext::getAtomicType
QualType getAtomicType(QualType T) const
Return the uniqued reference to the atomic type for the specified type.
Definition: ASTContext.cpp:5657
clang::IdentifierTable::get
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
Definition: IdentifierTable.h:564
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:88
clang::ASTContext::getManglingNumberContext
MangleNumberingContext & getManglingNumberContext(const DeclContext *DC)
Retrieve the context for computing mangling numbers in the given DeclContext.
Definition: ASTContext.cpp:11306
clang::ASTContext::hasSameFunctionTypeIgnoringExceptionSpec
bool hasSameFunctionTypeIgnoringExceptionSpec(QualType T, QualType U)
Determine whether two function types are the same, ignoring exception specifications in cases where t...
Definition: ASTContext.cpp:3162
clang::BuiltinType::Kind
Kind
Definition: Type.h:2495
clang::ASTContext::getTemplateSpecializationType
QualType getTemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args, QualType Canon=QualType()) const
Definition: ASTContext.cpp:4781
clang::ASTContext::getQualifiedType
QualType getQualifiedType(QualType T, Qualifiers Qs) const
Return a type with additional qualifiers.
Definition: ASTContext.h:2085
clang::QualType::getQualifiers
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
Definition: Type.h:6452
clang::ASTContext::AddSYCLKernelNamingDecl
void AddSYCLKernelNamingDecl(const CXXRecordDecl *RD)
Definition: ASTContext.cpp:11815
clang::ASTContext::getObjCNSStringType
QualType getObjCNSStringType() const
Definition: ASTContext.h:1778
clang::ASTContext::getIntWidth
unsigned getIntWidth(QualType T) const
Definition: ASTContext.cpp:10209
clang::ASTContext::DeallocateDeclListNode
void DeallocateDeclListNode(DeclListNode *N)
Deallcates a DeclListNode by returning it to the ListNodeFreeList pool.
Definition: ASTContext.h:722
clang::ASTContext::getVariableArrayDecayedType
QualType getVariableArrayDecayedType(QualType Ty) const
Returns a vla type where known sizes are replaced with [*].
Definition: ASTContext.cpp:3530
clang::TTK_Struct
@ TTK_Struct
The "struct" keyword.
Definition: Type.h:5310
clang::Qualifiers::addObjCLifetime
void addObjCLifetime(ObjCLifetime type)
Definition: Type.h:342
clang::NamedDecl
This represents a decl that may have a name.
Definition: Decl.h:249
clang::ASTContext::getWritePipeType
QualType getWritePipeType(QualType T) const
Return a write_only pipe type for the specified type.
Definition: ASTContext.cpp:4483
clang::ASTContext::OMPArraySectionTy
CanQualType OMPArraySectionTy
Definition: ASTContext.h:1108
clang::ASTContext::BuiltinInfo
Builtin::Context & BuiltinInfo
Definition: ASTContext.h:649
clang::ASTContext::getInnerObjCOwnership
Qualifiers::ObjCLifetime getInnerObjCOwnership(QualType T) const
Recurses in pointer/array types until it finds an Objective-C retainable type and returns its ownersh...
Definition: ASTContext.cpp:6532
clang::ASTContext::CUDADeviceVarODRUsedByHost
llvm::DenseSet< const VarDecl * > CUDADeviceVarODRUsedByHost
Keep track of CUDA/HIP device-side variables ODR-used by host code.
Definition: ASTContext.h:1134
clang::MultiVersionKind::Target
@ Target
clang::Qualifiers::GC
GC
Definition: Type.h:154
clang::ASTContext::setFILEDecl
void setFILEDecl(TypeDecl *FILEDecl)
Set the type for the C FILE type.
Definition: ASTContext.h:1877
clang::ASTContext::getAdjustedParameterType
QualType getAdjustedParameterType(QualType T) const
Perform adjustment on the parameter type of a function.
Definition: ASTContext.cpp:6232
clang::ASTContext::NeedExtraManglingDecl_t
NeedExtraManglingDecl_t
Definition: ASTContext.h:2995
clang::ParsedTargetAttr
Contains information gathered from parsing the contents of TargetAttr.
Definition: Attr.h:356
clang::ASTContext::PseudoObjectTy
CanQualType PseudoObjectTy
Definition: ASTContext.h:1099
clang::ASTContext::GE_Missing_ucontext
@ GE_Missing_ucontext
Missing a type from <ucontext.h>
Definition: ASTContext.h:2164
clang::ASTContext::DeclarationNames
DeclarationNameTable DeclarationNames
Definition: ASTContext.h:651
clang::ASTContext::getObjCClassDecl
TypedefDecl * getObjCClassDecl() const
Retrieve the typedef declaration corresponding to the predefined Objective-C 'Class' type.
Definition: ASTContext.cpp:8030
clang::ASTContext::AnyObjCImplementation
bool AnyObjCImplementation()
Return true if there is at least one @implementation in the TU.
Definition: ASTContext.h:2884
clang::ASTContext::getObjCSelRedefinitionType
QualType getObjCSelRedefinitionType() const
Retrieve the type that 'SEL' has been defined to, which may be different from the built-in 'SEL' if '...
Definition: ASTContext.h:1814
clang::ASTContext::getObjCEncodingForFunctionDecl
std::string getObjCEncodingForFunctionDecl(const FunctionDecl *Decl) const
Emit the encoded type for the function Decl into S.
Definition: ASTContext.cpp:7038
clang::LazyGenerationalUpdatePtr::LazyData
A cache of the value of this pointer, in the most recent generation in which we queried it.
Definition: ExternalASTSource.h:391
clang::ASTContext::getFullLoc
FullSourceLoc getFullLoc(SourceLocation Loc) const
Definition: ASTContext.h:777
clang::ASTContext::cacheRawCommentForDecl
void cacheRawCommentForDecl(const Decl &OriginalD, const RawComment &Comment) const
Attaches Comment to OriginalD and to its redeclaration chain and removes the redeclaration chain from...
Definition: ASTContext.cpp:455
clang::OMPTraitInfo
Helper data structure representing the traits in a match clause of an declare variant or metadirectiv...
Definition: OpenMPClause.h:8490
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:673
clang::ArrayType::ArraySizeModifier
ArraySizeModifier
Capture whether this is a normal array (e.g.
Definition: Type.h:2889
clang::ASTContext::CommentlessRedeclChains
llvm::DenseMap< const Decl *, const Decl * > CommentlessRedeclChains
Keeps track of redeclaration chains that don't have any comment attached.
Definition: ASTContext.h:812
AttributeLangSupport::C
@ C
Definition: SemaDeclAttr.cpp:54
clang::NestedNameSpecifier
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Definition: NestedNameSpecifier.h:50
clang::ASTContext::getWCharType
QualType getWCharType() const
Return the unique wchar_t type available in C++ (and available as __wchar_t as a Microsoft extension)...
Definition: ASTContext.h:1712
clang::ASTContext::SatLongAccumTy
CanQualType SatLongAccumTy
Definition: ASTContext.h:1085
clang::ASTContext::getDependentTemplateName
TemplateName getDependentTemplateName(NestedNameSpecifier *NNS, const IdentifierInfo *Name) const
Retrieve the template name that represents a dependent template name such as MetaFun::template apply.
Definition: ASTContext.cpp:8537
clang::ASTContext::getCommentForDecl
comments::FullComment * getCommentForDecl(const Decl *D, const Preprocessor *PP) const
Return parsed documentation comment attached to a given declaration.
Definition: ASTContext.cpp:557
clang::GVALinkage
GVALinkage
A more specific kind of linkage than enum Linkage.
Definition: Linkage.h:73
clang::ASTContext::Comments
RawCommentList Comments
All comments in this translation unit.
Definition: ASTContext.h:787
clang::ASTContext::getFloatTypeSemantics
const llvm::fltSemantics & getFloatTypeSemantics(QualType T) const
Return the APFloat 'semantics' for the specified scalar floating point type.
Definition: ASTContext.cpp:1705
clang::UnresolvedSetIterator
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:32
clang::ASTContext::SYCLUniqueStableNameEvaluatedValues
llvm::MapVector< const SYCLUniqueStableNameExpr *, std::string > SYCLUniqueStableNameEvaluatedValues
A SourceLocation to store whether we have evaluated a kernel name already, and where it happened.
Definition: ASTContext.h:3249
clang::QualType::getCanonicalType
QualType getCanonicalType() const
Definition: Type.h:6464
clang::ASTContext::SatShortAccumTy
CanQualType SatShortAccumTy
Definition: ASTContext.h:1085
clang::FieldDecl
Represents a member of a struct/union/class.
Definition: Decl.h:2835
clang::DiagnosticsEngine
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:191
clang::TypeInfoChars::isAlignRequired
bool isAlignRequired()
Definition: ASTContext.h:204
clang::ASTContext::getBaseElementType
QualType getBaseElementType(const ArrayType *VAT) const
Return the innermost element type of an array type.
Definition: ASTContext.cpp:6285
clang::Qualifiers
The collection of all-type qualifiers we support.
Definition: Type.h:145
clang::ast_matchers::type
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
Definition: ASTMatchersInternal.cpp:772
clang::ParmVarDecl
Represents a parameter to a function.
Definition: Decl.h:1665
clang::ASTContext::TUKind
const TranslationUnitKind TUKind
Definition: ASTContext.h:650
clang::TargetInfo
Exposes information about the current target.
Definition: TargetInfo.h:189
clang::CanQual< Type >::CreateUnsafe
static CanQual< Type > CreateUnsafe(QualType Other)
Builds a canonical type from a QualType.
Definition: CanonicalType.h:642
int
__device__ int
Definition: __clang_hip_libdevice_declares.h:63
clang::ASTContext::getAuxTargetInfo
const TargetInfo * getAuxTargetInfo() const
Definition: ASTContext.h:741
clang::TypeInfo::Width
uint64_t Width
Definition: ASTContext.h:182
clang::ASTContext::getUnsignedWCharType
QualType getUnsignedWCharType() const
Return the type of "unsigned wchar_t".
Definition: ASTContext.cpp:5743
clang::ASTContext::BlockRequiresCopying
bool BlockRequiresCopying(QualType Ty, const VarDecl *D)
Returns true iff we need copy/dispose helpers for the given type.
Definition: ASTContext.cpp:6834
clang::ASTContext::getFunctionType
QualType getFunctionType(QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
Return a normal function type with a typed argument list.
Definition: ASTContext.h:1516
clang::ASTContext::addComment
void addComment(const RawComment &RC)
Definition: ASTContext.cpp:308
clang::AlignRequirementKind::RequiredByEnum
@ RequiredByEnum
The alignment comes from an alignment attribute on a enum type.
clang::ASTContext::getBOOLDecl
TypedefDecl * getBOOLDecl() const
Retrieve declaration of 'BOOL' typedef.
Definition: ASTContext.h:2018
clang::ASTContext::eraseDeclAttrs
void eraseDeclAttrs(const Decl *D)
Erase the attributes corresponding to the given declaration.
Definition: ASTContext.cpp:1516
clang::ASTContext::getInstantiatedFromUsingEnumDecl
UsingEnumDecl * getInstantiatedFromUsingEnumDecl(UsingEnumDecl *Inst)
If the given using-enum decl Inst is an instantiation of another using-enum decl, return it.
Definition: ASTContext.cpp:1584
clang::UsingShadowDecl
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition: DeclCXX.h:3187
clang::ASTContext::PSF_Execute
@ PSF_Execute
Definition: ASTContext.h:3211
clang::ASTContext::PSF_Write
@ PSF_Write
Definition: ASTContext.h:3210
clang::ASTContext::getObjCEncodingTypeSize
CharUnits getObjCEncodingTypeSize(QualType T) const
Return the size of type T for Objective-C encoding purpose, in characters.
Definition: ASTContext.cpp:6933
clang::ASTContext::setObjCNSStringType
void setObjCNSStringType(QualType T)
Definition: ASTContext.h:1782
clang::ASTContext::getCorrespondingSignedFixedPointType
QualType getCorrespondingSignedFixedPointType(QualType Ty) const
Definition: ASTContext.cpp:11668
clang::ASTContext::createMangleContext
MangleContext * createMangleContext(const TargetInfo *T=nullptr)
If T is null pointer, assume the target in ASTContext.
Definition: ASTContext.cpp:11181
clang::ObjCPropertyImplDecl
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2741
ProfileList.h
clang::ASTContext::NumImplicitCopyConstructorsDeclared
unsigned NumImplicitCopyConstructorsDeclared
The number of implicitly-declared copy constructors for which declarations were built.
Definition: ASTContext.h:3048
clang::ASTContext::OverloadTy
CanQualType OverloadTy
Definition: ASTContext.h:1097
clang::QualType::withFastQualifiers
QualType withFastQualifiers(unsigned TQs) const
Definition: Type.h:888
llvm::Optional< unsigned >
clang::ASTContext::getObjCMethodRedeclaration
const ObjCMethodDecl * getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const
Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists.
Definition: ASTContext.cpp:2895
clang::ASTContext::getManglingNumber
unsigned getManglingNumber(const NamedDecl *ND) const
Definition: ASTContext.cpp:11290
clang::ASTContext::getScalableVectorType
QualType getScalableVectorType(QualType EltTy, unsigned NumElts) const
Return the unique reference to a scalable vector type of the specified element type and scalable numb...
Definition: ASTContext.cpp:3931
llvm::SmallPtrSet
Definition: ASTContext.h:82
clang::ASTContext::SectionInfo::SectionFlags
int SectionFlags
Definition: ASTContext.h:3220
clang::ASTContext::mayExternalizeStaticVar
bool mayExternalizeStaticVar(const Decl *D) const
Whether a C++ static variable may be externalized.
Definition: ASTContext.cpp:11777
clang::NoSanitizeList
Definition: NoSanitizeList.h:29
clang::ASTContext::getUnqualifiedObjCPointerType
QualType getUnqualifiedObjCPointerType(QualType type) const
getUnqualifiedObjCPointerType - Returns version of Objective-C pointer type with lifetime qualifier r...
Definition: ASTContext.h:2115
clang::ASTContext::PSF_None
@ PSF_None
Definition: ASTContext.h:3208
clang::interp::Context
Holds all information required to evaluate constexpr code in a module.
Definition: Context.h:37
clang::ASTContext::canBindObjCObjectType
bool canBindObjCObjectType(QualType To, QualType From)
Definition: ASTContext.cpp:9460
clang::ASTContext::cloneFullComment
comments::FullComment * cloneFullComment(comments::FullComment *FC, const Decl *D) const
Definition: ASTContext.cpp:537
clang::ASTContext::getWIntType
QualType getWIntType() const
In C99, this returns a type compatible with the type defined in <stddef.h> as defined by the target.
Definition: ASTContext.h:1731
clang::AlignRequirementKind
AlignRequirementKind
Definition: ASTContext.h:167
clang::ASTContext::getTargetDefaultAlignForAttributeAligned
unsigned getTargetDefaultAlignForAttributeAligned() const
Return the default alignment for attribute((aligned)) on this target, to be used if no alignment valu...
Definition: ASTContext.cpp:2537
clang::ASTContext::Char8Ty
CanQualType Char8Ty
Definition: ASTContext.h:1073
clang::ASTContext::mergeTransparentUnionType
QualType mergeTransparentUnionType(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
mergeTransparentUnionType - if T is a transparent union type and a member of T is compatible with Sub...
Definition: ASTContext.cpp:9489
clang::tooling::X
static ToolExecutorPluginRegistry::Add< AllTUsToolExecutorPlugin > X("all-TUs", "Runs FrontendActions on all TUs in the compilation database. " "Tool results are stored in memory.")
clang::ASTContext::getObjCIdRedefinitionType
QualType getObjCIdRedefinitionType() const
Retrieve the type that id has been defined to, which may be different from the built-in id if id has ...
Definition: ASTContext.h:1788
clang::PrintingPolicy
Describes how types, statements, expressions, and declarations should be printed.
Definition: PrettyPrinter.h:59
clang::ASTContext::Ibm128Ty
CanQualType Ibm128Ty
Definition: ASTContext.h:1079
clang::ASTContext::getCurrentKeyFunction
const CXXMethodDecl * getCurrentKeyFunction(const CXXRecordDecl *RD)
Get our current best idea for the key function of the given record decl, or nullptr if there isn't on...
Definition: RecordLayoutBuilder.cpp:3338
clang::ASTContext::getUnsignedPointerDiffType
QualType getUnsignedPointerDiffType() const
Return the unique unsigned counterpart of "ptrdiff_t" integer type.
Definition: ASTContext.cpp:5765
clang::ASTContext::getPackExpansionType
QualType getPackExpansionType(QualType Pattern, Optional< unsigned > NumExpansions, bool ExpectPackInType=true)
Form a pack expansion type with the given pattern.
Definition: ASTContext.cpp:5069
clang::ASTContext::getFixedPointMax
llvm::APFixedPoint getFixedPointMax(QualType Ty) const
Definition: ASTContext.cpp:11658
clang::FunctionType
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:3546
clang::ASTContext::applyObjCProtocolQualifiers
QualType applyObjCProtocolQualifiers(QualType type, ArrayRef< ObjCProtocolDecl * > protocols, bool &hasError, bool allowOnPointerType=false) const
Apply Objective-C protocol qualifiers to the given type.
Definition: ASTContext.cpp:5226
clang::ASTContext::getNSCopyingName
IdentifierInfo * getNSCopyingName()
Retrieve the identifier 'NSCopying'.
Definition: ASTContext.h:1835
clang::ASTContext::getLocalCommentForDeclUncached
comments::FullComment * getLocalCommentForDeclUncached(const Decl *D) const
Return parsed documentation comment attached to a given declaration.
Definition: ASTContext.cpp:552
clang::ASTContext::setCFConstantStringType
void setCFConstantStringType(QualType T)
Definition: ASTContext.cpp:6709
ASTFwd.h
clang::ASTContext::toBits
int64_t toBits(CharUnits CharSize) const
Convert a size in characters to a size in bits.
Definition: ASTContext.cpp:2446
clang::ASTContext::getAutoRRefDeductType
QualType getAutoRRefDeductType() const
C++11 deduction pattern for 'auto &&' type.
Definition: ASTContext.cpp:5695
TemplateName.h
clang::DeclarationName
The name of a declaration.
Definition: DeclarationName.h:145
End
SourceLocation End
Definition: USRLocFinder.cpp:167
clang::ASTContext::getDeducedTemplateSpecializationType
QualType getDeducedTemplateSpecializationType(TemplateName Template, QualType DeducedType, bool IsDependent) const
C++17 deduced class template specialization type.
Definition: ASTContext.cpp:5636
clang::ASTContext::getSourceManager
SourceManager & getSourceManager()
Definition: ASTContext.h:694
clang::ASTContext::getDecayedType
QualType getDecayedType(QualType T) const
Return the uniqued reference to the decayed version of the given type.
Definition: ASTContext.cpp:3298
clang::ASTContext::getTranslationUnitDecl
TranslationUnitDecl * getTranslationUnitDecl() const
Definition: ASTContext.h:1049
clang::TargetCXXABI::Kind
Kind
The basic C++ ABI kind.
Definition: TargetCXXABI.h:31
clang::ASTContext::Char16Ty
CanQualType Char16Ty
Definition: ASTContext.h:1074
clang::ASTContext::AtomicUsesUnsupportedLibcall
bool AtomicUsesUnsupportedLibcall(const AtomicExpr *E) const
Definition: ASTContext.cpp:11435
clang::ASTContext::hasSameTemplateName
bool hasSameTemplateName(TemplateName X, TemplateName Y)
Determine whether the given template names refer to the same template.
Definition: ASTContext.cpp:6057
clang::ASTContext::getcudaConfigureCallDecl
FunctionDecl * getcudaConfigureCallDecl()
Definition: ASTContext.h:1375
clang::ASTContext::getFixedPointScale
unsigned char getFixedPointScale(QualType Ty) const
Definition: ASTContext.cpp:11555
clang::ASTContext::NumImplicitCopyConstructors
unsigned NumImplicitCopyConstructors
The number of implicitly-declared copy constructors.
Definition: ASTContext.h:3044
clang::Qualifiers::Restrict
@ Restrict
Definition: Type.h:149
clang::TypeInfo::AlignRequirement
AlignRequirementKind AlignRequirement
Definition: ASTContext.h:184
clang::ASTContext::mergeExtParameterInfo
bool mergeExtParameterInfo(const FunctionProtoType *FirstFnType, const FunctionProtoType *SecondFnType, bool &CanUseFirst, bool &CanUseSecond, SmallVectorImpl< FunctionProtoType::ExtParameterInfo > &NewParamInfos)
This function merges the ExtParameterInfo lists of two functions.
Definition: ASTContext.cpp:10079
clang::ASTContext::CommentsLoaded
bool CommentsLoaded
True if comments are already loaded from ExternalASTSource.
Definition: ASTContext.h:790
clang::SourceManager
This class handles loading and caching of source files into memory.
Definition: SourceManager.h:626
clang::ASTContext::InlineVariableDefinitionKind::WeakUnknown
@ WeakUnknown
Weak for now, might become strong later in this TU.
clang::ASTContext::getRawCFConstantStringType
QualType getRawCFConstantStringType() const
Get the structure type used to representation CFStrings, or NULL if it hasn't yet been built.
Definition: ASTContext.h:1763
clang::EnumDecl
Represents an enum.
Definition: Decl.h:3590
clang::ASTContext::getCanonicalFunctionResultType
CanQualType getCanonicalFunctionResultType(QualType ResultType) const
Adjust the given function result type.
Definition: ASTContext.cpp:4259
clang::ASTContext::getObjCEncodingForMethodDecl
std::string getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, bool Extended=false) const
Emit the encoded type for the method declaration Decl into S.
Definition: ASTContext.cpp:7096
clang::ASTContext::OMPIteratorTy
CanQualType OMPIteratorTy
Definition: ASTContext.h:1108
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1490
llvm::RefCountedBase
Definition: LLVM.h:49
Decl.h
clang::ASTContext::ARCUnbridgedCastTy
CanQualType ARCUnbridgedCastTy
Definition: ASTContext.h:1099
clang::ObjCObjectType
Represents a class type in Objective C.
Definition: Type.h:5816
clang::ASTContext::setParameterIndex
void setParameterIndex(const ParmVarDecl *D, unsigned index)
Used by ParmVarDecl to store on the side the index of the parameter when it exceeds the size of the n...
Definition: ASTContext.cpp:11361
clang::ASTContext::SectionInfo::SectionInfo
SectionInfo(NamedDecl *Decl, SourceLocation PragmaSectionLocation, int SectionFlags)
Definition: ASTContext.h:3223
clang::ASTContext::getObjCGCQualType
QualType getObjCGCQualType(QualType T, Qualifiers::GC gcAttr) const
Return the uniqued reference to the type for an Objective-C gc-qualified type.
Definition: ASTContext.cpp:3058
RawCommentList.h
clang::ASTContext::getAttributedType
QualType getAttributedType(attr::Kind attrKind, QualType modifiedType, QualType equivalentType)
Definition: ASTContext.cpp:4624
AddressSpaces.h
clang::ASTContext::getObjCSelDecl
TypedefDecl * getObjCSelDecl() const
Retrieve the typedef corresponding to the predefined 'SEL' type in Objective-C.
Definition: ASTContext.cpp:8022
clang::ASTContext::getAsDependentSizedArrayType
const DependentSizedArrayType * getAsDependentSizedArrayType(QualType T) const
Definition: ASTContext.h:2630
clang::GlobalDecl
GlobalDecl - represents a global declaration.
Definition: GlobalDecl.h:55
clang::ASTContext::local_imports
import_range local_imports() const
Definition: ASTContext.h:1013
clang::ASTContext::getAlignOfGlobalVar
unsigned getAlignOfGlobalVar(QualType T) const
Return the alignment in bits that should be given to a global variable with type T.
Definition: ASTContext.cpp:2543
clang::ASTContext::typesAreCompatible
bool typesAreCompatible(QualType T1, QualType T2, bool CompareUnqualified=false)
Compatibility predicates used to check assignment expressions.
Definition: ASTContext.cpp:9470
clang::ASTContext::getBlockPointerType
QualType getBlockPointerType(QualType T) const
Return the uniqued reference to the type for a block of the specified type.
Definition: ASTContext.cpp:3339
clang::ASTContext::BoundMemberTy
CanQualType BoundMemberTy
Definition: ASTContext.h:1097
clang::RawCommentList
This class represents all comments included in the translation unit, sorted in order of appearance in...
Definition: RawCommentList.h:180
size_t
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
Definition: opencl-c-base.h:102
clang::ASTContext::ObjCBuiltinBoolTy
CanQualType ObjCBuiltinBoolTy
Definition: ASTContext.h:1101
clang::ASTContext::UnsignedShortFractTy
CanQualType UnsignedShortFractTy
Definition: ASTContext.h:1084
clang::ASTContext::PSF_ZeroInit
@ PSF_ZeroInit
Definition: ASTContext.h:3213
clang::ASTContext::getFixedPointMin
llvm::APFixedPoint getFixedPointMin(QualType Ty) const
Definition: ASTContext.cpp:11663
clang::Qualifiers::getAddressSpace
LangAS getAddressSpace() const
Definition: Type.h:361
clang::ASTContext::getTypeAlignInChars
CharUnits getTypeAlignInChars(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in characters.
Definition: ASTContext.cpp:2461
PrettyPrinter.h
clang::CanQual::getTypePtr
const T * getTypePtr() const
Retrieve the underlying type pointer, which refers to a canonical type.
Definition: CanonicalType.h:83
clang::ASTContext::getAssumedTemplateName
TemplateName getAssumedTemplateName(DeclarationName Name) const
Retrieve a template name representing an unqualified-id that has been assumed to name a template for ...
Definition: ASTContext.cpp:8505
APSInt
llvm::APSInt APSInt
Definition: ByteCodeEmitter.cpp:19
clang::Redeclarable::setPreviousDecl
void setPreviousDecl(decl_type *PrevDecl)
Set the previous declaration.
Definition: Decl.h:4598
U
clang::ASTContext::Allocate
void * Allocate(size_t Size, unsigned Align=8) const
Definition: ASTContext.h:701
clang::ASTContext::UnsignedShortAccumTy
CanQualType UnsignedShortAccumTy
Definition: ASTContext.h:1082
clang::Qualifiers::hasNonFastQualifiers
bool hasNonFastQualifiers() const
Return true if the set contains any qualifiers which require an ExtQuals node to be allocated.
Definition: Type.h:414
clang::ASTContext::getReferenceQualifiedType
QualType getReferenceQualifiedType(const Expr *e) const
getReferenceQualifiedType - Given an expr, will return the type for that expression,...
Definition: ASTContext.cpp:5507
clang::ASTContext::setTraversalScope
void setTraversalScope(const std::vector< Decl * > &)
Definition: ASTContext.cpp:1027
clang::ASTContext::ProtocolCompatibleWithProtocol
bool ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto, ObjCProtocolDecl *rProto) const
ProtocolCompatibleWithProtocol - return 'true' if 'lProto' is in the inheritance hierarchy of 'rProto...
Definition: ASTContext.cpp:8870
clang::ASTContext::getObjCIdType
QualType getObjCIdType() const
Represents the Objective-CC id type.
Definition: ASTContext.h:1987
clang::TypeInfo
Definition: ASTContext.h:181
clang::ASTContext::setNonKeyFunction
void setNonKeyFunction(const CXXMethodDecl *method)
Observe that the given method cannot be a key function.
Definition: RecordLayoutBuilder.cpp:3361
clang::ASTContext::getUIntPtrType
QualType getUIntPtrType() const
Return a type compatible with "uintptr_t" (C99 7.18.1.4), as defined by the target.
Definition: ASTContext.cpp:5752
V
#define V(N, I)
Definition: ASTContext.h:3113
clang::ASTContext::DoubleComplexTy
CanQualType DoubleComplexTy
Definition: ASTContext.h:1094
clang::ASTContext::getSubstTemplateTypeParmPackType
QualType getSubstTemplateTypeParmPackType(const TemplateTypeParmType *Replaced, const TemplateArgument &ArgPack)
Retrieve a.
Definition: ASTContext.cpp:4668
clang::ASTContext::getIntMaxType
CanQualType getIntMaxType() const
Return the unique type for "intmax_t" (C99 7.18.1.5), defined in <stdint.h>.
Definition: ASTContext.cpp:5725
clang::ASTContext::CollectInheritedProtocols
void CollectInheritedProtocols(const Decl *CDecl, llvm::SmallPtrSet< ObjCProtocolDecl *, 8 > &Protocols)
CollectInheritedProtocols - Collect all protocols in current class and those inherited by it.
Definition: ASTContext.cpp:2607
clang::ASTContext::getExternalSource
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any.
Definition: ASTContext.h:1152
clang::ASTContext::getSubstTemplateTemplateParm
TemplateName getSubstTemplateTemplateParm(TemplateTemplateParmDecl *param, TemplateName replacement) const
Definition: ASTContext.cpp:8608
clang::ASTContext::getObjCIdDecl
TypedefDecl * getObjCIdDecl() const
Retrieve the typedef corresponding to the predefined id type in Objective-C.
Definition: ASTContext.cpp:8013
clang::TranslationUnitDecl
The top declaration context.
Definition: Decl.h:82
clang::ASTContext::getExtVectorType
QualType getExtVectorType(QualType VectorType, unsigned NumElts) const
Return the unique reference to an extended vector type of the specified element type and size.
Definition: ASTContext.cpp:4042
clang::ASTContext::getExnObjectAlignment
CharUnits getExnObjectAlignment() const
Return the alignment (in bytes) of the thrown exception object.
Definition: ASTContext.cpp:1832
clang::ASTContext::SatLongFractTy
CanQualType SatLongFractTy
Definition: ASTContext.h:1088
clang::MangleContext
MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangl...
Definition: Mangle.h:44
clang::Module
Describes a module or submodule.
Definition: Module.h:96
clang::Type::isSignedIntegerOrEnumerationType
bool isSignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is signed or an enumeration types whose underlying ty...
Definition: Type.cpp:2025
clang::ASTContext::removeAddrSpaceQualType
QualType removeAddrSpaceQualType(QualType T) const
Remove any existing address space on the type and returns the type with qualifiers intact (or that's ...
Definition: ASTContext.cpp:3024
clang::ASTContext::areCompatibleSveTypes
bool areCompatibleSveTypes(QualType FirstType, QualType SecondType)
Return true if the given types are an SVE builtin and a VectorType that is a fixed-length representat...
Definition: ASTContext.cpp:8760
clang::ASTContext::getOffsetOfBaseWithVBPtr
CharUnits getOffsetOfBaseWithVBPtr(const CXXRecordDecl *RD) const
Loading virtual member pointers using the virtual inheritance model always results in an adjustment u...
Definition: ASTContext.cpp:2555
clang::ASTContext::WideCharTy
CanQualType WideCharTy
Definition: ASTContext.h:1071
clang::ASTContext::NumImplicitMoveAssignmentOperators
unsigned NumImplicitMoveAssignmentOperators
The number of implicitly-declared move assignment operators.
Definition: ASTContext.h:3065
clang::TemplateArgumentListInfo
A convenient class for passing around template argument information.
Definition: TemplateBase.h:564
clang::ASTContext::AccumTy
CanQualType AccumTy
Definition: ASTContext.h:1080
clang::ASTContext::OCLSamplerTy
CanQualType OCLSamplerTy
Definition: ASTContext.h:1105
clang::ImportDecl
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Definition: Decl.h:4447
clang::ASTContext::getAsConstantArrayType
const ConstantArrayType * getAsConstantArrayType(QualType T) const
Definition: ASTContext.h:2621
clang::ASTContext::getDependentVectorType
QualType getDependentVectorType(QualType VectorType, Expr *SizeExpr, SourceLocation AttrLoc, VectorType::VectorKind VecKind) const
Return the unique reference to the type for a dependently sized vector of the specified element type.
Definition: ASTContext.cpp:4001
clang::ASTContext::WIntTy
CanQualType WIntTy
Definition: ASTContext.h:1072
clang::ASTContext::getTypeOfType
QualType getTypeOfType(QualType t) const
getTypeOfType - Unlike many "get<Type>" functions, we don't unique TypeOfType nodes.
Definition: ASTContext.cpp:5497
clang::LangASMap
unsigned[(unsigned) LangAS::FirstTargetAddressSpace] LangASMap
The type of a lookup table which maps from language-specific address spaces to target-specific ones.
Definition: AddressSpaces.h:67
clang::ASTContext::getNameForTemplate
DeclarationNameInfo getNameForTemplate(TemplateName Name, SourceLocation NameLoc) const
Definition: ASTContext.cpp:5962
clang::TagTypeKind
TagTypeKind
The kind of a tag type.
Definition: Type.h:5308
Node
DynTypedNode Node
Definition: ASTMatchFinder.cpp:67
clang::ASTContext::GetSYCLKernelNamingIndex
unsigned GetSYCLKernelNamingIndex(const NamedDecl *RD)
Definition: ASTContext.cpp:11864
clang::ASTContext::NumImplicitCopyAssignmentOperators
unsigned NumImplicitCopyAssignmentOperators
The number of implicitly-declared copy assignment operators.
Definition: ASTContext.h:3058
clang::ASTContext::getAsIncompleteArrayType
const IncompleteArrayType * getAsIncompleteArrayType(QualType T) const
Definition: ASTContext.h:2627
clang::ASTContext::getObjCImplementation
ObjCImplementationDecl * getObjCImplementation(ObjCInterfaceDecl *D)
Get the implementation of the ObjCInterfaceDecl D, or nullptr if none exists.
Definition: ASTContext.cpp:2862
clang::ASTContext::getDefaultCallingConvention
CallingConv getDefaultCallingConvention(bool IsVariadic, bool IsCXXMethod, bool IsBuiltin=false) const
Retrieves the default calling convention for the current target.
Definition: ASTContext.cpp:11123
clang::FunctionProtoType::ExceptionSpecInfo
Holds information about the various types of exception specification.
Definition: Type.h:3942
clang::ASTContext::getReadPipeType
QualType getReadPipeType(QualType T) const
Return a read_only pipe type for the specified type.
Definition: ASTContext.cpp:4479
DeclBase.h
clang::ASTContext::getUInt128Decl
TypedefDecl * getUInt128Decl() const
Retrieve the declaration for the 128-bit unsigned integer type.
Definition: ASTContext.cpp:1260
clang::ConceptDecl
Declaration of a C++2a concept.
Definition: DeclTemplate.h:3231
clang::SelectorTable::getSelector
Selector getSelector(unsigned NumArgs, IdentifierInfo **IIV)
Can create any sort of selector.
Definition: IdentifierTable.cpp:701
clang::ASTContext::Float16Ty
CanQualType Float16Ty
Definition: ASTContext.h:1093
clang::ASTContext::Selectors
SelectorTable & Selectors
Definition: ASTContext.h:648
OperatorKinds.h
clang::ASTContext::getAsArrayType
const ArrayType * getAsArrayType(QualType T) const
Type Query functions.
Definition: ASTContext.cpp:6174
clang::ASTContext::getBlockVarCopyInit
BlockVarCopyInit getBlockVarCopyInit(const VarDecl *VD) const
Get the copy initialization expression of the VarDecl VD, or nullptr if none exists.
Definition: ASTContext.cpp:2919
clang::Decl::ObjCDeclQualifier
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
Definition: DeclBase.h:201
clang::ASTContext::getFunctionTypeWithExceptionSpec
QualType getFunctionTypeWithExceptionSpec(QualType Orig, const FunctionProtoType::ExceptionSpecInfo &ESI)
Get a function type and produce the equivalent function type with the specified exception specificati...
Definition: ASTContext.cpp:3134
clang::ASTContext::getPrimaryMergedDecl
Decl * getPrimaryMergedDecl(Decl *D)
Definition: ASTContext.h:1017
clang::VectorType
Represents a GCC generic vector type.
Definition: Type.h:3229
clang::ASTContext::getTargetNullPointerValue
uint64_t getTargetNullPointerValue(QualType QT) const
Get target-dependent integer value for null pointer which is used for constant folding.
Definition: ASTContext.cpp:11484
clang::ASTContext::PSF_Read
@ PSF_Read
Definition: ASTContext.h:3209
clang::ASTContext::DependentTy
CanQualType DependentTy
Definition: ASTContext.h:1097
clang::TypeInfoChars::TypeInfoChars
TypeInfoChars()
Definition: ASTContext.h:200
clang::ASTContext::getTypeInfoDataSizeInChars
TypeInfoChars getTypeInfoDataSizeInChars(QualType T) const
Definition: ASTContext.cpp:1840
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:211
clang::TU_Incremental
@ TU_Incremental
The translation unit is a is a complete translation unit that we might incrementally extend later.
Definition: LangOptions.h:716
clang::GetUnarySelector
Selector GetUnarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing an unary selector.
Definition: ASTContext.h:3280
clang::ASTContext::getSizeType
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
Definition: ASTContext.cpp:5714
clang::ComparisonCategories
Definition: ComparisonCategories.h:173
clang::ASTContext::addOverriddenMethod
void addOverriddenMethod(const CXXMethodDecl *Method, const CXXMethodDecl *Overridden)
Note that the given C++ Method overrides the given Overridden method.
Definition: ASTContext.cpp:1659
clang::ASTContext::getTypeAlignIfKnown
unsigned getTypeAlignIfKnown(QualType T, bool NeedsPreferredAlignment=false) const
Return the alignment of a type, in bits, or 0 if the type is incomplete and we cannot determine the a...
Definition: ASTContext.cpp:1896
clang::StreamingDiagnostic
The streaming interface shared between DiagnosticBuilder and PartialDiagnostic.
Definition: Diagnostic.h:1105
clang::ASTContext::getUnaryTransformType
QualType getUnaryTransformType(QualType BaseType, QualType UnderlyingType, UnaryTransformType::UTTKind UKind) const
Unary type transforms.
Definition: ASTContext.cpp:5562
clang::ArrayType
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition: Type.h:2883
NestedNameSpecifier.h
clang::ASTContext::getFloatingTypeOrder
int getFloatingTypeOrder(QualType LHS, QualType RHS) const
Compare the rank of the two specified floating point types, ignoring the domain of the type (i....
Definition: ASTContext.cpp:6373
LangOptions.h
clang::ASTContext::SectionInfo::PragmaSectionLocation
SourceLocation PragmaSectionLocation
Definition: ASTContext.h:3219
clang::ASTContext::getRealTypeForBitwidth
QualType getRealTypeForBitwidth(unsigned DestWidth, bool ExplicitIEEE) const
getRealTypeForBitwidth - sets floating point QualTy according to specified bitwidth.
Definition: ASTContext.cpp:11263
clang::ASTContext::getCFConstantStringType
QualType getCFConstantStringType() const
Return the C structure type used to represent constant CFStrings.
Definition: ASTContext.cpp:6696
clang::ASTContext::DeepCollectObjCIvars
void DeepCollectObjCIvars(const ObjCInterfaceDecl *OI, bool leafClass, SmallVectorImpl< const ObjCIvarDecl * > &Ivars) const
DeepCollectObjCIvars - This routine first collects all declared, but not synthesized,...
Definition: ASTContext.cpp:2589
Depth
int Depth
Definition: ASTDiff.cpp:191
clang::ASTContext::overridden_method_range
llvm::iterator_range< overridden_cxx_method_iterator > overridden_method_range
Definition: ASTContext.h:983
clang::ASTContext::getConstantArrayElementCount
uint64_t getConstantArrayElementCount(const ConstantArrayType *CA) const
Return number of constant array elements.
Definition: ASTContext.cpp:6305
clang::ASTContext::getRValueReferenceType
QualType getRValueReferenceType(QualType T) const
Return the uniqued reference to the type for an rvalue reference to the specified type.
Definition: ASTContext.cpp:3410
clang::ASTContext::getObjCSuperType
QualType getObjCSuperType() const
Returns the C struct type for objc_super.
Definition: ASTContext.cpp:6700
clang::ASTContext::getAsVariableArrayType
const VariableArrayType * getAsVariableArrayType(QualType T) const
Definition: ASTContext.h:2624
clang::TypeInfo::isAlignRequired
bool isAlignRequired()
Definition: ASTContext.h:190
clang::ASTContext::getDeclAttrs
AttrVec & getDeclAttrs(const Decl *D)
Retrieve the attributes for the given declaration.
Definition: ASTContext.cpp:1505
clang::TemplateArgument
Represents a template argument.
Definition: TemplateBase.h:62
clang::ASTContext::UnsignedFractTy
CanQualType UnsignedFractTy
Definition: ASTContext.h:1084
clang::ASTMutationListener
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
Definition: ASTMutationListener.h:46
clang::ASTContext::getSignatureParameterType
QualType getSignatureParameterType(QualType T) const
Retrieve the parameter type as adjusted for use in the signature of a function, decaying array and fu...
Definition: ASTContext.cpp:6238
clang::ASTContext::BuiltinVectorTypeInfo::EC
llvm::ElementCount EC
Definition: ASTContext.h:1444
clang::LazyGenerationalUpdatePtr
A lazy value (of type T) that is within an AST node of type Owner, where the value might change in la...
Definition: ExternalASTSource.h:388
clang::ASTContext::filterFunctionTargetAttrs
ParsedTargetAttr filterFunctionTargetAttrs(const TargetAttr *TD) const
Parses the target attributes passed in, and returns only the ones that are valid feature names.
Definition: ASTContext.cpp:11703
clang::ASTContext::setInstantiatedFromUsingShadowDecl
void setInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst, UsingShadowDecl *Pattern)
Definition: ASTContext.cpp:1609
clang::CanQualType
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
Definition: CanonicalType.h:212
clang::ASTContext::WCharTy
CanQualType WCharTy
Definition: ASTContext.h:1070
clang::ASTContext::setExternalSource
void setExternalSource(IntrusiveRefCntPtr< ExternalASTSource > Source)
Attach an external AST source to the AST context.
Definition: ASTContext.cpp:1037
clang::ASTContext::NumImplicitDefaultConstructorsDeclared
unsigned NumImplicitDefaultConstructorsDeclared
The number of implicitly-declared default constructors for which declarations were built.
Definition: ASTContext.h:3041
clang::ASTContext::getObjCInterfaceType
QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl, ObjCInterfaceDecl *PrevDecl=nullptr) const
getObjCInterfaceType - Return the unique reference to the type for the specified ObjC interface decl.
Definition: ASTContext.cpp:5436
clang::ASTContext::getTemplateTypeParmType
QualType getTemplateTypeParmType(unsigned Depth, unsigned Index, bool ParameterPack, TemplateTypeParmDecl *ParmDecl=nullptr) const
Retrieve the template type parameter type for a template parameter or parameter pack with the given d...
Definition: ASTContext.cpp:4704
clang::ASTContext::ParsedComments
llvm::DenseMap< const Decl *, comments::FullComment * > ParsedComments
Mapping from declarations to parsed comments attached to any redeclaration.
Definition: ASTContext.h:816
clang::Qualifiers::Volatile
@ Volatile
Definition: Type.h:150
clang::ASTContext::getBuiltinVectorTypeInfo
BuiltinVectorTypeInfo getBuiltinVectorTypeInfo(const BuiltinType *VecTy) const
Returns the element type, element count and number of vectors (in case of tuple) for a builtin vector...
Definition: ASTContext.cpp:3803
clang::ASTContext::UnknownAnyTy
CanQualType UnknownAnyTy
Definition: ASTContext.h:1097
clang::ASTContext::getTypeInfo
TypeInfo getTypeInfo(QualType T) const
Definition: ASTContext.h:2233
clang::ASTContext::LongDoubleComplexTy
CanQualType LongDoubleComplexTy
Definition: ASTContext.h:1094
clang::MSGuidDecl
A global _GUID constant.
Definition: DeclCXX.h:4139
clang::comments::FullComment
A full comment attached to a declaration, contains block content.
Definition: Comment.h:1091
clang::ASTContext::getTypeSize
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
Definition: ASTContext.h:2239
clang::ASTContext::hasUniqueObjectRepresentations
bool hasUniqueObjectRepresentations(QualType Ty) const
Return true if the specified type has unique object representations according to (C++17 [meta....
Definition: ASTContext.cpp:2757
clang::ASTContext::getAutoDeductType
QualType getAutoDeductType() const
C++11 deduction pattern for 'auto' type.
Definition: ASTContext.cpp:5684
Linkage.h
IdentifierTable.h
clang::ASTContext::getXRayFilter
const XRayFunctionFilter & getXRayFilter() const
Definition: ASTContext.h:769
Type.h
clang::TypeInfoChars::Align
CharUnits Align
Definition: ASTContext.h:197
clang::diff::DynTypedNode
DynTypedNode DynTypedNode
Definition: ASTDiffInternal.h:18
clang::ASTContext::ObjCBuiltinSelTy
CanQualType ObjCBuiltinSelTy
Definition: ASTContext.h:1100
clang::ASTContext::getObjCEncodingForBlock
std::string getObjCEncodingForBlock(const BlockExpr *blockExpr) const
Return the encoded type for this block declaration.
Definition: ASTContext.cpp:6982
clang::diff::Update
@ Update
Definition: ASTDiff.h:30
clang::SelectorTable
This table allows us to fully hide how we implement multi-keyword caching.
Definition: IdentifierTable.h:865
clang::ASTContext::adjustExceptionSpec
void adjustExceptionSpec(FunctionDecl *FD, const FunctionProtoType::ExceptionSpecInfo &ESI, bool AsWritten=false)
Change the exception specification on a function once it is delay-parsed, instantiated,...
Definition: ASTContext.cpp:3193
clang::TemplateTemplateParmDecl
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Definition: DeclTemplate.h:1597
clang::TypeInfoChars::Width
CharUnits Width
Definition: ASTContext.h:196
clang::RawComment
Definition: RawCommentList.h:32
clang::ASTContext::getRecordType
QualType getRecordType(const RecordDecl *Decl) const
Definition: ASTContext.cpp:4598
clang::AlignRequirementKind::RequiredByTypedef
@ RequiredByTypedef
The alignment comes from an alignment attribute on a typedef.
clang::ASTContext::CompCategories
ComparisonCategories CompCategories
Types and expressions required to build C++2a three-way comparisons using operator<=>,...
Definition: ASTContext.h:2181
clang::ASTContext::getCanonicalType
const Type * getCanonicalType(const Type *T) const
Definition: ASTContext.h:2466
clang::ASTContext::getIntTypeForBitwidth
QualType getIntTypeForBitwidth(unsigned DestWidth, unsigned Signed) const
getIntTypeForBitwidth - sets integer QualTy according to specified details: bitwidth,...
Definition: ASTContext.cpp:11251
clang::ASTContext::getFloatingTypeSemanticOrder
int getFloatingTypeSemanticOrder(QualType LHS, QualType RHS) const
Compare the rank of two floating point types as above, but compare equal if both types have the same ...
Definition: ASTContext.cpp:6384
clang::CallingConv
CallingConv
CallingConv - Specifies the calling convention that a function uses.
Definition: Specifiers.h:254
clang::ASTContext::getObjContainingInterface
const ObjCInterfaceDecl * getObjContainingInterface(const NamedDecl *ND) const
Returns the Objective-C interface that ND belongs to if it is an Objective-C method/property/ivar etc...
Definition: ASTContext.cpp:2905
clang::ASTContext::LongAccumTy
CanQualType LongAccumTy
Definition: ASTContext.h:1081
clang::VarDecl
Represents a variable declaration or definition.
Definition: Decl.h:876
clang::ASTContext::canAssignObjCInterfaces
bool canAssignObjCInterfaces(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT)
canAssignObjCInterfaces - Return true if the two interface types are compatible for assignment from R...
Definition: ASTContext.cpp:9016
clang::ASTContext::setObjCClassRedefinitionType
void setObjCClassRedefinitionType(QualType RedefType)
Set the user-written type that redefines 'SEL'.
Definition: ASTContext.h:1808
clang::ASTContext::FloatTy
CanQualType FloatTy
Definition: ASTContext.h:1079
clang::ASTContext::getObjCClassType
QualType getObjCClassType() const
Represents the Objective-C Class type.
Definition: ASTContext.h:2009
clang::ASTContext::UnsignedLongAccumTy
CanQualType UnsignedLongAccumTy
Definition: ASTContext.h:1082
clang::XRayFunctionFilter
Definition: XRayLists.h:29
clang::TagDecl
Represents the declaration of a struct/union/class/enum.
Definition: Decl.h:3328
clang::Type::getCanonicalTypeInternal
QualType getCanonicalTypeInternal() const
Definition: Type.h:2457
clang::ASTContext::getBoolName
IdentifierInfo * getBoolName() const
Retrieve the identifier 'bool'.
Definition: ASTContext.h:1848
clang::TemplateParameterList
Stores a list of template parameters for a TemplateDecl and its derived classes.
Definition: DeclTemplate.h:69
clang::StringLiteral
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1761
clang::ASTContext::getDefaultOpenCLPointeeAddrSpace
LangAS getDefaultOpenCLPointeeAddrSpace()
Returns default address space based on OpenCL version and enabled features.
Definition: ASTContext.h:1366
clang::ASTContext::getInterpContext
interp::Context & getInterpContext()
Returns the clang bytecode interpreter context.
Definition: ASTContext.cpp:915
clang::ASTContext::isPromotableBitField
QualType isPromotableBitField(Expr *E) const
Whether this is a promotable bitfield reference according to C99 6.3.1.1p2, bullet 2 (and GCC extensi...
Definition: ASTContext.cpp:6433
clang::ASTContext::getLifetimeQualifiedType
QualType getLifetimeQualifiedType(QualType type, Qualifiers::ObjCLifetime lifetime)
Return a type with the given lifetime qualifier.
Definition: ASTContext.h:2103
clang::ObjCCategoryImplDecl
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition: DeclObjC.h:2483
clang::ASTContext::getCanonicalType
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
Definition: ASTContext.h:2462
clang::CXXABI
Implements C++ ABI-specific semantic analysis functions.
Definition: CXXABI.h:30
clang::ASTContext::setObjCMethodRedeclaration
void setObjCMethodRedeclaration(const ObjCMethodDecl *MD, const ObjCMethodDecl *Redecl)
Definition: ASTContext.cpp:2899
clang::TypeDecl
Represents a declaration of a type.
Definition: Decl.h:3138
clang::SplitQualType::Ty
const Type * Ty
The locally-unqualified type.
Definition: Type.h:614
clang::ASTContext::getObjCObjectType
QualType getObjCObjectType(QualType Base, ObjCProtocolDecl *const *Protocols, unsigned NumProtocols) const
Legacy interface: cannot provide type arguments or __kindof.
Definition: ASTContext.cpp:5134
llvm::DenseSet
Definition: Sema.h:78
clang::ASTContext::AllocateDeclListNode
DeclListNode * AllocateDeclListNode(clang::NamedDecl *ND)
Allocates a DeclListNode or returns one from the ListNodeFreeList pool.
Definition: ASTContext.h:711
clang::ASTContext::setInstantiatedFromStaticDataMember
void setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl, TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation())
Note that the static data member Inst is an instantiation of the static data member template Tmpl of ...
Definition: ASTContext.cpp:1543
clang::ASTContext::SatAccumTy
CanQualType SatAccumTy
Definition: ASTContext.h:1085
clang::ASTContext::getCommentCommandTraits
comments::CommandTraits & getCommentCommandTraits() const
Definition: ASTContext.h:918
clang::ASTContext::getObjCEncodingForMethodParameter
void getObjCEncodingForMethodParameter(Decl::ObjCDeclQualifier QT, QualType T, std::string &S, bool Extended) const
getObjCEncodingForMethodParameter - Return the encoded type for a single method parameter or return t...
Definition: ASTContext.cpp:7079
clang::ASTContext::addDestruction
void addDestruction(T *Ptr) const
If T isn't trivially destructible, calls AddDeallocation to register it for destruction.
Definition: ASTContext.h:2948
clang::ASTContext::getObjCEncodingForTypeQualifier
void getObjCEncodingForTypeQualifier(Decl::ObjCDeclQualifier QT, std::string &S) const
Put the string version of the type qualifiers QT into S.
Definition: ASTContext.cpp:7997
NoSanitizeList.h
clang::ASTContext::getComplexType
QualType getComplexType(QualType T) const
Return the uniqued reference to the type for a complex number with the specified element type.
Definition: ASTContext.cpp:3223
CXXABI
#define CXXABI(Name, Str)
Definition: TargetCXXABI.h:32
clang::ASTContext::getConstantMatrixType
QualType getConstantMatrixType(QualType ElementType, unsigned NumRows, unsigned NumColumns) const
Return the unique reference to the matrix type of the specified element type and size.
Definition: ASTContext.cpp:4112
clang::QualifierCollector
A qualifier set is used to build a set of qualifiers.
Definition: Type.h:6365
clang::ASTContext::getVolatileType
QualType getVolatileType(QualType T) const
Return the uniqued reference to the type for a volatile qualified type.
Definition: ASTContext.h:1250
clang::ASTContext::getPromotedIntegerType
QualType getPromotedIntegerType(QualType PromotableType) const
Return the type that PromotableType will promote to: C99 6.3.1.1p2, assuming that PromotableType is a...
Definition: ASTContext.cpp:6488
clang::ASTContext::getSubstTemplateTypeParmType
QualType getSubstTemplateTypeParmType(const TemplateTypeParmType *Replaced, QualType Replacement) const
Retrieve a substitution-result type.
Definition: ASTContext.cpp:4646
clang::ASTContext::isNearlyEmpty
bool isNearlyEmpty(const CXXRecordDecl *RD) const
Definition: ASTContext.cpp:11161
clang::CanQual< Type >
Base
clang::BlockVarCopyInit
Copy initialization expr of a __block variable and a boolean flag that indicates whether the expressi...
Definition: Expr.h:6011
clang::ASTWriter
Writes an AST file containing the contents of a translation unit.
Definition: ASTWriter.h:99
clang::ASTContext::getPointerType
CanQualType getPointerType(CanQualType T) const
Definition: ASTContext.h:1309
clang::SubstTemplateTemplateParmPackStorage
A structure for storing an already-substituted template template parameter pack.
Definition: TemplateName.h:135
clang::ASTContext::DumpRecordLayout
void DumpRecordLayout(const RecordDecl *RD, raw_ostream &OS, bool Simple=false) const
Definition: RecordLayoutBuilder.cpp:3659
clang::ASTContext::getVaListTagDecl
Decl * getVaListTagDecl() const
Retrieve the C type declaration corresponding to the predefined __va_list_tag type used to help defin...
Definition: ASTContext.cpp:8451
clang::ASTContext::getObjCProtocolDecl
ObjCInterfaceDecl * getObjCProtocolDecl() const
Retrieve the Objective-C class declaration corresponding to the predefined Protocol class.
Definition: ASTContext.cpp:8039
clang::operator<<
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
Definition: ASTContext.cpp:11770
clang::ASTContext::getExtIntType
QualType getExtIntType(bool Unsigned, unsigned NumBits) const
Return an extended integer type with the specified signedness and bit count.
Definition: ASTContext.cpp:4487
clang::ASTContext::InlineVariableDefinitionKind
InlineVariableDefinitionKind
Definition: ASTContext.h:3153
clang::AutoTypeKeyword
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
Definition: Type.h:1453
clang::ASTContext::ASTContext
ASTContext(LangOptions &LOpts, SourceManager &SM, IdentifierTable &idents, SelectorTable &sels, Builtin::Context &builtins, TranslationUnitKind TUKind)
Definition: ASTContext.cpp:973
clang::ASTContext::deduplicateMergedDefinitonsFor
void deduplicateMergedDefinitonsFor(NamedDecl *ND)
Clean up the merged definition list.
Definition: ASTContext.cpp:1111
clang::ASTContext::getSignedSizeType
CanQualType getSignedSizeType() const
Return the unique signed counterpart of the integer type corresponding to size_t.
Definition: ASTContext.cpp:5720
clang::ASTContext::RedeclChainComments
llvm::DenseMap< const Decl *, const Decl * > RedeclChainComments
Mapping from canonical declaration to the first redeclaration in chain that has a comment attached.
Definition: ASTContext.h:803
clang::ASTContext::getOverriddenMethods
void getOverriddenMethods(const NamedDecl *Method, SmallVectorImpl< const NamedDecl * > &Overridden) const
Return C++ or ObjC overridden methods for the given Method.
Definition: ASTContext.cpp:1665
clang::ASTContext::setObjCSelRedefinitionType
void setObjCSelRedefinitionType(QualType RedefType)
Set the user-written type that redefines 'SEL'.
Definition: ASTContext.h:1821
clang::ASTContext::getFloatingTypeOfSizeWithinDomain
QualType getFloatingTypeOfSizeWithinDomain(QualType typeSize, QualType typeDomain) const
Return a real floating point or a complex type (based on typeDomain/typeSize).
Definition: ASTContext.cpp:6338
clang::TemplateTypeParmDecl
Declaration of a template type parameter.
Definition: DeclTemplate.h:1174
clang::IncrementalParser
Provides support for incremental compilation.
Definition: IncrementalParser.h:40
clang::ASTContext::ObjCObjectAdoptsQTypeProtocols
bool ObjCObjectAdoptsQTypeProtocols(QualType QT, ObjCInterfaceDecl *Decl)
ObjCObjectAdoptsQTypeProtocols - Checks that protocols in IC's protocol list adopt all protocols in Q...
Definition: ASTContext.cpp:5341
clang::TemplateParamObjectDecl
A template parameter object.
Definition: DeclTemplate.h:3283
clang::ASTContext::MSGuidTagDecl
TagDecl * MSGuidTagDecl
Definition: ASTContext.h:1131
clang::OverloadedOperatorKind
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
Definition: OperatorKinds.h:21
clang::ASTContext::getInstantiatedFromUsingDecl
NamedDecl * getInstantiatedFromUsingDecl(NamedDecl *Inst)
If the given using decl Inst is an instantiation of another (possibly unresolved) using decl,...
Definition: ASTContext.cpp:1561
clang::ASTContext::getASTAllocatedMemory
size_t getASTAllocatedMemory() const
Return the total amount of physical memory allocated for representing AST nodes and type information.
Definition: ASTContext.h:729
OPT_LIST
#define OPT_LIST(V)
Definition: ASTContext.h:3100
clang::ASTContext::ShortTy
CanQualType ShortTy
Definition: ASTContext.h:1076
clang::ASTContext::getDecltypeType
QualType getDecltypeType(Expr *e, QualType UnderlyingType) const
C++11 decltype.
Definition: ASTContext.cpp:5531
clang::ASTContext::Deallocate
void Deallocate(void *Ptr) const
Definition: ASTContext.h:707
clang::IncompleteArrayType
Represents a C array with an unspecified size.
Definition: Type.h:2989
clang::ASTContext::getFunctionNoProtoType
QualType getFunctionNoProtoType(QualType ResultTy, const FunctionType::ExtInfo &Info) const
Return a K&R style C function type like 'int()'.
Definition: ASTContext.cpp:4228
clang::Qualifiers::ObjCLifetime
ObjCLifetime
Definition: Type.h:160
clang::ASTContext::setManglingNumber
void setManglingNumber(const NamedDecl *ND, unsigned Number)
Definition: ASTContext.cpp:11285
ExternalASTSource.h
clang::ASTContext::getObjCTypeParamType
QualType getObjCTypeParamType(const ObjCTypeParamDecl *Decl, ArrayRef< ObjCProtocolDecl * > protocols) const
Definition: ASTContext.cpp:5297
clang::ASTContext::UnsignedLongLongTy
CanQualType UnsignedLongLongTy
Definition: ASTContext.h:1078
clang::ASTContext::getOpenCLTypeKind
OpenCLTypeKind getOpenCLTypeKind(const Type *T) const
Map an AST Type to an OpenCLTypeKind enum value.
Definition: ASTContext.cpp:6791
clang::ASTContext::setObjCConstantStringInterface
void setObjCConstantStringInterface(ObjCInterfaceDecl *Decl)
Definition: ASTContext.cpp:8471
clang::ASTContext::hasSameFunctionTypeIgnoringPtrSizes
bool hasSameFunctionTypeIgnoringPtrSizes(QualType T, QualType U)
Determine whether two function types are the same, ignoring pointer sizes in the return type and para...
Definition: ASTContext.cpp:3187
TargetCXXABI.h
clang::ASTContext::ObjCQualifiedClassTypesAreCompatible
bool ObjCQualifiedClassTypesAreCompatible(const ObjCObjectPointerType *LHS, const ObjCObjectPointerType *RHS)
ObjCQualifiedClassTypesAreCompatible - compare Class<pr,...> and Class<pr1, ...>.
Definition: ASTContext.cpp:8882
clang::ObjCCategoryDecl
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2264
clang::ASTContext::getCorrespondingUnsignedType
QualType getCorrespondingUnsignedType(QualType T) const
Definition: ASTContext.cpp:10220
clang::ASTContext::getWideCharType
QualType getWideCharType() const
Return the type of wide characters.
Definition: ASTContext.h:1717
clang::ASTContext::adjustStringLiteralBaseType
QualType adjustStringLiteralBaseType(QualType StrLTy) const
Definition: ASTContext.cpp:4473
clang::ASTContext::FloatComplexTy
CanQualType FloatComplexTy
Definition: ASTContext.h:1094
clang::ASTContext::getTargetAddressSpace
unsigned getTargetAddressSpace(QualType T) const
Definition: ASTContext.h:2712
clang::ASTContext::getMSGuidType
QualType getMSGuidType() const
Retrieve the implicitly-predeclared 'struct _GUID' type.
Definition: ASTContext.h:2064
clang::ASTContext::UnsignedCharTy
CanQualType UnsignedCharTy
Definition: ASTContext.h:1077
clang::TemplateTypeParmType
Definition: Type.h:4765
clang::ASTContext::getExceptionObjectType
QualType getExceptionObjectType(QualType T) const
Definition: ASTContext.cpp:6244
clang::ASTContext::FractTy
CanQualType FractTy
Definition: ASTContext.h:1083
clang::ParentMapContext
Definition: ParentMapContext.h:23
clang::LangAS
LangAS
Defines the address space values used by the address space qualifier of QualType.
Definition: AddressSpaces.h:25
clang::ASTContext::BuiltinFnTy
CanQualType BuiltinFnTy
Definition: ASTContext.h:1098
clang::TypeInfoChars::TypeInfoChars
TypeInfoChars(CharUnits Width, CharUnits Align, AlignRequirementKind AlignRequirement)
Definition: ASTContext.h:201
clang::ASTContext::IsSYCLKernelNamingDecl
bool IsSYCLKernelNamingDecl(const NamedDecl *RD) const
Definition: ASTContext.cpp:11826
clang::ASTContext::getCanonicalParamType
CanQualType getCanonicalParamType(QualType T) const
Return the canonical parameter type corresponding to the specific potentially non-canonical one.
Definition: ASTContext.cpp:5779
operator*
clang::CharUnits operator*(clang::CharUnits::QuantityType Scale, const clang::CharUnits &CU)
Definition: CharUnits.h:212
clang::ASTContext::getFunctionTypeWithoutPtrSizes
QualType getFunctionTypeWithoutPtrSizes(QualType T)
Get a function type and produce the equivalent function type where pointer size address spaces in the...
Definition: ASTContext.cpp:3170
clang::ASTContext::UnsignedLongTy
CanQualType UnsignedLongTy
Definition: ASTContext.h:1077
clang::ASTContext::getConstType
QualType getConstType(QualType T) const
Return the uniqued reference to the type for a const qualified type.
Definition: ASTContext.h:1261
clang::ObjCObjectPointerType
Represents a pointer to an Objective C object.
Definition: Type.h:6073
clang::ASTContext::overridden_methods_end
overridden_cxx_method_iterator overridden_methods_end(const CXXMethodDecl *Method) const
Definition: ASTContext.cpp:1640
clang::ASTRecordLayout
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
Definition: RecordLayout.h:38
clang::ASTContext::getDecayedType
CanQualType getDecayedType(CanQualType T) const
Definition: ASTContext.h:1325
clang::UsingEnumDecl
Represents a C++ using-enum-declaration.
Definition: DeclCXX.h:3579
clang::ASTContext::getTypeOfExprType
QualType getTypeOfExprType(Expr *e) const
GCC extension.
Definition: ASTContext.cpp:5463
clang::ASTContext::getAdjustedType
QualType getAdjustedType(QualType Orig, QualType New) const
Return the uniqued reference to a type adjusted from the original type to a new type.
Definition: ASTContext.cpp:3277
clang::TranslationUnitDecl::Create
static TranslationUnitDecl * Create(ASTContext &C)
Definition: Decl.cpp:4753
clang::CXXRecordDecl
Represents a C++ struct/union/class.
Definition: DeclCXX.h:255
clang::ASTContext::getPreferredTypeAlign
unsigned getPreferredTypeAlign(QualType T) const
Return the "preferred" alignment of the specified type T for the current target, in bits.
Definition: ASTContext.h:2327
clang::ASTContext::getCUIDHash
StringRef getCUIDHash() const
Definition: ASTContext.cpp:11796
SourceLocation.h
clang::ASTContext::getLogicalOperationType
QualType getLogicalOperationType() const
The result type of logical operations, '<', '>', '!=', etc.
Definition: ASTContext.h:1923
createCXXABI
static CGCXXABI * createCXXABI(CodeGenModule &CGM)
Definition: CodeGenModule.cpp:78
clang::ASTContext::getNewOMPTraitInfo
OMPTraitInfo & getNewOMPTraitInfo()
Return a new OMPTraitInfo object owned by this context.
Definition: ASTContext.cpp:11764
clang::ASTContext::adjustFunctionType
const FunctionType * adjustFunctionType(const FunctionType *Fn, FunctionType::ExtInfo EInfo)
Change the ExtInfo on a function type.
Definition: ASTContext.cpp:3096
clang::ASTContext::LongLongTy
CanQualType LongLongTy
Definition: ASTContext.h:1076
clang::Type::isDependentType
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition: Type.h:2174
clang::ASTContext::getRawCommentForAnyRedecl
const RawComment * getRawCommentForAnyRedecl(const Decl *D, const Decl **OriginalDecl=nullptr) const
Return the documentation comment attached to a given declaration.
Definition: ASTContext.cpp:384
clang::TemplateSpecializationKind
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
Definition: Specifiers.h:164
clang::ASTContext::getFixedPointIBits
unsigned char getFixedPointIBits(QualType Ty) const
Definition: ASTContext.cpp:11601
clang::ASTContext::AutoRRefDeductTy
QualType AutoRRefDeductTy
Definition: ASTContext.h:1124
clang::ASTContext::getVectorType
QualType getVectorType(QualType VectorType, unsigned NumElts, VectorType::VectorKind VecKind) const
Return the unique reference to a vector type of the specified element type and size.
Definition: ASTContext.cpp:3971
clang::DependentSizedArrayType
Represents an array type in C++ whose size is a value-dependent expression.
Definition: Type.h:3087
clang::ASTContext::addLazyModuleInitializers
void addLazyModuleInitializers(Module *M, ArrayRef< uint32_t > IDs)
Definition: ASTContext.cpp:1176
clang::ASTContext::UnsignedIntTy
CanQualType UnsignedIntTy
Definition: ASTContext.h:1077
clang::attr::Kind
Kind
Definition: AttrKinds.h:22
clang::VariableArrayType
Represents a C array with a specified size that is not an integer-constant-expression.
Definition: Type.h:3033
clang::ASTContext::VoidPtrTy
CanQualType VoidPtrTy
Definition: ASTContext.h:1096
clang::ASTContext::getCXXABIKind
TargetCXXABI::Kind getCXXABIKind() const
Return the C++ ABI kind that should be used.
Definition: ASTContext.cpp:889
clang::ASTContext::ObjCQualifiedIdTypesAreCompatible
bool ObjCQualifiedIdTypesAreCompatible(const ObjCObjectPointerType *LHS, const ObjCObjectPointerType *RHS, bool ForCompare)
ObjCQualifiedIdTypesAreCompatible - We know that one of lhs/rhs is an ObjCQualifiedIDType.
Definition: ASTContext.cpp:8900
clang::ASTContext::getInstantiatedFromStaticDataMember
MemberSpecializationInfo * getInstantiatedFromStaticDataMember(const VarDecl *Var)
If this variable is an instantiated static data member of a class template specialization,...
Definition: ASTContext.cpp:1526
clang::ASTContext::DoubleTy
CanQualType DoubleTy
Definition: ASTContext.h:1079
clang::ASTContext::UnwrapSimilarArrayTypes
void UnwrapSimilarArrayTypes(QualType &T1, QualType &T2)
Attempt to unwrap two types that may both be array types with the same bound (or both be array types ...
Definition: ASTContext.cpp:5856
clang::ASTContext::getSourceManager
const SourceManager & getSourceManager() const
Definition: ASTContext.h:695
clang::ASTContext::getCFConstantStringDecl
TypedefDecl * getCFConstantStringDecl() const
Definition: ASTContext.cpp:6605
clang::ASTContext::InlineVariableDefinitionKind::Weak
@ Weak
Weak definition of inline variable.
clang::ASTContext::getParentMapContext
ParentMapContext & getParentMapContext()
Returns the dynamic AST node parent map context.
Definition: ASTContext.cpp:922
clang::ASTContext::isObjCIdType
bool isObjCIdType(QualType T) const
Definition: ASTContext.h:2748
clang::ASTContext::setObjCSuperType
void setObjCSuperType(QualType ST)
Definition: ASTContext.h:1759
clang::ASTContext::NullPtrTy
CanQualType NullPtrTy
Definition: ASTContext.h:1096
clang::ASTContext::canBuiltinBeRedeclared
bool canBuiltinBeRedeclared(const FunctionDecl *) const
Return whether a declaration to a builtin is allowed to be overloaded/redeclared.
Definition: ASTContext.cpp:8467
clang::ASTContext::getDeclAlign
CharUnits getDeclAlign(const Decl *D, bool ForAlignof=false) const
Return a conservative estimate of the alignment of the specified decl D.
Definition: ASTContext.cpp:1729
clang::ASTContext::overridden_methods
overridden_method_range overridden_methods(const CXXMethodDecl *Method) const
Definition: ASTContext.cpp:1651
clang::ValueDecl
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:676
clang::ASTContext::getUnqualifiedArrayType
QualType getUnqualifiedArrayType(QualType T, Qualifiers &Quals)
Return this type as a completely-unqualified array type, capturing the qualifiers in Quals.
Definition: ASTContext.cpp:5797
clang::ASTContext::IntTy
CanQualType IntTy
Definition: ASTContext.h:1076
clang::ASTContext::overridden_cxx_method_iterator
CXXMethodVector::const_iterator overridden_cxx_method_iterator
Definition: ASTContext.h:973
clang::ASTContext::addModuleInitializer
void addModuleInitializer(Module *M, Decl *Init)
Add a declaration to the list of declarations that are initialized for a module.
Definition: ASTContext.cpp:1150
clang::ASTContext::GE_Missing_stdio
@ GE_Missing_stdio
Missing a type from <stdio.h>
Definition: ASTContext.h:2158
clang::NullabilityKind::Unspecified
@ Unspecified
Whether values of this type can be null is (explicitly) unspecified.
clang::ASTContext::getEnumType
QualType getEnumType(const EnumDecl *Decl) const
Definition: ASTContext.cpp:4611
clang::ASTContext::getUIntMaxType
CanQualType getUIntMaxType() const
Return the unique type for "uintmax_t" (C99 7.18.1.5), defined in <stdint.h>.
Definition: ASTContext.cpp:5730
clang::ASTContext::PSF_Implicit
@ PSF_Implicit
Definition: ASTContext.h:3212
clang::ASTContext::getOpenCLTypeAddrSpace
LangAS getOpenCLTypeAddrSpace(const Type *T) const
Get address space for OpenCL type.
Definition: ASTContext.cpp:6827
clang::TemplateName
Represents a C++ template name within the type system.
Definition: TemplateName.h:192
clang::ASTContext::isObjCClassType
bool isObjCClassType(QualType T) const
Definition: ASTContext.h:2752
clang::ASTContext::getPreferredTypeAlignInChars
CharUnits getPreferredTypeAlignInChars(QualType T) const
Return the PreferredAlignment of a (complete) type T, in characters.
Definition: ASTContext.h:2298
clang::ASTContext::setBlockVarCopyInit
void setBlockVarCopyInit(const VarDecl *VD, Expr *CopyExpr, bool CanThrow)
Set the copy initialization expression of a block var decl.
Definition: ASTContext.cpp:2930
clang::ASTContext::getTagDeclType
QualType getTagDeclType(const TagDecl *Decl) const
Return the unique reference to the type for the specified TagDecl (struct/union/class/enum) decl.
Definition: ASTContext.cpp:5704
clang::ASTContext::getMakeIntegerSeqDecl
BuiltinTemplateDecl * getMakeIntegerSeqDecl() const
Definition: ASTContext.cpp:1213
clang::FunctionProtoType
Represents a prototype with parameter type info, e.g.
Definition: Type.h:3885
clang::ASTContext::getFieldOffset
uint64_t getFieldOffset(const ValueDecl *FD) const
Get the offset of a FieldDecl or IndirectFieldDecl, in bits.
Definition: RecordLayoutBuilder.cpp:3389
clang::ASTContext::Float128ComplexTy
CanQualType Float128ComplexTy
Definition: ASTContext.h:1095
clang::ASTContext::Idents
IdentifierTable & Idents
Definition: ASTContext.h:647
clang::ASTContext::Int128Ty
CanQualType Int128Ty
Definition: ASTContext.h:1076
clang::ASTContext::LongFractTy
CanQualType LongFractTy
Definition: ASTContext.h:1083
clang::VectorType::VectorKind
VectorKind
Definition: Type.h:3231
clang::ASTContext::getPrintingPolicy
const clang::PrintingPolicy & getPrintingPolicy() const
Definition: ASTContext.h:686
clang::ASTContext::getIntPtrType
QualType getIntPtrType() const
Return a type compatible with "intptr_t" (C99 7.18.1.4), as defined by the target.
Definition: ASTContext.cpp:5748
clang::TemplateDecl
The base class of all kinds of template declarations (e.g., class, function, etc.).
Definition: DeclTemplate.h:399
clang::ASTContext::GE_Missing_type
@ GE_Missing_type
Missing a type.
Definition: ASTContext.h:2155
Begin
SourceLocation Begin
Definition: USRLocFinder.cpp:165
clang::ASTContext::getObjCProtoType
QualType getObjCProtoType() const
Retrieve the type of the Objective-C Protocol class.
Definition: ASTContext.h:2033
clang::BlockExpr
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5965
llvm::ArrayRef
Definition: LLVM.h:34
clang::ASTContext::overridden_methods_size
unsigned overridden_methods_size(const CXXMethodDecl *Method) const
Definition: ASTContext.cpp:1645
Value
Value
Definition: UninitializedValues.cpp:102
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:89
clang::DeclaratorDecl
Represents a ValueDecl that came out of a declarator.
Definition: Decl.h:728
clang::ASTContext::LongTy
CanQualType LongTy
Definition: ASTContext.h:1076
clang::ObjCPropertyDecl
Represents one property declaration in an Objective-C interface.
Definition: DeclObjC.h:729
clang::ASTContext::getSignedWCharType
QualType getSignedWCharType() const
Return the type of "signed wchar_t".
Definition: ASTContext.cpp:5736
clang::ASTContext::createDeviceMangleContext
MangleContext * createDeviceMangleContext(const TargetInfo &T)
Creates a device mangle context to correctly mangle lambdas in a mixed architecture compile by settin...
Definition: ASTContext.cpp:11202
clang::ASTContext::setPrimaryMergedDecl
void setPrimaryMergedDecl(Decl *D, Decl *Primary)
Definition: ASTContext.h:1021
clang::ASTContext::mergeFunctionParameterTypes
QualType mergeFunctionParameterTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
mergeFunctionParameterTypes - merge two types which appear as function parameter types
Definition: ASTContext.cpp:9509
clang::ASTContext::GE_None
@ GE_None
No error.
Definition: ASTContext.h:2152
LLVM.h
clang::ASTContext::getDiagAllocator
PartialDiagnostic::DiagStorageAllocator & getDiagAllocator()
Definition: ASTContext.h:736
clang::ASTContext::CharTy
CanQualType CharTy
Definition: ASTContext.h:1069
clang::ASTContext::HalfTy
CanQualType HalfTy
Definition: ASTContext.h:1091
clang::ASTContext::attachCommentsToJustParsedDecls
void attachCommentsToJustParsedDecls(ArrayRef< Decl * > Decls, const Preprocessor *PP)
Searches existing comments for doc comments that should be attached to Decls.
Definition: ASTContext.cpp:481
clang::ASTContext::SectionInfo::SectionInfo
SectionInfo()=default
clang::ASTContext::MakeIntValue
llvm::APSInt MakeIntValue(uint64_t Value, QualType Type) const
Make an APSInt of the appropriate width and signedness for the given Value and integer Type.
Definition: ASTContext.h:2862
clang::ASTContext::getTypeAlign
unsigned getTypeAlign(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in bits.
Definition: ASTContext.h:2270
clang::ASTContext::SectionInfo::Decl
NamedDecl * Decl
Definition: ASTContext.h:3218
clang::ASTContext::getCanonicalTemplateName
TemplateName getCanonicalTemplateName(TemplateName Name) const
Retrieves the "canonical" template name that refers to a given template.
Definition: ASTContext.cpp:6015
clang::ASTContext::getInlineVariableDefinitionKind
InlineVariableDefinitionKind getInlineVariableDefinitionKind(const VarDecl *VD) const
Determine whether a definition of this inline variable should be treated as a weak or strong definiti...
Definition: ASTContext.cpp:6956
clang::ASTContext::Char32Ty
CanQualType Char32Ty
Definition: ASTContext.h:1075
clang::ASTContext::setPrintingPolicy
void setPrintingPolicy(const clang::PrintingPolicy &Policy)
Definition: ASTContext.h:690
clang::ASTContext::TemplateOrSpecializationInfo
llvm::PointerUnion< VarTemplateDecl *, MemberSpecializationInfo * > TemplateOrSpecializationInfo
A type synonym for the TemplateOrInstantiation mapping.
Definition: ASTContext.h:476
clang::ASTContext::getMakeIntegerSeqName
IdentifierInfo * getMakeIntegerSeqName() const
Definition: ASTContext.h:1854
clang::ASTContext::getObjCSelType
QualType getObjCSelType() const
Retrieve the type that corresponds to the predefined Objective-C 'SEL' type.
Definition: ASTContext.h:1997
clang::ASTContext::getTypedefNameForUnnamedTagDecl
TypedefNameDecl * getTypedefNameForUnnamedTagDecl(const TagDecl *TD)
Definition: ASTContext.cpp:11348
clang::ASTContext::forEachMultiversionedFunctionVersion
void forEachMultiversionedFunctionVersion(const FunctionDecl *FD, llvm::function_ref< void(FunctionDecl *)> Pred) const
Visits all versions of a multiversioned function with the passed predicate.
Definition: ASTContext.cpp:11103
clang::ASTContext::getucontext_tType
QualType getucontext_tType() const
Retrieve the C ucontext_t type.
Definition: ASTContext.h:1916
clang::FunctionType::ExtInfo
A class which abstracts out some details necessary for making a call.
Definition: Type.h:3657
clang::SplitQualType
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition: Type.h:612
clang::UnaryTransformType::UTTKind
UTTKind
Definition: Type.h:4533
clang::ASTContext::getInjectedTemplateArgs
void getInjectedTemplateArgs(const TemplateParameterList *Params, SmallVectorImpl< TemplateArgument > &Args)
Get a template argument list with one argument per template parameter in a template parameter list,...
Definition: ASTContext.cpp:5061
clang::ASTContext::setInstantiatedFromUsingEnumDecl
void setInstantiatedFromUsingEnumDecl(UsingEnumDecl *Inst, UsingEnumDecl *Pattern)
Remember that the using enum decl Inst is an instantiation of the using enum decl Pattern of a class ...
Definition: ASTContext.cpp:1592
clang::ASTContext::SatUnsignedShortFractTy
CanQualType SatUnsignedShortFractTy
Definition: ASTContext.h:1089
clang::IdentifierInfo
One of these records is kept for each identifier that is lexed.
Definition: IdentifierTable.h:67
clang::LazyGenerationalUpdatePtr::ValueType
llvm::PointerUnion< T, LazyData * > ValueType
Definition: ExternalASTSource.h:401
clang::ASTContext::ObjCBuiltinIdTy
CanQualType ObjCBuiltinIdTy
Definition: ASTContext.h:1100
clang::TypedefDecl
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition: Decl.h:3282
clang::ASTContext::SatUnsignedShortAccumTy
CanQualType SatUnsignedShortAccumTy
Definition: ASTContext.h:1086
clang::ASTContext::getTargetInfo
const TargetInfo & getTargetInfo() const
Definition: ASTContext.h:740
clang::ASTContext::getInjectedClassNameType
QualType getInjectedClassNameType(CXXRecordDecl *Decl, QualType TST) const
getInjectedClassNameType - Return the unique reference to the injected class name type for the specif...
Definition: ASTContext.cpp:4535
clang::ASTContext::getNextLocalImport
static ImportDecl * getNextLocalImport(ImportDecl *Import)
Definition: ASTContext.h:1007
clang::LangOptions
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:58
clang::ASTContext::getObjCEncodingForPropertyType
void getObjCEncodingForPropertyType(QualType T, std::string &S) const
Emit the Objective-C property type encoding for the given type T into S.
Definition: ASTContext.cpp:7291
clang::ASTContext::getElaboratedType
QualType getElaboratedType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType, TagDecl *OwnedTagDecl=nullptr) const
Definition: ASTContext.cpp:4864
clang::ASTContext::getLegacyIntegralTypeEncoding
void getLegacyIntegralTypeEncoding(QualType &t) const
getLegacyIntegralTypeEncoding - Another legacy compatibility encoding: 32-bit longs are encoded as 'l...
Definition: ASTContext.cpp:7264
clang::ASTContext::getCorrespondingSignedType
QualType getCorrespondingSignedType(QualType T) const
Definition: ASTContext.cpp:10287
clang::ASTContext::Listener
ASTMutationListener * Listener
Definition: ASTContext.h:653
clang::ASTContext::getLValueReferenceType
QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const
Return the uniqued reference to the type for an lvalue reference to the specified type.
Definition: ASTContext.cpp:3371
clang::DependentTemplateSpecializationType
Represents a template specialization type whose template cannot be resolved, e.g.
Definition: Type.h:5541
clang::ObjCTypeParamDecl
Represents the declaration of an Objective-C type parameter.
Definition: DeclObjC.h:579
clang::ASTContext::isObjCNSObjectType
static bool isObjCNSObjectType(QualType Ty)
Return true if this is an NSObject object with its NSObject attribute set.
Definition: ASTContext.h:2219
clang::ASTReader
Reads an AST files chain containing the contents of a translation unit.
Definition: ASTReader.h:342
clang::MangleNumberingContext
Keeps track of the mangled names of lambda expressions and block literals within a particular context...
Definition: MangleNumberingContext.h:31
clang::ASTContext::adjustObjCTypeParamBoundType
void adjustObjCTypeParamBoundType(const ObjCTypeParamDecl *Orig, ObjCTypeParamDecl *New) const
Definition: ASTContext.cpp:5327
clang::ASTContext::mergeDefinitionIntoModule
void mergeDefinitionIntoModule(NamedDecl *ND, Module *M, bool NotifyListeners=true)
Note that the definition ND has been merged into module M, and should be visible whenever M is visibl...
Definition: ASTContext.cpp:1102
clang::AlignRequirementKind::RequiredByRecord
@ RequiredByRecord
The alignment comes from an alignment attribute on a record type.
ComparisonCategories.h
clang::ASTContext::setInstantiatedFromUsingDecl
void setInstantiatedFromUsingDecl(NamedDecl *Inst, NamedDecl *Pattern)
Remember that the using decl Inst is an instantiation of the using decl Pattern of a class template.
Definition: ASTContext.cpp:1570
clang::ASTContext::getModulesWithMergedDefinition
ArrayRef< Module * > getModulesWithMergedDefinition(const NamedDecl *Def)
Get the additional modules in which the definition Def has been merged.
Definition: ASTContext.cpp:1125
clang::ASTContext::setjmp_bufDecl
void setjmp_bufDecl(TypeDecl *jmp_bufDecl)
Set the type for the C jmp_buf type.
Definition: ASTContext.h:1887
clang::AlignRequirementKind::None
@ None
The alignment was not explicit in code.
clang::TranslationUnitKind
TranslationUnitKind
Describes the kind of translation unit being processed.
Definition: LangOptions.h:703
clang::ObjCMethodDecl
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:139
DeclarationName.h
clang::ASTContext::buildImplicitTypedef
TypedefDecl * buildImplicitTypedef(QualType T, StringRef Name) const
Create a new implicit TU-level typedef declaration.
Definition: ASTContext.cpp:1244
clang::ASTContext::getDependentExtIntType
QualType getDependentExtIntType(bool Unsigned, Expr *BitsExpr) const
Return a dependent extended integer type with the specified signedness and bit count.
Definition: ASTContext.cpp:4501
clang::ASTContext::areComparableObjCPointerTypes
bool areComparableObjCPointerTypes(QualType LHS, QualType RHS)
Definition: ASTContext.cpp:9448
clang::ASTContext::AutoDeductTy
QualType AutoDeductTy
Definition: ASTContext.h:1123
clang::ASTContext::PragmaSectionFlag
PragmaSectionFlag
Definition: ASTContext.h:3207
clang::ASTContext::getComplexType
CanQualType getComplexType(CanQualType T) const
Definition: ASTContext.h:1302
clang::ASTContext::SectionInfos
llvm::StringMap< SectionInfo > SectionInfos
Definition: ASTContext.h:3229
clang::ASTContext::getTypeUnadjustedAlign
unsigned getTypeUnadjustedAlign(QualType T) const
Return the ABI-specified natural alignment of a (complete) type T, before alignment adjustments,...
Definition: ASTContext.h:2278
clang::ASTContext::getBuiltinVaListType
QualType getBuiltinVaListType() const
Retrieve the type of the __builtin_va_list type.
Definition: ASTContext.h:2042
clang::Qualifiers::OCL_None
@ OCL_None
There is no lifetime qualification on this type.
Definition: Type.h:162
clang::ASTContext::OMPArrayShapingTy
CanQualType OMPArrayShapingTy
Definition: ASTContext.h:1108
clang::ASTContext::setInstantiatedFromUnnamedFieldDecl
void setInstantiatedFromUnnamedFieldDecl(FieldDecl *Inst, FieldDecl *Tmpl)
Definition: ASTContext.cpp:1624
clang::ASTContext::getjmp_bufType
QualType getjmp_bufType() const
Retrieve the C jmp_buf type.
Definition: ASTContext.h:1892
clang::ASTContext::getParenType
QualType getParenType(QualType NamedType) const
Definition: ASTContext.cpp:4894
clang::OpenCLTypeKind
OpenCLTypeKind
OpenCL type kinds.
Definition: TargetInfo.h:176
clang::ASTContext::getPredefinedStringLiteralFromCache
StringLiteral * getPredefinedStringLiteralFromCache(StringRef Key) const
Return a string representing the human readable name for the specified function declaration or file n...
Definition: ASTContext.cpp:11387
clang::ASTContext::getAddrSpaceQualType
QualType getAddrSpaceQualType(QualType T, LangAS AddressSpace) const
Return the uniqued reference to the type for an address space qualified type with the specified type ...
Definition: ASTContext.cpp:3004
clang::Builtin::ID
ID
Definition: Builtins.h:48
clang::FunctionProtoType::ExtProtoInfo
Extra information about a function prototype.
Definition: Type.h:3968
clang::DeclListNode
A list storing NamedDecls in the lookup tables.
Definition: DeclBase.h:1239
clang::ASTContext::BuiltinVectorTypeInfo
Definition: ASTContext.h:1442
clang::ASTContext::addedLocalImportDecl
void addedLocalImportDecl(ImportDecl *Import)
Notify the AST context that a new import declaration has been parsed or implicitly created within thi...
Definition: ASTContext.cpp:1685
PartialDiagnostic.h
clang::ASTContext::UnwrapSimilarTypes
bool UnwrapSimilarTypes(QualType &T1, QualType &T2)
Attempt to unwrap two types that may be similar (C++ [conv.qual]).
Definition: ASTContext.cpp:5894
clang
Definition: CalledOnceCheck.h:17
XRayLists.h
clang::TypeInfo::Align
unsigned Align
Definition: ASTContext.h:183
clang::ASTContext::ObjCMethodsAreEqual
bool ObjCMethodsAreEqual(const ObjCMethodDecl *MethodDecl, const ObjCMethodDecl *MethodImp)
Definition: ASTContext.cpp:11454
clang::ASTContext::getTemplateOrSpecializationInfo
TemplateOrSpecializationInfo getTemplateOrSpecializationInfo(const VarDecl *Var)
Definition: ASTContext.cpp:1533
clang::Selector
Smart pointer class that efficiently represents Objective-C method names.
Definition: IdentifierTable.h:720
clang::ASTContext::toCharUnitsFromBits
CharUnits toCharUnitsFromBits(int64_t BitSize) const
Convert a size in bits to a size in characters.
Definition: ASTContext.cpp:2441
clang::ASTContext::getLangASForBuiltinAddressSpace
LangAS getLangASForBuiltinAddressSpace(unsigned AS) const
Definition: ASTContext.cpp:11536
clang::ASTContext::SatUnsignedFractTy
CanQualType SatUnsignedFractTy
Definition: ASTContext.h:1089
clang::Builtin::Context
Holds information about both target-independent and target-specific builtins, allowing easy queries b...
Definition: Builtins.h:67
clang::TypeInfoChars
Definition: ASTContext.h:195
clang::ASTContext::getObjCClassRedefinitionType
QualType getObjCClassRedefinitionType() const
Retrieve the type that Class has been defined to, which may be different from the built-in Class if C...
Definition: ASTContext.h:1801
clang::GetNullarySelector
Selector GetNullarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing a nullary selector.
Definition: ASTContext.h:3274
clang::ObjCIvarDecl
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1921
clang::ASTContext::getByrefLifetime
bool getByrefLifetime(QualType Ty, Qualifiers::ObjCLifetime &Lifetime, bool &HasByrefExtendedLayout) const
Returns true, if given type has a known lifetime.
Definition: ASTContext.cpp:6874
clang::QualType::withConst
QualType withConst() const
Definition: Type.h:845
clang::ASTContext::getDependentSizedMatrixType
QualType getDependentSizedMatrixType(QualType ElementType, Expr *RowExpr, Expr *ColumnExpr, SourceLocation AttrLoc) const
Return the unique reference to the matrix type of the specified element type and size.
Definition: ASTContext.cpp:4144
clang::ASTContext::ObjCBuiltinClassTy
CanQualType ObjCBuiltinClassTy
Definition: ASTContext.h:1100
clang::ASTContext::isSentinelNullExpr
bool isSentinelNullExpr(const Expr *E)
Definition: ASTContext.cpp:2842
clang::ASTContext::getTypeUnadjustedAlignInChars
CharUnits getTypeUnadjustedAlignInChars(QualType T) const
getTypeUnadjustedAlignInChars - Return the ABI-specified alignment of a type, in characters,...
Definition: ASTContext.cpp:2471
clang::ASTContext::SignedCharTy
CanQualType SignedCharTy
Definition: ASTContext.h:1076
clang::ASTContext::getAdjustedType
CanQualType getAdjustedType(CanQualType Orig, CanQualType New) const
Definition: ASTContext.h:1316
clang::ASTContext::import_range
llvm::iterator_range< import_iterator > import_range
Definition: ASTContext.h:1011
clang::ASTContext::addCopyConstructorForExceptionObject
void addCopyConstructorForExceptionObject(CXXRecordDecl *RD, CXXConstructorDecl *CD)
Definition: ASTContext.cpp:11335
clang::ASTContext::getCorrespondingSaturatedType
QualType getCorrespondingSaturatedType(QualType Ty) const
Definition: ASTContext.cpp:11501
clang::ASTContext::getBuiltinMSVaListDecl
TypedefDecl * getBuiltinMSVaListDecl() const
Retrieve the C type declaration corresponding to the predefined __builtin_ms_va_list type.
Definition: ASTContext.cpp:8460
clang::ASTContext::getFixedPointSemantics
llvm::FixedPointSemantics getFixedPointSemantics(QualType Ty) const
Definition: ASTContext.cpp:11643
clang::ASTContext::getObjCGCAttrKind
Qualifiers::GC getObjCGCAttrKind(QualType Ty) const
Return one of the GCNone, Weak or Strong Objective-C garbage collection attributes.
Definition: ASTContext.cpp:8674
clang::ASTContext::AddDeallocation
void AddDeallocation(void(*Callback)(void *), void *Data) const
Add a deallocation callback that will be invoked when the ASTContext is destroyed.
Definition: ASTContext.cpp:1032
clang::ASTContext::overridden_methods_begin
overridden_cxx_method_iterator overridden_methods_begin(const CXXMethodDecl *Method) const
Definition: ASTContext.cpp:1635
clang::ASTContext::hasCvrSimilarType
bool hasCvrSimilarType(QualType T1, QualType T2)
Determine if two types are similar, ignoring only CVR qualifiers.
Definition: ASTContext.cpp:5942
clang::ObjCProtocolDecl
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2040
clang::ASTContext::OCLClkEventTy
CanQualType OCLClkEventTy
Definition: ASTContext.h:1105
clang::ASTContext::getProcessIDType
QualType getProcessIDType() const
Return the unique type for "pid_t" defined in <sys/types.h>.
Definition: ASTContext.cpp:5771
clang::IdentifierTable
Implements an efficient mapping from strings to IdentifierInfo nodes.
Definition: IdentifierTable.h:531
clang::ASTContext::NumImplicitCopyAssignmentOperatorsDeclared
unsigned NumImplicitCopyAssignmentOperatorsDeclared
The number of implicitly-declared copy assignment operators for which declarations were built.
Definition: ASTContext.h:3062
clang::TypeSourceInfo
A container of type source information.
Definition: Type.h:6396
clang::ASTContext::getMemberPointerPathAdjustment
CharUnits getMemberPointerPathAdjustment(const APValue &MP) const
Find the 'this' offset for the member path in a pointer-to-member APValue.
Definition: ASTContext.cpp:2565
clang::ASTContext::SatUnsignedLongAccumTy
CanQualType SatUnsignedLongAccumTy
Definition: ASTContext.h:1087
clang::ASTContext::getObjCConstantStringInterface
QualType getObjCConstantStringInterface() const
Definition: ASTContext.h:1774
clang::ASTContext::getTypeSizeInCharsIfKnown
Optional< CharUnits > getTypeSizeInCharsIfKnown(const Type *Ty) const
Definition: ASTContext.h:2264
clang::ASTContext::getFunctionNoProtoType
QualType getFunctionNoProtoType(QualType ResultTy) const
Definition: ASTContext.h:1511
clang::ASTContext::SatFractTy
CanQualType SatFractTy
Definition: ASTContext.h:1088
clang::ASTContext::getQualifiedTemplateName
TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateDecl *Template) const
Retrieve the template name that represents a qualified template name such as std::vector.
Definition: ASTContext.cpp:8513
clang::ASTContext::getTraversalScope
std::vector< Decl * > getTraversalScope() const
Definition: ASTContext.h:679
clang::ASTContext::BuiltinVectorTypeInfo::BuiltinVectorTypeInfo
BuiltinVectorTypeInfo(QualType ElementType, llvm::ElementCount EC, unsigned NumVectors)
Definition: ASTContext.h:1446
clang::ASTContext::NumImplicitDestructors
unsigned NumImplicitDestructors
The number of implicitly-declared destructors.
Definition: ASTContext.h:3072
clang::ASTContext::getPointerDiffType
QualType getPointerDiffType() const
Return the unique type for "ptrdiff_t" (C99 7.17) defined in <stddef.h>.
Definition: ASTContext.cpp:5758
clang::ASTContext::setsigjmp_bufDecl
void setsigjmp_bufDecl(TypeDecl *sigjmp_bufDecl)
Set the type for the C sigjmp_buf type.
Definition: ASTContext.h:1899
clang::ASTContext::areCompatibleVectorTypes
bool areCompatibleVectorTypes(QualType FirstVec, QualType SecondVec)
Return true if the given vector types are of the same unqualified type or if they are equivalent to t...
Definition: ASTContext.cpp:8725
CanThrow
static bool CanThrow(Expr *E, ASTContext &Ctx)
Definition: CFG.cpp:2585
clang::ASTContext::UnsignedLongFractTy
CanQualType UnsignedLongFractTy
Definition: ASTContext.h:1084
clang::TypedefNameDecl
Base class for declarations which introduce a typedef-name.
Definition: Decl.h:3180
clang::BuiltinTemplateDecl
Represents the builtin template declaration which is used to implement __make_integer_seq and other b...
Definition: DeclTemplate.h:1760
clang::ASTContext::getNSUIntegerType
CanQualType getNSUIntegerType() const
Definition: ASTContext.cpp:6896
clang::ASTContext::getObjCPropertyImplDeclForPropertyDecl
ObjCPropertyImplDecl * getObjCPropertyImplDeclForPropertyDecl(const ObjCPropertyDecl *PD, const Decl *Container) const
Definition: ASTContext.cpp:7149
clang::NullabilityKind::Nullable
@ Nullable
Values of this type can be null.
clang::Qualifiers::removeObjCLifetime
void removeObjCLifetime()
Definition: Type.h:341
clang::ASTContext::lookupFieldBitOffset
uint64_t lookupFieldBitOffset(const ObjCInterfaceDecl *OID, const ObjCImplementationDecl *ID, const ObjCIvarDecl *Ivar) const
Get the offset of an ObjCIvarDecl in bits.
Definition: RecordLayoutBuilder.cpp:3404
clang::ASTContext::getASTRecordLayout
const ASTRecordLayout & getASTRecordLayout(const RecordDecl *D) const
Get or compute information about the layout of the specified record (struct/union/class) D,...
Definition: RecordLayoutBuilder.cpp:3246
clang::ObjCContainerDecl
ObjCContainerDecl - Represents a container for method declarations.
Definition: DeclObjC.h:945
clang::ASTContext::getCanonicalTemplateArgument
TemplateArgument getCanonicalTemplateArgument(const TemplateArgument &Arg) const
Retrieve the "canonical" template argument.
Definition: ASTContext.cpp:6064
clang::ASTContext::addressSpaceMapManglingFor
bool addressSpaceMapManglingFor(LangAS AS) const
Definition: ASTContext.h:2728
clang::ASTContext::getAlignOfGlobalVarInChars
CharUnits getAlignOfGlobalVarInChars(QualType T) const
Return the alignment in characters that should be given to a global variable with type T.
Definition: ASTContext.cpp:2551
clang::ASTContext::addDeclaratorForUnnamedTagDecl
void addDeclaratorForUnnamedTagDecl(TagDecl *TD, DeclaratorDecl *DD)
Definition: ASTContext.cpp:11352
clang::ASTContext::mergeObjCGCQualifiers
QualType mergeObjCGCQualifiers(QualType, QualType)
mergeObjCGCQualifiers - This routine merges ObjC's GC attribute of 'LHS' and 'RHS' attributes and ret...
Definition: ASTContext.cpp:10133
clang::ASTContext::OCLQueueTy
CanQualType OCLQueueTy
Definition: ASTContext.h:1106
clang::TypeInfo::TypeInfo
TypeInfo()
Definition: ASTContext.h:186
clang::ASTContext::getBuiltinMSVaListType
QualType getBuiltinMSVaListType() const
Retrieve the type of the __builtin_ms_va_list type.
Definition: ASTContext.h:2056
clang::ASTContext::getTrivialTypeSourceInfo
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location,...
Definition: ASTContext.cpp:2952
clang::ASTContext::hasSimilarType
bool hasSimilarType(QualType T1, QualType T2)
Determine if two types are similar, according to the C++ rules.
Definition: ASTContext.cpp:5930
clang::QualType::getTypePtr
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
Definition: Type.h:6425
clang::ASTContext::UnsignedInt128Ty
CanQualType UnsignedInt128Ty
Definition: ASTContext.h:1078
CanonicalType.h
clang::ASTContext::getPointerType
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
Definition: ASTContext.cpp:3251
clang::ASTContext::getDependentAddressSpaceType
QualType getDependentAddressSpaceType(QualType PointeeType, Expr *AddrSpaceExpr, SourceLocation AttrLoc) const
Definition: ASTContext.cpp:4184
clang::ASTContext::ShortAccumTy
CanQualType ShortAccumTy
Definition: ASTContext.h:1080
clang::ASTContext::getTypeSizeInCharsIfKnown
Optional< CharUnits > getTypeSizeInCharsIfKnown(QualType Ty) const
Definition: ASTContext.h:2258
clang::CharUnits
CharUnits - This is an opaque type for sizes expressed in character units.
Definition: CharUnits.h:38
clang::ASTContext::VaListTagDecl
Decl * VaListTagDecl
Definition: ASTContext.h:1128
clang::ASTContext::Float128Ty
CanQualType Float128Ty
Definition: ASTContext.h:1079
clang::ASTContext::hasSameNullabilityTypeQualifier
bool hasSameNullabilityTypeQualifier(QualType SubT, QualType SuperT, bool IsParam) const
Definition: ASTContext.h:2507
clang::ASTContext::getTypeInfoInChars
TypeInfoChars getTypeInfoInChars(const Type *T) const
Definition: ASTContext.cpp:1876
clang::ASTContext::getArrayDecayedType
QualType getArrayDecayedType(QualType T) const
Return the properly qualified result of decaying the specified array type to a pointer.
Definition: ASTContext.cpp:6263
clang::ASTContext::isDependenceAllowed
bool isDependenceAllowed() const
Definition: ASTContext.h:763
clang::APValue
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Definition: APValue.h:122
clang::ASTContext::hasSameType
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
Definition: ASTContext.h:2478
clang::ASTContext::getObjCEncodingForType
void getObjCEncodingForType(QualType T, std::string &S, const FieldDecl *Field=nullptr, QualType *NotEncodedT=nullptr) const
Emit the Objective-CC type encoding for the given type T into S.
Definition: ASTContext.cpp:7276
clang::ASTContext::NumImplicitMoveConstructors
unsigned NumImplicitMoveConstructors
The number of implicitly-declared move constructors.
Definition: ASTContext.h:3051
clang::ASTContext::getModuleInitializers
ArrayRef< Decl * > getModuleInitializers(Module *M)
Get the initializations to perform when importing a module, if any.
Definition: ASTContext.cpp:1184
llvm::SmallVectorImpl
Definition: LLVM.h:39
clang::ASTContext::setObjCIdRedefinitionType
void setObjCIdRedefinitionType(QualType RedefType)
Set the user-written type that redefines id.
Definition: ASTContext.h:1795
clang::ASTContext::isMSStaticDataMemberInlineDefinition
bool isMSStaticDataMemberInlineDefinition(const VarDecl *VD) const
Returns true if this is an inline-initialized static data member which is treated as a definition for...
Definition: ASTContext.cpp:6948
AttrKinds.h
clang::ASTContext::setucontext_tDecl
void setucontext_tDecl(TypeDecl *ucontext_tDecl)
Set the type for the C ucontext_t type.
Definition: ASTContext.h:1911
clang::ASTContext::getMSGuidTagDecl
TagDecl * getMSGuidTagDecl() const
Retrieve the implicitly-predeclared 'struct _G