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 0031bca commit f531772
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 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

0 comments on commit f531772

Please sign in to comment.