ROSE 0.11.145.63
|
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();
#include <Rose/BinaryAnalysis/AstHash.h>
Public Member Functions | |
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 &) |
Additional Inherited Members | |
![]() | |
typedef t_traverseOrder | Order |
![]() | |
typedef StackFrameVector< DummyAttribute > | SynthesizedAttributesList |
![]() | |
typedef AstSuccessorsSelectors::SuccessorsContainer | SuccessorsContainer |
typedef SuccessorsContainer & | SuccessorsContainerRef |
![]() | |
virtual void | atTraversalStart () |
GB (06/04/2007): A new virtual function called at the start of the traversal, before any node is actually visited; can be used to perform a "last-minute" computation of attributes that may have changed since the constructor was executed, but are constant during the traversal itself. | |
virtual void | atTraversalEnd () |
![]() | |
virtual void | setNodeSuccessors (SgNode *node, SuccessorsContainer &succContainer) |
void | set_useDefaultIndexBasedTraversal (bool) |
|
inline |
|
virtual |
this method is called at every traversed node.
Implements AstSimpleProcessing.
|
inline |