本文整理汇总了C++中PEdge::AsCall方法的典型用法代码示例。如果您正苦于以下问题:C++ PEdge::AsCall方法的具体用法?C++ PEdge::AsCall怎么用?C++ PEdge::AsCall使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEdge
的用法示例。
在下文中一共展示了PEdge::AsCall方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintUI
void WherePostcondition::PrintUI(OutStream &out) const
{
PEdge *edge = m_frame->CFG()->GetSingleOutgoingEdge(m_point);
Location *loc = m_frame->CFG()->GetPointLocation(m_point);
if (edge->IsLoop()) {
const char *loop_name = edge->AsLoop()->GetLoopId()->LoopName();
out << "LoopInvariant [" << loop_name << "]";
}
else {
out << "Postcondition [";
PEdgeCall *nedge = edge->AsCall();
Exp *function = nedge->GetFunction();
function->PrintUI(out, true);
out << ":" << loc->Line() << "]";
}
if (m_bit) {
Bit *new_bit = BitConvertExitClobber(m_bit);
out << " :: ";
new_bit->PrintUI(out, true);
new_bit->DecRef();
}
}
示例2: PrintHook
void WherePostcondition::PrintHook(OutStream &out) const
{
BlockId *id = m_frame->CFG()->GetId();
Variable *func_var = id->BaseVar();
PEdge *edge = m_frame->CFG()->GetSingleOutgoingEdge(m_point);
if (edge->IsLoop()) {
PEdgeLoop *nedge = edge->AsLoop();
out << nedge->GetLoopId()->Loop()->Value() << " "
<< func_var->GetName()->Value();
}
else {
PEdgeCall *nedge = edge->AsCall();
if (Variable *callee = nedge->GetDirectFunction()) {
// direct call, just one hook function.
out << "post " << callee->GetName()->Value();
}
else {
// indirect call, one hook function for each callee.
CallEdgeSet *callees = CalleeCache.Lookup(func_var);
bool found_callee = false;
if (callees) {
for (size_t eind = 0; eind < callees->GetEdgeCount(); eind++) {
const CallEdge &edge = callees->GetEdge(eind);
if (edge.where.id == id && edge.where.point == m_point) {
if (found_callee)
out << "$"; // add the separator
found_callee = true;
out << "post " << edge.callee->GetName()->Value();
}
}
}
CalleeCache.Release(func_var);
}
}
}