ROSE 0.11.145.63
Public Member Functions | List of all members
Rose::BinaryAnalysis::AstHash Class Reference

Description

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.

#include <Rose/BinaryAnalysis/AstHash.h>

Inheritance diagram for Rose::BinaryAnalysis::AstHash:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::AstHash:
Collaboration graph
[legend]

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::Hasherhasher () const
 
- Public Member Functions inherited from AstSimpleProcessing
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).
 
- Public Member Functions inherited from SgTreeTraversal< DummyAttribute, DummyAttribute >
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 SgTreeTraversaloperator= (const SgTreeTraversal &)
 

Additional Inherited Members

- Public Types inherited from AstSimpleProcessing
typedef t_traverseOrder Order
 
- Public Types inherited from SgTreeTraversal< DummyAttribute, DummyAttribute >
typedef StackFrameVector< DummyAttribute > SynthesizedAttributesList
 
- Protected Types inherited from SgTreeTraversal< DummyAttribute, DummyAttribute >
typedef AstSuccessorsSelectors::SuccessorsContainer SuccessorsContainer
 
typedef SuccessorsContainer & SuccessorsContainerRef
 
- Protected Member Functions inherited from AstSimpleProcessing
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 ()
 
- Protected Member Functions inherited from SgTreeTraversal< DummyAttribute, DummyAttribute >
virtual void setNodeSuccessors (SgNode *node, SuccessorsContainer &succContainer)
 
void set_useDefaultIndexBasedTraversal (bool)
 

Constructor & Destructor Documentation

◆ AstHash()

Rose::BinaryAnalysis::AstHash::AstHash ( boost::shared_ptr< Rose::Combinatorics::Hasher in_hasher,
bool  includeConstants = false,
bool  includeAddresses = false 
)
inline

Definition at line 35 of file AstHash.h.

Member Function Documentation

◆ visit()

void Rose::BinaryAnalysis::AstHash::visit ( SgNode astNode)
virtual

this method is called at every traversed node.

Implements AstSimpleProcessing.

◆ hasher()

const boost::shared_ptr< Rose::Combinatorics::Hasher > Rose::BinaryAnalysis::AstHash::hasher ( ) const
inline

Definition at line 45 of file AstHash.h.


The documentation for this class was generated from the following file: