teemperor added a comment.

I feel like we have a really similar use case in the 
Analysis/CloneDetection{.h/.cpp} with the hashing of statements. I tried 
substituting the call to the statement hashing with a call to the 
CloneDetection API and it seems that most tests pass and the remaining fails 
are just minor fixable differences (like `::foo()` and `foo()` having different 
hash codes).

Would be nice if we could make Stmt::Profile, ODRHash and the CloneDetection 
use the same backend. We improved a few things that we no longer have the 
periodic `realloc`s from the vector inside NodeIDSet and that we use MD5. Also 
there are are some future plans on how we can better prevent regressions when 
we add/extend AST nodes. Thoughts?



================
Comment at: lib/AST/ODRHash.cpp:11
+/// \file
+/// This file implements the Instruction class, which calculates a hash based
+/// on AST nodes, which is stable across different runs.
----------------
"Instruction class" -> "ODRHash class"


https://reviews.llvm.org/D21675



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to