diff options
Diffstat (limited to 'clang/lib/AST/ODRHash.cpp')
| -rw-r--r-- | clang/lib/AST/ODRHash.cpp | 15 | 
1 files changed, 11 insertions, 4 deletions
| diff --git a/clang/lib/AST/ODRHash.cpp b/clang/lib/AST/ODRHash.cpp index 27fdca1c4b9c..735bcff8f113 100644 --- a/clang/lib/AST/ODRHash.cpp +++ b/clang/lib/AST/ODRHash.cpp @@ -440,7 +440,7 @@ public:  // Only allow a small portion of Decl's to be processed.  Remove this once  // all Decl's can be handled. -bool ODRHash::isWhitelistedDecl(const Decl *D, const DeclContext *Parent) { +bool ODRHash::isDeclToBeProcessed(const Decl *D, const DeclContext *Parent) {    if (D->isImplicit()) return false;    if (D->getDeclContext() != Parent) return false; @@ -487,7 +487,7 @@ void ODRHash::AddCXXRecordDecl(const CXXRecordDecl *Record) {    // accurate count of Decl's.    llvm::SmallVector<const Decl *, 16> Decls;    for (Decl *SubDecl : Record->decls()) { -    if (isWhitelistedDecl(SubDecl, Record)) { +    if (isDeclToBeProcessed(SubDecl, Record)) {        Decls.push_back(SubDecl);        if (auto *Function = dyn_cast<FunctionDecl>(SubDecl)) {          // Compute/Preload ODRHash into FunctionDecl. @@ -588,7 +588,7 @@ void ODRHash::AddFunctionDecl(const FunctionDecl *Function,    // accurate count of Decl's.    llvm::SmallVector<const Decl *, 16> Decls;    for (Decl *SubDecl : Function->decls()) { -    if (isWhitelistedDecl(SubDecl, Function)) { +    if (isDeclToBeProcessed(SubDecl, Function)) {        Decls.push_back(SubDecl);      }    } @@ -614,7 +614,7 @@ void ODRHash::AddEnumDecl(const EnumDecl *Enum) {    // accurate count of Decl's.    llvm::SmallVector<const Decl *, 16> Decls;    for (Decl *SubDecl : Enum->decls()) { -    if (isWhitelistedDecl(SubDecl, Enum)) { +    if (isDeclToBeProcessed(SubDecl, Enum)) {        assert(isa<EnumConstantDecl>(SubDecl) && "Unexpected Decl");        Decls.push_back(SubDecl);      } @@ -857,6 +857,13 @@ public:    void VisitAutoType(const AutoType *T) {      ID.AddInteger((unsigned)T->getKeyword()); +    ID.AddInteger(T->isConstrained()); +    if (T->isConstrained()) { +      AddDecl(T->getTypeConstraintConcept()); +      ID.AddInteger(T->getNumArgs()); +      for (const auto &TA : T->getTypeConstraintArguments()) +        Hash.AddTemplateArgument(TA); +    }      VisitDeducedType(T);    } | 
