A simple traversal that builds up a hash code for the AST.
This hash was intended to uniquely identify a function, but it can be used for any AST. The hash can be generated by any hashing function in Rose::Combinatorics::Hasher. Also has options for what should be included in the hash. including constants, instruction addresses, mnemonics or byte codes
Use like this: AstHash astHash(hasher, false, false); astHash.traverse(node,preorder); hash = astHash.hasher().digest();
Definition at line 31 of file AstHash.h.
|
| AstHash (boost::shared_ptr< Rose::Combinatorics::Hasher > in_hasher, bool includeConstants=false, bool includeAddresses=false) |
|
void | visit (SgNode *n) |
| this method is called at every traversed node.
|
|
void | appendBasicBlock (Rose::BinaryAnalysis::Partitioner2::BasicBlockPtr bb) |
|
const boost::shared_ptr< Rose::Combinatorics::Hasher > | hasher () const |
|
void | traverse (SgNode *node, Order treeTraversalOrder) |
| traverse the entire AST. Order defines preorder (preorder) or postorder (postorder) traversal. Default is 'preorder'.
|
|
void | traverseWithinFile (SgNode *node, Order treeTraversalOrder) |
| traverse only nodes which represent the same file as where the traversal was started
|
|
void | traverseInputFiles (SgProject *projectNode, Order treeTraversalOrder) |
| traverse only nodes which represent files which were specified on the command line (=input files).
|
|
DummyAttribute | traverse (SgNode *basenode, DummyAttribute inheritedValue, t_traverseOrder travOrder=preandpostorder) |
|
DummyAttribute | traverseWithinFile (SgNode *basenode, DummyAttribute inheritedValue, t_traverseOrder travOrder=preandpostorder) |
|
void | traverseInputFiles (SgProject *projectNode, DummyAttribute inheritedValue, t_traverseOrder travOrder=preandpostorder) |
|
| SgTreeTraversal (const SgTreeTraversal &) |
|
const SgTreeTraversal & | operator= (const SgTreeTraversal &) |
|