ROSE 0.11.145.192
Public Types | Public Member Functions | List of all members
Rose::BinaryAnalysis::Partitioner2::Reference Class Reference

Description

Reference to a function, basic block, instruction, or address.

A reference can be an empty reference, or it points to a function and/or basic block and/or instruction, or it is an address in any combination. A reference has a granularity depending on the finest thing to which it points (see granularity). All non-empty references have a computable address regardless of whether an address is actually stored. References are comparable.

Definition at line 25 of file Reference.h.

#include <Rose/BinaryAnalysis/Partitioner2/Reference.h>

Public Types

enum  Granularity {
  EMPTY ,
  ADDRESS ,
  INSTRUCTION ,
  BASIC_BLOCK ,
  FUNCTION
}
 Granularity. More...
 

Public Member Functions

Granularity granularity () const
 Reference granularity.
 
bool isEmpty () const
 Predicate for emptiness.
 
bool hasFunction () const
 Predicate for having a function.
 
FunctionPtr function () const
 Optional function pointer.
 
bool hasBasicBlock () const
 Predicate for having a basic block.
 
BasicBlockPtr basicBlock () const
 Optional basic block pointer.
 
bool hasInstruction () const
 Predicate for having an instruction.
 
SgAsmInstructioninstruction () const
 Optional instruction pointer.
 
bool hasExplicitAddress () const
 Predicate for having a stored address.
 
rose_addr_t address () const
 Address.
 
bool operator== (const Reference &other) const
 Whether two references are equal.
 
bool operator< (const Reference &other) const
 Compare two references.
 
 Reference (const FunctionPtr &)
 Constructor.
 
 Reference (const FunctionPtr &, const BasicBlockPtr &, SgAsmInstruction *=nullptr, const Sawyer::Optional< rose_addr_t > &=Sawyer::Nothing())
 Constructor.
 
 Reference (const BasicBlockPtr &, SgAsmInstruction *=nullptr, const Sawyer::Optional< rose_addr_t > &=Sawyer::Nothing())
 Constructor.
 
 Reference (SgAsmInstruction *, const Sawyer::Optional< rose_addr_t > &=Sawyer::Nothing())
 Constructor.
 
 Reference (rose_addr_t address)
 Constructor.
 

Member Enumeration Documentation

◆ Granularity

Granularity.

Enumerator
EMPTY 

Reference points to nothing and has no address.

ADDRESS 

Reference points to nothing but has an address.

INSTRUCTION 

Reference points to an instruction but no stored address.

BASIC_BLOCK 

Reference points to a basic block but not an instruction or a stored address.

FUNCTION 

Reference points to a function but not a basic block or instruction, and has no stored address.

Definition at line 32 of file Reference.h.

Constructor & Destructor Documentation

◆ Reference() [1/6]

Rose::BinaryAnalysis::Partitioner2::Reference::Reference ( const FunctionPtr )
explicit

Constructor.

A reference can be constructed from any combination of a function, basic block, instruction, and address.

◆ Reference() [2/6]

Rose::BinaryAnalysis::Partitioner2::Reference::Reference ( const FunctionPtr ,
const BasicBlockPtr ,
SgAsmInstruction = nullptr,
const Sawyer::Optional< rose_addr_t > &  = Sawyer::Nothing() 
)
explicit

Constructor.

A reference can be constructed from any combination of a function, basic block, instruction, and address.

◆ Reference() [3/6]

Rose::BinaryAnalysis::Partitioner2::Reference::Reference ( const BasicBlockPtr ,
SgAsmInstruction = nullptr,
const Sawyer::Optional< rose_addr_t > &  = Sawyer::Nothing() 
)
explicit

Constructor.

A reference can be constructed from any combination of a function, basic block, instruction, and address.

◆ Reference() [4/6]

Rose::BinaryAnalysis::Partitioner2::Reference::Reference ( SgAsmInstruction ,
const Sawyer::Optional< rose_addr_t > &  = Sawyer::Nothing() 
)
explicit

Constructor.

A reference can be constructed from any combination of a function, basic block, instruction, and address.

◆ Reference() [5/6]

Rose::BinaryAnalysis::Partitioner2::Reference::Reference ( rose_addr_t  address)
explicit

Constructor.

A reference can be constructed from any combination of a function, basic block, instruction, and address.

◆ Reference() [6/6]

Rose::BinaryAnalysis::Partitioner2::Reference::Reference ( )

Constructor.

A reference can be constructed from any combination of a function, basic block, instruction, and address.

Member Function Documentation

◆ granularity()

Granularity Rose::BinaryAnalysis::Partitioner2::Reference::granularity ( ) const

Reference granularity.

Returns the granularity for the reference. The granularity is the finest thing stored in the reference. The order from finest to coarsest is: EMPTY, ADDRESS, INSTRUCTION, BASIC_BLOCK, FUNCTION.

◆ isEmpty()

bool Rose::BinaryAnalysis::Partitioner2::Reference::isEmpty ( ) const

Predicate for emptiness.

Returns true if this reference points to nothing and has no stored address.

◆ hasFunction()

bool Rose::BinaryAnalysis::Partitioner2::Reference::hasFunction ( ) const

Predicate for having a function.

Returns true if the reference points to a function.

◆ hasBasicBlock()

bool Rose::BinaryAnalysis::Partitioner2::Reference::hasBasicBlock ( ) const

Predicate for having a basic block.

Returns true if the reference points to a basic block.

◆ hasInstruction()

bool Rose::BinaryAnalysis::Partitioner2::Reference::hasInstruction ( ) const

Predicate for having an instruction.

Returns true if the reference points to an instruction.

◆ hasExplicitAddress()

bool Rose::BinaryAnalysis::Partitioner2::Reference::hasExplicitAddress ( ) const

Predicate for having a stored address.

All non-empty references have a computable address, but an address can also be stored explicitly. This predicate returns true when an address is stored explicitly.

◆ address()

rose_addr_t Rose::BinaryAnalysis::Partitioner2::Reference::address ( ) const

Address.

All non-empty references have either an explicitly stored address or an address that can be obtained from an instruction, basic block, or function. This method returns the first address found from that list.

◆ operator==()

bool Rose::BinaryAnalysis::Partitioner2::Reference::operator== ( const Reference other) const

Whether two references are equal.

Two references are equal if they are both empty, or else if they have the same address and granularity.

◆ operator<()

bool Rose::BinaryAnalysis::Partitioner2::Reference::operator< ( const Reference other) const

Compare two references.

Returns true when this reference is less than the other reference. The empty reference is less than all non-empty references. A non-empty reference is less than or greater than another non-empty reference if its address is less than or greater than the other reference's address. When two references have the same address then the finer granularity reference is less than the coarser reference.


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