コード例 #1
0
 bool operator()(const ControlFlowGraph &cfg, const ControlFlowGraph::ConstEdgeIterator &callEdge, size_t depth) {
     if (depth > partitioner.stackDeltaInterproceduralLimit())
         return false;
     ASSERT_require(callEdge != cfg.edges().end());
     ASSERT_require(callEdge->target()->value().type() == V_BASIC_BLOCK);
     Function::Ptr function = callEdge->target()->value().function();
     return function && !function->stackDelta().getOptional().orDefault();
 }
コード例 #2
0
// Internal: Is edge significant for may-return analysis?
// + Function call edges are never significant (a return from a function call does not mean that the calling function also
//   returns.
// + A self edge is not significant; it doesn't change the result of the analysis
// + Call-ret edges are significant only if at least one of the sibling function calls returns or if any of the sibling
//   function calls has an indeterminate may-return.
// + Other edges are significant, including E_FUNCTION_XFER edges.
bool
Partitioner::mayReturnIsSignificantEdge(const ControlFlowGraph::ConstEdgeIterator &edge,
                                        std::vector<MayReturnVertexInfo> &vertexInfo) const {
    if (edge == cfg_.edges().end())
        return false;
    if (edge->value().type() == E_FUNCTION_CALL)
        return false;
    if (edge->target() == edge->source())
        return false;
    if (edge->value().type() == E_CALL_RETURN) {
        boost::logic::tribool tb = mayReturnDoesCalleeReturn(edge->source(), vertexInfo);
        return tb || boost::logic::indeterminate(tb);
    }
    return true;
}
コード例 #3
0
ファイル: Utility.C プロジェクト: GoblinInventor/rose-develop
bool
sortEdgesByDst(const ControlFlowGraph::ConstEdgeIterator &a,
               const ControlFlowGraph::ConstEdgeIterator &b) {
    return sortVerticesByAddress(a->target(), b->target());
}