[PATCH] D40731: Integrate CHash into CLang

2018-03-12 Thread Christian Dietrich via Phabricator via cfe-commits
stettberger added inline comments. Comment at: include/clang/AST/CHashVisitor.h:72-79 + template + void addData(const llvm::iterator_range &x) { +addData(std::distance(x.begin(), x.end())); + } + template + void addData(const llvm::ArrayRef &x) { +addData(x.size());

[PATCH] D40731: Integrate CHash into CLang

2018-03-12 Thread Christian Dietrich via Phabricator via cfe-commits
stettberger updated this revision to Diff 138019. stettberger marked an inline comment as done. stettberger added a comment. Addressed comments, for more details, please see the mail on cfe-devel Repository: rC Clang https://reviews.llvm.org/D40731 Files: include/clang/AST/AttrDataCollecto

[PATCH] D40731: Integrate CHash into CLang

2018-03-10 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. I am not sure if this is the right time but maybe testing and comparing the behavior of this patch against something such as the ODRHash will help you, me (and probably others) to understand the current patch better. In https://reviews.llvm.org/D41416, I started wo

[PATCH] D40731: Integrate CHash into CLang

2018-03-09 Thread Richard Trieu via Phabricator via cfe-commits
rtrieu added inline comments. Herald added a subscriber: JDevlieghere. Comment at: include/clang/AST/CHashVisitor.h:72-79 + template + void addData(const llvm::iterator_range &x) { +addData(std::distance(x.begin(), x.end())); + } + template + void addData(const llvm::Arr

[PATCH] D40731: Integrate CHash into CLang

2018-02-23 Thread Christian Dietrich via Phabricator via cfe-commits
stettberger updated this revision to Diff 135598. stettberger added a comment. [CHash] Stable TU-level AST Hashing for local and global hashes This patch does integrate the AST hashing parts of the CHash project[1][2] into CLang. The extension provided by this patch accomplishes 2 things: - loca

[PATCH] D40731: Integrate CHash into CLang

2018-02-21 Thread Christian Dietrich via Phabricator via cfe-commits
stettberger updated this revision to Diff 135227. stettberger added a comment. Rebased to HEAD, Run (external) clang-hash testsuite and ASTTest Repository: rC Clang https://reviews.llvm.org/D40731 Files: include/clang/AST/AttrDataCollectors.td include/clang/AST/CHashVisitor.h include/c

[PATCH] D40731: Integrate CHash into CLang

2017-12-14 Thread Christian Dietrich via Phabricator via cfe-commits
stettberger updated this revision to Diff 126925. stettberger added a comment. @rtrieu: Fixed the checking of Decl::hasAttrs() before using Decl::attrs() Repository: rC Clang https://reviews.llvm.org/D40731 Files: include/clang/AST/AttrDataCollectors.td include/clang/AST/CHashVisitor.h

[PATCH] D40731: Integrate CHash into CLang

2017-12-12 Thread Christian Dietrich via Phabricator via cfe-commits
stettberger updated this revision to Diff 126523. stettberger added a comment. I removed the magic constants and added the number of children for various AST nodes. This should avoid hash collisions. Repository: rC Clang https://reviews.llvm.org/D40731 Files: include/clang/AST/AttrDataCol

[PATCH] D40731: Integrate CHash into CLang

2017-12-04 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D40731#943564, @stettberger wrote: > For my changes to StmtDataCollectors: I tried to leave the already existing > entries in StmtDataCollector.td untouched and the test-cases still work OK. > If there is something somebody could break by ch

[PATCH] D40731: Integrate CHash into CLang

2017-12-04 Thread Christian Dietrich via Phabricator via cfe-commits
stettberger added a comment. For my changes to StmtDataCollectors: I tried to leave the already existing entries in StmtDataCollector.td untouched and the test-cases still work OK. If there is something somebody could break by changing these files it would be good to have a test case for it. H

[PATCH] D40731: Integrate CHash into CLang

2017-12-04 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. So you can define a category for cHash and add `let cHash = [{ .. }]` or `let cHash = TypeIIClone;` if you just want to reuse it. With this patch you can also use !codeconcat to append some code: https://reviews.llvm.org/D40782 Repository: rC Clang https://reviews.

[PATCH] D40731: Integrate CHash into CLang

2017-12-04 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D40731#943469, @stettberger wrote: > @Eugene.Zelenko Thank you for pointing me out on these issues. I ran > clang-tidy and clang-format on CHashVisitor.h > > @rsmith You're right, there is already more than one implemenation of > {partial,un

[PATCH] D40731: Integrate CHash into CLang

2017-12-04 Thread Christian Dietrich via Phabricator via cfe-commits
stettberger updated this revision to Diff 125309. stettberger marked 9 inline comments as done. stettberger added a comment. @Eugene.Zelenko Thank you for pointing me out on these issues. I ran clang-tidy and clang-format on CHashVisitor.h @rsmith You're right, there is already more than one imp

[PATCH] D40731: Integrate CHash into CLang

2017-12-01 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. We already have mechanisms to hash the AST. I'm strongly opposed to adding another one (and requiring AST modifications to update yet more such mechanisms). Please look at the work that Richard Trieu has been doing recently to create stable-across-TUs hashes of statemen

[PATCH] D40731: Integrate CHash into CLang

2017-12-01 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Please run Clang-format and Clang-tidy modernize over newly added code. Comment at: include/clang/AST/CHashVisitor.h:1 +#ifndef __CHASH_VISITOR +#define __CHASH_VISITOR Please loon onto other headers for inclusion guards style.

[PATCH] D40731: Integrate CHash into CLang

2017-12-01 Thread Christian Dietrich via Phabricator via cfe-commits
stettberger created this revision. Herald added subscribers: cfe-commits, aprantl, mgorny. The CHashVisitor can be used to determine a unique hash for a translation unit. The hash is stable across compiler invocations and if two translation units have the same hash, the resulting object file is