Skip to content
Snippets Groups Projects
Commit 601674bd authored by Christian Dietrich's avatar Christian Dietrich
Browse files

[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
parent 0972dc79
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment