1 #ifndef ROSE_BinaryAnalysis_ReturnValueUsed_H
2 #define ROSE_BinaryAnalysis_ReturnValueUsed_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
6 #include <Partitioner2/BasicTypes.h>
7 #include <Partitioner2/ControlFlowGraph.h>
15 namespace ReturnValueUsed {
33 std::vector<Partitioner2::Function::Ptr> callees_;
37 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
39 friend class boost::serialization::access;
42 void serialize(S & s,
const unsigned ) {
43 s & BOOST_SERIALIZATION_NVP(didConverge_);
44 s & BOOST_SERIALIZATION_NVP(callees_);
45 s & BOOST_SERIALIZATION_NVP(returnRegistersUsed_);
46 s & BOOST_SERIALIZATION_NVP(returnRegistersUnused_);
52 : didConverge_(
false) {}
66 const std::vector<Partitioner2::Function::Ptr>
callees()
const {
return callees_; }
90 void callees(
const std::vector<Partitioner2::Function::Ptr> &functions) { callees_ = functions; }
103 CallSiteMap callSites_;
104 bool assumeCallerReturnsValue_;
106 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
108 friend class boost::serialization::access;
111 void serialize(S &s,
const unsigned ) {
112 s & BOOST_SERIALIZATION_NVP(defaultCallingConvention_);
113 s & BOOST_SERIALIZATION_NVP(callSites_);
114 s & BOOST_SERIALIZATION_NVP(assumeCallerReturnsValue_);
125 : assumeCallerReturnsValue_(true) {}
188 std::vector<Partitioner2::Function::Ptr>
193 std::vector<Partitioner2::ControlFlowGraph::ConstVertexIterator>
194 findReturnTargets(
const Partitioner2::Partitioner&,
const Partitioner2::ControlFlowGraph::ConstVertexIterator &callSite);
RegisterParts & returnRegistersUnused()
Property: Return registers that are unused in the caller.
const RegisterParts & returnRegistersUnused() const
Property: Return registers that are unused in the caller.
CallingConvention::Definition::Ptr defaultCallingConvention() const
Property: Default calling convention.
CallSiteResults analyzeCallSite(const Partitioner2::Partitioner &, const Partitioner2::ControlFlowGraph::ConstVertexIterator &)
Analyze a call site to see if a function's return value is used.
void initDiagnostics()
Initialize diagnostics.
Main namespace for the ROSE library.
Holds a set of registers without regard for register boundaries.
const std::vector< Partitioner2::Function::Ptr > callees() const
Property: Functions called at this site.
Sawyer::Message::Facility mlog
Facility for diagnostic output.
void clearResults()
Clear analysis results.
RegisterParts & returnRegistersUsed()
Property: Return registers that are used in the caller.
bool assumeCallerReturnsValue() const
Property: Assume caller returns value(s).
bool didConverge() const
Property: Did the analysis converge to a solution.
void defaultCallingConvention(const CallingConvention::Definition::Ptr &defn)
Property: Default calling convention.
Analysis()
Default constructor.
const RegisterParts & returnRegistersUsed() const
Property: Return registers that are used in the caller.
void returnRegistersUnused(const RegisterParts ®s)
Property: Return registers that are unused in the caller.
void returnRegistersUsed(const RegisterParts ®s)
Property: Return registers that are used in the caller.
void assumeCallerReturnsValue(bool b)
Property: Assume caller returns value(s).
void didConverge(bool b)
Property: Did the analysis converge to a solution.
Partitions instructions into basic blocks and functions.
Container associating values with keys.