-
- Downloads
[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: - local hashes: It extends StmtDataCollector infrastructure by hash rules for declarations, types, and attributes. These rules are expressed in terms of TableGen files and capture what parts of a AST node are important to its semantic. Thereby, the rules only include information that is local to the respecting node (no pointers to other AST nodes should be followed). Since these DataCollectors do not impose rules how the AST nodes relate to each other, they provide a mechanism for "local" hashes. - global hashes: The CHashVisitor combines the local hashes via the RecursiveAST Visitor into a global semantic hash that includes (for a given AST node) all local hashes of all AST nodes that can influence the compilation of this AST node. With these global hashes, we can deduce (early) in the compilation process wether the result of this compiler run will produce the same object file. This mechanism is *NOT* part of this commit. [1] https://www.sra.uni-hannover.de/Research/cHash/ [2] "cHash: Detection of Redunandt Recompilations via AST hashing", USENIX 2017
Showing
- include/clang/AST/AttrDataCollectors.td 10 additions, 0 deletionsinclude/clang/AST/AttrDataCollectors.td
- include/clang/AST/CHashVisitor.h 331 additions, 0 deletionsinclude/clang/AST/CHashVisitor.h
- include/clang/AST/CMakeLists.txt 12 additions, 0 deletionsinclude/clang/AST/CMakeLists.txt
- include/clang/AST/DataCollection.h 10 additions, 0 deletionsinclude/clang/AST/DataCollection.h
- include/clang/AST/DeclDataCollectors.td 205 additions, 0 deletionsinclude/clang/AST/DeclDataCollectors.td
- include/clang/AST/StmtDataCollectors.td 74 additions, 4 deletionsinclude/clang/AST/StmtDataCollectors.td
- include/clang/AST/TypeDataCollectors.td 78 additions, 0 deletionsinclude/clang/AST/TypeDataCollectors.td
- unittests/AST/CHashTest.cpp 116 additions, 0 deletionsunittests/AST/CHashTest.cpp
- unittests/AST/CMakeLists.txt 1 addition, 0 deletionsunittests/AST/CMakeLists.txt
Loading
Please register or sign in to comment