ROSE  0.9.9.109
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Rose::BinaryAnalysis::Partitioner2::AstConstructionSettings Struct Reference

Description

Settings that control building the AST.

The runtime descriptions and command-line parser for these switches can be obtained from astConstructionSwitches.

Definition at line 69 of file BasicTypes.h.

#include <BasicTypes.h>

Public Member Functions

 AstConstructionSettings ()
 Default constructor. More...
 

Static Public Member Functions

static AstConstructionSettings strict ()
 Default strict settings. More...
 
static AstConstructionSettings permissive ()
 Default permissive settings. More...
 

Public Attributes

bool allowEmptyGlobalBlock
 Whether to allow an empty global block. More...
 
bool allowFunctionWithNoBasicBlocks
 Whether to allow functions with no basic blocks. More...
 
bool allowEmptyBasicBlocks
 Whether to allow a basic block to be empty. More...
 
bool copyAllInstructions
 Whether to allow shared instructions in the AST. More...
 

Constructor & Destructor Documentation

Rose::BinaryAnalysis::Partitioner2::AstConstructionSettings::AstConstructionSettings ( )
inline

Default constructor.

Definition at line 114 of file BasicTypes.h.

Member Function Documentation

static AstConstructionSettings Rose::BinaryAnalysis::Partitioner2::AstConstructionSettings::strict ( )
inlinestatic

Default strict settings.

These settings try to construct an AST that will work with all old AST-based analyses. Some information represented in the partitioner might not be copied into the AST.

Definition at line 122 of file BasicTypes.h.

References allowEmptyBasicBlocks, allowEmptyGlobalBlock, allowFunctionWithNoBasicBlocks, and copyAllInstructions.

static AstConstructionSettings Rose::BinaryAnalysis::Partitioner2::AstConstructionSettings::permissive ( )
inlinestatic

Default permissive settings.

These settings allow as much of the partitioner's information as possible to be copied into the AST even if it means that AST might violate some invariants that are expected by old analyses. For instance, it will allow creation of a basic block with no instructions if the block exists at a virtual addresses that could not be disassembled.

Definition at line 136 of file BasicTypes.h.

References allowEmptyBasicBlocks, allowEmptyGlobalBlock, allowFunctionWithNoBasicBlocks, and copyAllInstructions.

Member Data Documentation

bool Rose::BinaryAnalysis::Partitioner2::AstConstructionSettings::allowEmptyGlobalBlock

Whether to allow an empty global block.

If the partitioner contains no functions then either create an empty global block (top-level SgAsmBlock) when this setting is true, or return a null global block pointer when this setting is false.

Definition at line 74 of file BasicTypes.h.

Referenced by permissive(), and strict().

bool Rose::BinaryAnalysis::Partitioner2::AstConstructionSettings::allowFunctionWithNoBasicBlocks

Whether to allow functions with no basic blocks.

If the the partitioner knows about a function but was unable to produce any basic blocks then we have two choices for constructing the SgAsmFunction node in the AST: if this setting is true, then create a function node with no SgAsmBlock children; otherwise return a null pointer and do not add ths function to the AST.

Definition at line 81 of file BasicTypes.h.

Referenced by permissive(), and strict().

bool Rose::BinaryAnalysis::Partitioner2::AstConstructionSettings::allowEmptyBasicBlocks

Whether to allow a basic block to be empty.

If the partitioner contains a basic block with no instructions, such as a block whose starting address is not mapped, then we have two choices when creating the corresponding SgAsmBlock node in the AST: if this setting is true, then create a basic block with no SgAsmInstruction children; otherwise return a null pointer and do not add the basic block to the AST.

Definition at line 89 of file BasicTypes.h.

Referenced by permissive(), and strict().

bool Rose::BinaryAnalysis::Partitioner2::AstConstructionSettings::copyAllInstructions

Whether to allow shared instructions in the AST.

This setting controls how an instruction that is shared between two or more functions by virtue of its basic block being part of both functions is represented in the AST. If this setting is true, instruction ASTs (rooted at SgAsmInstruction) are deep-copied into the AST at each place they occur.

The partitioner allows an instruction to be shared by two or functions by virtue of the instruction's basic block being shared by those functions. If the copying is not performed then the AST will no longer be a tree (it will be a lattice) but each instruction can point to only one parent basic block (chosen arbitrarily). Thus, a depth-first traversal of the AST will find the same SgAsmInstruction node more than once, yet following the instruction's parent pointer will always return the same basic block.

Definition at line 102 of file BasicTypes.h.

Referenced by permissive(), and strict().


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