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());
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
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
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
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
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
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
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
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
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
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.
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
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
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
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.
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
16 matches
Mail list logo