@@ -58,7 +58,6 @@ namespace clang {
5858
5959class ExtQuals ;
6060class QualType ;
61- class ConceptDecl ;
6261class TagDecl ;
6362class Type ;
6463
@@ -1684,15 +1683,6 @@ class alignas(8) Type : public ExtQualsTypeCommonBase {
16841683 // / Was this placeholder type spelled as 'auto', 'decltype(auto)',
16851684 // / or '__auto_type'? AutoTypeKeyword value.
16861685 unsigned Keyword : 2 ;
1687-
1688- // / The number of template arguments in the type-constraints, which is
1689- // / expected to be able to hold at least 1024 according to [implimits].
1690- // / However as this limit is somewhat easy to hit with template
1691- // / metaprogramming we'd prefer to keep it as large as possible.
1692- // / At the moment it has been left as a non-bitfield since this type
1693- // / safely fits in 64 bits as an unsigned, so there is no reason to
1694- // / introduce the performance impact of a bitfield.
1695- unsigned NumArgs;
16961686 };
16971687
16981688 class SubstTemplateTypeParmPackTypeBitfields {
@@ -4824,7 +4814,8 @@ class SubstTemplateTypeParmPackType : public Type, public llvm::FoldingSetNode {
48244814
48254815// / Common base class for placeholders for types that get replaced by
48264816// / placeholder type deduction: C++11 auto, C++14 decltype(auto), C++17 deduced
4827- // / class template types, and constrained type names.
4817+ // / class template types, and (eventually) constrained type names from the C++
4818+ // / Concepts TS.
48284819// /
48294820// / These types are usually a placeholder for a deduced type. However, before
48304821// / the initializer is attached, or (usually) if the initializer is
@@ -4869,50 +4860,18 @@ class DeducedType : public Type {
48694860 }
48704861};
48714862
4872- // / Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained
4873- // / by a type-constraint.
4874- class alignas (8 ) AutoType : public DeducedType, public llvm::FoldingSetNode {
4863+ // / Represents a C++11 auto or C++14 decltype(auto) type.
4864+ class AutoType : public DeducedType , public llvm ::FoldingSetNode {
48754865 friend class ASTContext ; // ASTContext creates these
48764866
4877- ConceptDecl *TypeConstraintConcept;
4878-
48794867 AutoType (QualType DeducedAsType, AutoTypeKeyword Keyword,
4880- bool IsDeducedAsDependent, bool IsDeducedAsPack, ConceptDecl *CD,
4881- ArrayRef<TemplateArgument> TypeConstraintArgs);
4882-
4883- const TemplateArgument *getArgBuffer () const {
4884- return reinterpret_cast <const TemplateArgument*>(this +1 );
4885- }
4886-
4887- TemplateArgument *getArgBuffer () {
4888- return reinterpret_cast <TemplateArgument*>(this +1 );
4868+ bool IsDeducedAsDependent, bool IsDeducedAsPack)
4869+ : DeducedType(Auto, DeducedAsType, IsDeducedAsDependent,
4870+ IsDeducedAsDependent, IsDeducedAsPack) {
4871+ AutoTypeBits.Keyword = (unsigned )Keyword;
48894872 }
48904873
48914874public:
4892- // / Retrieve the template arguments.
4893- const TemplateArgument *getArgs () const {
4894- return getArgBuffer ();
4895- }
4896-
4897- // / Retrieve the number of template arguments.
4898- unsigned getNumArgs () const {
4899- return AutoTypeBits.NumArgs ;
4900- }
4901-
4902- const TemplateArgument &getArg (unsigned Idx) const ; // in TemplateBase.h
4903-
4904- ArrayRef<TemplateArgument> getTypeConstraintArguments () const {
4905- return {getArgs (), getNumArgs ()};
4906- }
4907-
4908- ConceptDecl *getTypeConstraintConcept () const {
4909- return TypeConstraintConcept;
4910- }
4911-
4912- bool isConstrained () const {
4913- return TypeConstraintConcept != nullptr ;
4914- }
4915-
49164875 bool isDecltypeAuto () const {
49174876 return getKeyword () == AutoTypeKeyword::DecltypeAuto;
49184877 }
@@ -4921,15 +4880,18 @@ class alignas(8) AutoType : public DeducedType, public llvm::FoldingSetNode {
49214880 return (AutoTypeKeyword)AutoTypeBits.Keyword ;
49224881 }
49234882
4924- void Profile (llvm::FoldingSetNodeID &ID, const ASTContext &Context ) {
4925- Profile (ID, Context, getDeducedType (), getKeyword (), isDependentType (),
4926- getTypeConstraintConcept (), getTypeConstraintArguments ());
4883+ void Profile (llvm::FoldingSetNodeID &ID) {
4884+ Profile (ID, getDeducedType (), getKeyword (), isDependentType (),
4885+ containsUnexpandedParameterPack ());
49274886 }
49284887
4929- static void Profile (llvm::FoldingSetNodeID &ID, const ASTContext &Context,
4930- QualType Deduced, AutoTypeKeyword Keyword,
4931- bool IsDependent, ConceptDecl *CD,
4932- ArrayRef<TemplateArgument> Arguments);
4888+ static void Profile (llvm::FoldingSetNodeID &ID, QualType Deduced,
4889+ AutoTypeKeyword Keyword, bool IsDependent, bool IsPack) {
4890+ ID.AddPointer (Deduced.getAsOpaquePtr ());
4891+ ID.AddInteger ((unsigned )Keyword);
4892+ ID.AddBoolean (IsDependent);
4893+ ID.AddBoolean (IsPack);
4894+ }
49334895
49344896 static bool classof (const Type *T) {
49354897 return T->getTypeClass () == Auto;
0 commit comments