@@ -58,7 +58,6 @@ namespace clang {
58
58
59
59
class ExtQuals;
60
60
class QualType;
61
- class ConceptDecl;
62
61
class TagDecl;
63
62
class Type;
64
63
@@ -1684,15 +1683,6 @@ class alignas(8) Type : public ExtQualsTypeCommonBase {
1684
1683
/// Was this placeholder type spelled as 'auto', 'decltype(auto)',
1685
1684
/// or '__auto_type'? AutoTypeKeyword value.
1686
1685
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;
1696
1686
};
1697
1687
1698
1688
class SubstTemplateTypeParmPackTypeBitfields {
@@ -4824,7 +4814,8 @@ class SubstTemplateTypeParmPackType : public Type, public llvm::FoldingSetNode {
4824
4814
4825
4815
/// Common base class for placeholders for types that get replaced by
4826
4816
/// 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.
4828
4819
///
4829
4820
/// These types are usually a placeholder for a deduced type. However, before
4830
4821
/// the initializer is attached, or (usually) if the initializer is
@@ -4869,50 +4860,18 @@ class DeducedType : public Type {
4869
4860
}
4870
4861
};
4871
4862
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 {
4875
4865
friend class ASTContext; // ASTContext creates these
4876
4866
4877
- ConceptDecl *TypeConstraintConcept;
4878
-
4879
4867
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;
4889
4872
}
4890
4873
4891
4874
public:
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
-
4916
4875
bool isDecltypeAuto() const {
4917
4876
return getKeyword() == AutoTypeKeyword::DecltypeAuto;
4918
4877
}
@@ -4921,15 +4880,18 @@ class alignas(8) AutoType : public DeducedType, public llvm::FoldingSetNode {
4921
4880
return (AutoTypeKeyword)AutoTypeBits.Keyword;
4922
4881
}
4923
4882
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 ());
4927
4886
}
4928
4887
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
+ }
4933
4895
4934
4896
static bool classof(const Type *T) {
4935
4897
return T->getTypeClass() == Auto;
0 commit comments