diff options
Diffstat (limited to 'include/clang/AST/ASTContext.h')
-rw-r--r-- | include/clang/AST/ASTContext.h | 70 |
1 files changed, 42 insertions, 28 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 13870116c7..1cddb6fd29 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -1,9 +1,8 @@ //===- ASTContext.h - Context to hold long-lived AST nodes ------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -266,11 +265,6 @@ private: /// Mapping from __block VarDecls to BlockVarCopyInit. llvm::DenseMap<const VarDecl *, BlockVarCopyInit> BlockVarCopyInits; - /// Mapping from class scope functions specialization to their - /// template patterns. - llvm::DenseMap<const FunctionDecl*, FunctionDecl*> - ClassScopeSpecializationPattern; - /// Mapping from materialized temporaries with static storage duration /// that appear in constant initializers to their evaluated values. These are /// allocated in a std::map because their address must be stable. @@ -892,11 +886,6 @@ public: TemplateOrSpecializationInfo getTemplateOrSpecializationInfo(const VarDecl *Var); - FunctionDecl *getClassScopeSpecializationPattern(const FunctionDecl *FD); - - void setClassScopeSpecializationPattern(FunctionDecl *FD, - FunctionDecl *Pattern); - /// Note that the static data member \p Inst is an instantiation of /// the static data member template \p Tmpl of a class template. void setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl, @@ -2003,6 +1992,9 @@ public: /// No error GE_None, + /// Missing a type + GE_Missing_type, + /// Missing a type from <stdio.h> GE_Missing_stdio, @@ -2086,6 +2078,16 @@ public: CharUnits getTypeSizeInChars(QualType T) const; CharUnits getTypeSizeInChars(const Type *T) const; + Optional<CharUnits> getTypeSizeInCharsIfKnown(QualType Ty) const { + if (Ty->isIncompleteType() || Ty->isDependentType()) + return None; + return getTypeSizeInChars(Ty); + } + + Optional<CharUnits> getTypeSizeInCharsIfKnown(const Type *Ty) const { + return getTypeSizeInCharsIfKnown(QualType(Ty, 0)); + } + /// Return the ABI-specified alignment of a (complete) type \p T, in /// bits. unsigned getTypeAlign(QualType T) const { return getTypeInfo(T).Align; } @@ -2225,7 +2227,8 @@ public: VTableContextBase *getVTableContext(); - MangleContext *createMangleContext(); + /// If \p T is null pointer, assume the target in ASTContext. + MangleContext *createMangleContext(const TargetInfo *T = nullptr); void DeepCollectObjCIvars(const ObjCInterfaceDecl *OI, bool leafClass, SmallVectorImpl<const ObjCIvarDecl*> &Ivars) const; @@ -2488,6 +2491,11 @@ public: /// \p LHS < \p RHS, return -1. int getFloatingTypeOrder(QualType LHS, QualType RHS) const; + /// Compare the rank of two floating point types as above, but compare equal + /// if both types have the same floating-point semantics on the target (i.e. + /// long double and double on AArch64 will return 0). + int getFloatingTypeSemanticOrder(QualType LHS, QualType RHS) const; + /// Return a real floating point or a complex type (based on /// \p typeDomain/\p typeSize). /// @@ -2624,6 +2632,12 @@ public: // corresponding saturated type for a given fixed point type. QualType getCorrespondingSaturatedType(QualType Ty) const; + // This method accepts fixed point types and returns the corresponding signed + // type. Unlike getCorrespondingUnsignedType(), this only accepts unsigned + // fixed point types because there are unsigned integer types like bool and + // char8_t that don't have signed equivalents. + QualType getCorrespondingSignedFixedPointType(QualType Ty) const; + //===--------------------------------------------------------------------===// // Integer Values //===--------------------------------------------------------------------===// @@ -2677,7 +2691,7 @@ public: /// otherwise returns null. const ObjCInterfaceDecl *getObjContainingInterface(const NamedDecl *ND) const; - /// Set the copy inialization expression of a block var decl. \p CanThrow + /// Set the copy initialization expression of a block var decl. \p CanThrow /// indicates whether the copy expression can throw or not. void setBlockVarCopyInit(const VarDecl* VD, Expr *CopyExpr, bool CanThrow); @@ -2785,46 +2799,46 @@ public: //===--------------------------------------------------------------------===// /// The number of implicitly-declared default constructors. - static unsigned NumImplicitDefaultConstructors; + unsigned NumImplicitDefaultConstructors = 0; /// The number of implicitly-declared default constructors for /// which declarations were built. - static unsigned NumImplicitDefaultConstructorsDeclared; + unsigned NumImplicitDefaultConstructorsDeclared = 0; /// The number of implicitly-declared copy constructors. - static unsigned NumImplicitCopyConstructors; + unsigned NumImplicitCopyConstructors = 0; /// The number of implicitly-declared copy constructors for /// which declarations were built. - static unsigned NumImplicitCopyConstructorsDeclared; + unsigned NumImplicitCopyConstructorsDeclared = 0; /// The number of implicitly-declared move constructors. - static unsigned NumImplicitMoveConstructors; + unsigned NumImplicitMoveConstructors = 0; /// The number of implicitly-declared move constructors for /// which declarations were built. - static unsigned NumImplicitMoveConstructorsDeclared; + unsigned NumImplicitMoveConstructorsDeclared = 0; /// The number of implicitly-declared copy assignment operators. - static unsigned NumImplicitCopyAssignmentOperators; + unsigned NumImplicitCopyAssignmentOperators = 0; /// The number of implicitly-declared copy assignment operators for /// which declarations were built. - static unsigned NumImplicitCopyAssignmentOperatorsDeclared; + unsigned NumImplicitCopyAssignmentOperatorsDeclared = 0; /// The number of implicitly-declared move assignment operators. - static unsigned NumImplicitMoveAssignmentOperators; + unsigned NumImplicitMoveAssignmentOperators = 0; /// The number of implicitly-declared move assignment operators for /// which declarations were built. - static unsigned NumImplicitMoveAssignmentOperatorsDeclared; + unsigned NumImplicitMoveAssignmentOperatorsDeclared = 0; /// The number of implicitly-declared destructors. - static unsigned NumImplicitDestructors; + unsigned NumImplicitDestructors = 0; /// The number of implicitly-declared destructors for which /// declarations were built. - static unsigned NumImplicitDestructorsDeclared; + unsigned NumImplicitDestructorsDeclared = 0; public: /// Initialize built-in types. |