diff options
Diffstat (limited to 'clang/include/clang/AST/ASTContext.h')
-rw-r--r-- | clang/include/clang/AST/ASTContext.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 66ec339..17cbfb2 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -277,6 +277,11 @@ class ASTContext : public RefCountedBase<ASTContext> { mutable llvm::ContextualFoldingSet<ArrayParameterType, ASTContext &> ArrayParameterTypes; + /// Store the unique Type corresponding to each Kind. + mutable std::array<Type *, + llvm::to_underlying(PredefinedSugarType::Kind::Last) + 1> + PredefinedSugarTypes{}; + /// The set of nested name specifiers. /// /// This set is managed by the NestedNameSpecifier class. @@ -1192,6 +1197,8 @@ public: bool isInSameModule(const Module *M1, const Module *M2) const; TranslationUnitDecl *getTranslationUnitDecl() const { + assert(TUDecl->getMostRecentDecl() == TUDecl && + "The active TU is not current one!"); return TUDecl->getMostRecentDecl(); } void addTranslationUnitDecl() { @@ -1567,6 +1574,8 @@ public: /// and bit count. QualType getDependentBitIntType(bool Unsigned, Expr *BitsExpr) const; + QualType getPredefinedSugarType(PredefinedSugarType::Kind KD) const; + /// Gets the struct used to keep track of the extended descriptor for /// pointer to blocks. QualType getBlockDescriptorExtendedType() const; @@ -1999,11 +2008,13 @@ public: /// <stddef.h>. /// /// The sizeof operator requires this (C99 6.5.3.4p4). - CanQualType getSizeType() const; + QualType getSizeType() const; + + CanQualType getCanonicalSizeType() const; /// Return the unique signed counterpart of /// the integer type corresponding to size_t. - CanQualType getSignedSizeType() const; + QualType getSignedSizeType() const; /// Return the unique type for "intmax_t" (C99 7.18.1.5), defined in /// <stdint.h>. |