ROSE 0.11.145.147
Public Types | Public Member Functions | Protected Attributes | List of all members
TaintLattice Class Reference

Description

A pointer to a vertex of the static taint lattice.

The taint lattice is static, consisting of only the vertices defined by the Vertex enum. A TaintLattice object is slightly misnamed but follows existing convention: it's not really the whole lattice, but a pointer to one of the static latice's vertices.

Definition at line 57 of file taintAnalysis.h.

#include <midend/programAnalysis/genericDataflow/simpleAnalyses/taintAnalysis.h>

Inheritance diagram for TaintLattice:
Inheritance graph
[legend]
Collaboration diagram for TaintLattice:
Collaboration graph
[legend]

Public Types

enum  Vertex {
  VERTEX_BOTTOM ,
  VERTEX_UNTAINTED ,
  VERTEX_TAINTED
}
 The differet vertices of this static lattice. More...
 

Public Member Functions

 TaintLattice ()
 Default initializer makes this object point to the lattice's bottom vertex.
 
virtual void initialize () override
 Same as default constructor.
 
virtual Latticecopy () const override
 Returns a new copy of this vertex pointer.
 
virtual void copy (Lattice *other_) override
 Assignment-like operator.
 
virtual bool operator== (Lattice *other_) override
 Equality predicate, sort of.
 
virtual std::string str (std::string prefix) override
 String representation of the lattice vertex to which this object points.
 
std::string to_string () const
 String representation of a lattice vertex.
 
virtual bool meetUpdate (Lattice *other_) override
 Merges this lattice node with another and stores the result in this node.
 
Vertex get_vertex () const
 Accessor for this node's vertex in the lattice.
 
bool set_vertex (Vertex v)
 Accessor for this node's vertex in the lattice.
 
- Public Member Functions inherited from FiniteLattice
bool finiteLattice ()
 Check if this lattice is finite or not.
 
- Public Member Functions inherited from Lattice
virtual void remapVars (const std::map< varID, varID > &, const Function &)
 
virtual void incorporateVars (Lattice *)
 
virtual Latticeproject (SgExpression *)
 
virtual bool unProject (SgExpression *, Lattice *exprState)
 
bool operator!= (Lattice *that)
 
bool operator== (Lattice &that)
 
bool operator!= (Lattice &that)
 

Protected Attributes

Vertex vertex
 The vertex of the static taint lattice to which this object points.
 

Member Enumeration Documentation

◆ Vertex

The differet vertices of this static lattice.

They're defined in a particular order so that the meetUpdate() method only needs to compute the maximum when merging two vertex pointers. A value is considered to be tainted if it points to the VERTEX_TAINTED or the VERTEX_TOP vertex of the static taint lattice.

Enumerator
VERTEX_BOTTOM 

No information is known about the value of the variable.

VERTEX_UNTAINTED 

Value is not tainted.

VERTEX_TAINTED 

Value is tainted.

Definition at line 63 of file taintAnalysis.h.

Constructor & Destructor Documentation

◆ TaintLattice()

TaintLattice::TaintLattice ( )
inline

Default initializer makes this object point to the lattice's bottom vertex.

Definition at line 76 of file taintAnalysis.h.

Referenced by copy(), and initialize().

Member Function Documentation

◆ initialize()

virtual void TaintLattice::initialize ( )
inlineoverridevirtual

Same as default constructor.

Implements Lattice.

Definition at line 79 of file taintAnalysis.h.

References TaintLattice().

◆ get_vertex()

Vertex TaintLattice::get_vertex ( ) const
inline

Accessor for this node's vertex in the lattice.

The set_level() mutator also returns true if the new value is different than the old value, and false if there was no change.

Definition at line 86 of file taintAnalysis.h.

References vertex.

◆ set_vertex()

bool TaintLattice::set_vertex ( Vertex  v)

Accessor for this node's vertex in the lattice.

The set_level() mutator also returns true if the new value is different than the old value, and false if there was no change.

◆ copy() [1/2]

virtual Lattice * TaintLattice::copy ( ) const
inlineoverridevirtual

Returns a new copy of this vertex pointer.

Implements Lattice.

Definition at line 92 of file taintAnalysis.h.

References TaintLattice().

◆ copy() [2/2]

virtual void TaintLattice::copy ( Lattice other_)
overridevirtual

Assignment-like operator.

Makes this object point to the same lattice vertex as the other object. The other object must also be a TaintLattice object.

Implements Lattice.

◆ operator==()

virtual bool TaintLattice::operator== ( Lattice other_)
overridevirtual

Equality predicate, sort of.

Beware that this is not true equality since it is not symmetric.

Implements Lattice.

◆ str()

virtual std::string TaintLattice::str ( std::string  prefix)
inlineoverridevirtual

String representation of the lattice vertex to which this object points.

The return value is the name of the vertex to which this object points, sans "VERTEX_" prefix, and converted to lower case. The prefix is prepended to the returned string.

Implements printable.

Definition at line 116 of file taintAnalysis.h.

References to_string().

◆ to_string()

std::string TaintLattice::to_string ( ) const

String representation of a lattice vertex.

Returns the name of the taint lattice vertex to which this object points. The returned string is one of the Vertex enum constants sans the "VERTEX_" prefix and converted to lower case.

Referenced by TaintAnalysis::lattice_info(), and str().

◆ meetUpdate()

virtual bool TaintLattice::meetUpdate ( Lattice other_)
overridevirtual

Merges this lattice node with another and stores the result in this node.

Returns true iff this node changed.

Implements Lattice.

Member Data Documentation

◆ vertex

Vertex TaintLattice::vertex
protected

The vertex of the static taint lattice to which this object points.

Definition at line 71 of file taintAnalysis.h.

Referenced by get_vertex().


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