1#ifndef ROSE_BinaryAnalysis_Partitioner2_Function_H
2#define ROSE_BinaryAnalysis_Partitioner2_Function_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
5#include <Rose/BinaryAnalysis/Partitioner2/BasicTypes.h>
7#include <Rose/BinaryAnalysis/CallingConvention/Analysis.h>
8#include <Rose/BinaryAnalysis/CallingConvention/Definition.h>
9#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics.h>
10#include <Rose/BinaryAnalysis/StackDelta.h>
11#include <Rose/SourceLocation.h>
13#include <Sawyer/Attribute.h>
14#include <Sawyer/Cached.h>
15#include <Sawyer/Map.h>
16#include <Sawyer/Set.h>
17#include <Sawyer/SharedPointer.h>
19#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
20#include <boost/serialization/access.hpp>
24namespace BinaryAnalysis {
25namespace Partitioner2 {
55 std::string demangledName_;
58 std::string reasonComment_;
59 std::set<rose_addr_t> bblockVas_;
60 std::vector<DataBlockPtr> dblocks_;
77#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
79 friend class boost::serialization::access;
80 template<
class S>
void serialize(S&,
unsigned version);
112 const std::string&
name()
const;
Function calling convention.
void comment(const std::string &)
Property: Optional function comment.
void eraseBasicBlock(rose_addr_t bblockVa)
Remove a basic block from this function.
std::string printableName() const
A printable name for the function.
void reasonComment(const std::string &)
Property: Additional comment for why function was detected.
void sourceLocation(const SourceLocation &)
Property: Location of function definition in source code, if known.
FunctionPtr Ptr
Shared-ownership pointer for function.
AddressIntervalSet dataAddresses() const
Addresses that are part of static data.
rose_addr_t address() const
Read-only property: Entry address.
Ownership
Manner in which a function owns a block.
@ OWN_UNOWNED
Function does not own the block.
@ OWN_EXPLICIT
Function owns the block explicitly, the normal ownership.
@ OWN_PROVISIONAL
Function might own the block in the future.
bool insertDataBlock(const DataBlockPtr &)
Add a data block to this function.
void stackDeltaOverride(const InstructionSemantics::BaseSemantics::SValuePtr &delta)
Property: Stack delta override.
const std::string & reasonComment() const
Property: Additional comment for why function was detected.
bool isThunk() const
True if function is a thunk.
static Ptr instance(rose_addr_t entryVa, unsigned reasons)
Static allocating constructor.
const SourceLocation & sourceLocation() const
Property: Location of function definition in source code, if known.
const Sawyer::Cached< bool > & isNoop() const
Cached results of function no-op analysis.
const std::string & name() const
Property: Optional function name.
void insertReasons(unsigned reasons)
Insert additional function reason bits.
void demangledName(const std::string &)
Property: Optional demangled name.
void callingConventionDefinition(const CallingConvention::DefinitionPtr &)
Property: Best calling convention definition.
size_t nDataBlocks() const
Number of data blocks in the function.
CallingConvention::Analysis & callingConventionAnalysis()
Property: Calling convention analysis results.
size_t nBasicBlocks() const
Number of basic blocks in the function.
void reasons(unsigned)
Property: Bit vector of function reasons.
const std::string & demangledName() const
Property: Optional demangled name.
void eraseReasons(unsigned reasons)
Remove function reason bits.
const std::vector< DataBlockPtr > & dataBlocks() const
Returns data blocks owned by this function.
DataBlockPtr eraseDataBlock(const DataBlockPtr &)
Remove specified or equivalent data block from this function.
const std::string & comment() const
Property: Optional function comment.
CallingConvention::DefinitionPtr callingConventionDefinition()
Property: Best calling convention definition.
const std::set< rose_addr_t > & basicBlockAddresses() const
Returns basic block addresses.
unsigned reasons() const
Property: Bit vector of function reasons.
static Ptr instance(rose_addr_t entryVa, const std::string &name="", unsigned reasons=0)
Static allocating constructor.
DataBlockPtr dataBlockExists(const DataBlockPtr &) const
Determine if this function contains the specified data block, or equivalent.
bool ownsBasicBlock(rose_addr_t bblockVa) const
Predicate to test whether a function owns a basic block address.
StackDelta::Analysis & stackDeltaAnalysis()
Property: Stack delta analysis results.
InstructionSemantics::BaseSemantics::SValuePtr stackDelta() const
Property: Stack delta.
int64_t stackDeltaConcrete() const
Property: Stack delta.
InstructionSemantics::BaseSemantics::SValuePtr stackDeltaOverride() const
Property: Stack delta override.
bool isFrozen() const
Determines whether a function is frozen.
void name(const std::string &)
Property: Optional function name.
const StackDelta::Analysis & stackDeltaAnalysis() const
Property: Stack delta analysis results.
bool insertBasicBlock(rose_addr_t bblockVa)
Add a basic block to this function.
const CallingConvention::Analysis & callingConventionAnalysis() const
Property: Calling convention analysis results.
Partitions instructions into basic blocks and functions.
Information about a source location.
API and storage for attributes.
Implements cache data members.
void clear() const
Remove cached value.
Base class for reference counted objects.
Reference-counting intrusive smart pointer.
Sawyer::SharedPointer< Function > FunctionPtr
Shared-ownership pointer for Function.