本文整理汇总了C++中SgVarRefExp::copy方法的典型用法代码示例。如果您正苦于以下问题:C++ SgVarRefExp::copy方法的具体用法?C++ SgVarRefExp::copy怎么用?C++ SgVarRefExp::copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SgVarRefExp
的用法示例。
在下文中一共展示了SgVarRefExp::copy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: partialRedundancyEliminationOne
//.........这里部分代码省略.........
bool failAtEndOfFunction = false;
for (j = cfg.graph.edges().begin(); j != jend; ++j)
{
// printf ("Build the insertion list! count = %d \n",count++);
if (edge_insert[*j])
{
#if 0
// DQ (3/13/2006): Compiler warns that "src" is unused, so I have commented it out!
Vertex src = cfg.graph.source(*j), tgt = cfg.graph.target(*j);
cerr << "Doing insertion between " << src << " and " << tgt << endl;
#endif
pair<SgNode*, bool> insert_point = cfg.edge_insertion_point[*j];
if (insert_point.first)
{
insertions.push_back(insert_point);
}
else
{
// DQ (3/16/2006): This is a visited when we fixup the NULL pointer to the initializer in a SgForStatment.
cerr << "Warning: no insertion point found" << endl; //FIXME was assert
printf ("Need to figure out what to do here! cfg.edge_insertion_point[*j] = %p \n",&(cfg.edge_insertion_point[*j]));
failAtEndOfFunction = true;
ROSE_ASSERT(false);
}
}
}
// Do within-node insertions
// printf ("At start of loop: insertions.size() = %zu \n",insertions.size());
for (vector<pair<SgNode*, bool> >::iterator i = insertions.begin(); i != insertions.end(); ++i)
{
SgTreeCopy tc1, tc2;
SgVarRefExp* cachevarCopy = isSgVarRefExp(cachevar->copy(tc1));
ROSE_ASSERT (cachevarCopy);
cachevarCopy->set_lvalue(true);
SgExpression* operation = new SgAssignOp(SgNULL_FILE, cachevarCopy, isSgExpression(expr->copy(tc2)));
#if 0
printf ("Inside of loop: insertions.size() = %zu \n",insertions.size());
printf ("\n\ni->first = %p = %s = %s \n",i->first,i->first->class_name().c_str(),i->first->unparseToString().c_str());
printf ("operation = %p = %s = %s \n",operation,operation->class_name().c_str(),operation->unparseToString().c_str());
#endif
if (isSgExpression(i->first) && !i->second)
{
SgNode* ifp = i->first->get_parent();
SgCommaOpExp* comma = new SgCommaOpExp(SgNULL_FILE, isSgExpression(i->first), operation);
operation->set_parent(comma);
comma->set_parent(ifp);
i->first->set_parent(comma);
if (isSgForStatement(ifp))
{
isSgForStatement(ifp)->set_increment(comma);
}
else if (isSgBinaryOp(ifp) && isSgBinaryOp(ifp)->get_lhs_operand() == i->first)
{
isSgBinaryOp(ifp)->set_lhs_operand(comma);
}
else if (isSgBinaryOp(ifp) && isSgBinaryOp(ifp)->get_rhs_operand() == i->first)
{
isSgBinaryOp(ifp)->set_rhs_operand(comma);
}
else if (isSgUnaryOp(ifp) && isSgUnaryOp(ifp)->get_operand() == i->first)
{
isSgUnaryOp(ifp)->set_operand(comma);
}
else