Skip to content

Commit

Permalink
[FOLD] use single ODRHash object
Browse files Browse the repository at this point in the history
  • Loading branch information
sdkrystian committed Jul 29, 2024
1 parent 69c2d00 commit effd1a8
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/lib/AST/ASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class ASTVisitor
FileInfo> files_;

llvm::SmallString<128> usr_;
ODRHash odr_hash_;

SymbolFilter symbolFilter_;

Expand Down Expand Up @@ -633,21 +634,21 @@ class ASTVisitor
if(Described)
{
const TemplateParameterList* TPL = Described->getTemplateParameters();
ODRHash Hash;
Hash.AddTemplateParameterList(TPL);
odr_hash_.AddTemplateParameterList(TPL);
if(const auto* RC = TPL->getRequiresClause())
Hash.AddStmt(RC);
odr_hash_.AddStmt(RC);
usr_.append("@TPL#");
usr_.append(llvm::itostr(Hash.CalculateHash()));
usr_.append(llvm::itostr(odr_hash_.CalculateHash()));
odr_hash_.clear();
}

if(auto* FD = dyn_cast<FunctionDecl>(Templated);
FD && FD->getTrailingRequiresClause())
{
ODRHash Hash;
Hash.AddStmt(FD->getTrailingRequiresClause());
odr_hash_.AddStmt(FD->getTrailingRequiresClause());
usr_.append("@TRC#");
usr_.append(llvm::itostr(Hash.CalculateHash()));
usr_.append(llvm::itostr(odr_hash_.CalculateHash()));
odr_hash_.clear();
}

return false;
Expand Down Expand Up @@ -4511,7 +4512,7 @@ class ASTVisitorConsumer
void HandleTagDeclRequiredDefinition(const TagDecl*) override { }
void HandleInterestingDecl(DeclGroupRef) override { }
void CompleteTentativeDefinition(VarDecl*) override { }
void CompleteExternalDeclaration(VarDecl*) override { }
// void CompleteExternalDeclaration(VarDecl*) override { }
void AssignInheritanceModel(CXXRecordDecl*) override { }
void HandleVTable(CXXRecordDecl*) override { }
void HandleImplicitImportDecl(ImportDecl*) override { }
Expand Down

0 comments on commit effd1a8

Please sign in to comment.