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

Description

Binary inliner.

This binary inliner builds a new CFG (called here the paths graph) from a master CFG. The paths graph initially contains some vertices that correspond to a function call site in the master CFG, and this inliner will copy part of the master CFG corresponding to the called function into the paths graph.

When a function is copied from the master CFG to the paths graph, only those edges in the called function that participate in some path from the entry vertex to a returning vertex are copied. Usually a call site will call a single function, but an indirect call (e.g., x86 call eax) could have calls to multiple functions, and/or the special indeterminate vertex (e.g., depending on whether anything is known about eax in call eax). Once all the functions called from a call site are inlined, the E_CALL_RETURN edge is removed from that vertex.

The inliner has an optional list of blacklisted vertices and edges. These vertices and edges cannot appear in any path.

A user-defined predicate determines whether a function call should be inlined or skipped.

Definition at line 468 of file CfgPath.h.

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

Classes

class  ShouldInline
 Predicate to determine whether inlining should be performed. More...
 

Public Types

enum  HowInline {
  INLINE_NONE,
  INLINE_NORMAL,
  INLINE_USER
}
 What action to take for inlining. More...
 

Public Member Functions

 Inliner ()
 Default constructor. More...
 
void inlinePaths (const PartitionerConstPtr &partitioner, const CfgConstVertexSet &cfgBeginVertices, const CfgConstVertexSet &cfgEndVertices, const CfgConstVertexSet &cfgAvoidVertices, const CfgConstEdgeSet &cfgAvoidEdges)
 Construct a CFG with inlined functions. More...
 
const ControlFlowGraphpaths () const
 Resulting paths graph. More...
 
const CfgConstVertexSetpathsBeginVertices () const
 Paths begin vertices. More...
 
const CfgConstVertexSetpathsEndVertices () const
 Paths end vertices. More...
 
ShouldInline::Ptr shouldInline () const
 Property: inline predicate. More...
 
void shouldInline (const ShouldInline::Ptr &p)
 Property: inline predicate. More...
 

Member Enumeration Documentation

What action to take for inlining.

Enumerator
INLINE_NONE 

Do not inline anything for this call.

INLINE_NORMAL 

Normal inlining for this call.

INLINE_USER 

Add a V_USER_DEFINED vertex for this call.

Definition at line 472 of file CfgPath.h.

Constructor & Destructor Documentation

Rose::BinaryAnalysis::Partitioner2::Inliner::Inliner ( )
inline

Default constructor.

This inliner is configured to inline functions to a certain maximum depth.

Definition at line 526 of file CfgPath.h.

Member Function Documentation

ShouldInline::Ptr Rose::BinaryAnalysis::Partitioner2::Inliner::shouldInline ( ) const
inline

Property: inline predicate.

User predicate that controls whether a particular function should be inlined. If null, then all function calls are inlined.

Definition at line 535 of file CfgPath.h.

void Rose::BinaryAnalysis::Partitioner2::Inliner::shouldInline ( const ShouldInline::Ptr p)
inline

Property: inline predicate.

User predicate that controls whether a particular function should be inlined. If null, then all function calls are inlined.

Definition at line 536 of file CfgPath.h.

void Rose::BinaryAnalysis::Partitioner2::Inliner::inlinePaths ( const PartitionerConstPtr partitioner,
const CfgConstVertexSet cfgBeginVertices,
const CfgConstVertexSet cfgEndVertices,
const CfgConstVertexSet cfgAvoidVertices,
const CfgConstEdgeSet cfgAvoidEdges 
)

Construct a CFG with inlined functions.

Computes paths in the partitioner's global CFG from cfgBeginVertices to cfgEndVertices that do not pass through cfgAvoidVertices or cfgAvoidEdges. Any function calls along these paths are then inlined, but only those paths through the function that don't pass through the cfgAvoidVertices or cfgAvoidEdges. The return value of the shouldInline property callback determines whether a function is inlined or summarized.

Returns the resulting control flow graph, a.k.a., the paths graph.

const ControlFlowGraph& Rose::BinaryAnalysis::Partitioner2::Inliner::paths ( ) const
inline

Resulting paths graph.

Returns the paths graph that resulted from inlining.

Definition at line 554 of file CfgPath.h.

const CfgConstVertexSet& Rose::BinaryAnalysis::Partitioner2::Inliner::pathsBeginVertices ( ) const
inline

Paths begin vertices.

This is the set of vertices corresponding to the cfgBeginVertices of the inlinePaths function. Only those CFG vertices that are part of a path are in this set.

Definition at line 560 of file CfgPath.h.

const CfgConstVertexSet& Rose::BinaryAnalysis::Partitioner2::Inliner::pathsEndVertices ( ) const
inline

Paths end vertices.

This is the set of vertices corresponding to the cfgEndVertices of the inlinePaths function. Only those CFG vertices that are part of a path are in this set.

Definition at line 566 of file CfgPath.h.


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