本文整理汇总了C++中Statement::doInlineStatement方法的典型用法代码示例。如果您正苦于以下问题:C++ Statement::doInlineStatement方法的具体用法?C++ Statement::doInlineStatement怎么用?C++ Statement::doInlineStatement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Statement
的用法示例。
在下文中一共展示了Statement::doInlineStatement方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CompoundStatement
Statement *CompoundStatement::doInlineStatement(InlineDoState *ids)
{
//printf("CompoundStatement::doInlineStatement() %d\n", statements->dim);
Statements *as = new Statements();
as->reserve(statements->dim);
for (size_t i = 0; i < statements->dim; i++)
{ Statement *s = (*statements)[i];
if (s)
{
as->push(s->doInlineStatement(ids));
if (s->isReturnStatement())
break;
/* Check for:
* if (condition)
* return exp1;
* else
* return exp2;
*/
IfStatement *ifs = s->isIfStatement();
if (ifs && ifs->elsebody && ifs->ifbody &&
ifs->ifbody->isReturnStatement() &&
ifs->elsebody->isReturnStatement()
)
break;
}
else
as->push(NULL);
}
return new CompoundStatement(loc, as);
}
示例2: UnrolledLoopStatement
Statement *UnrolledLoopStatement::doInlineStatement(InlineDoState *ids)
{
//printf("UnrolledLoopStatement::doInlineStatement() %d\n", statements->dim);
Statements *as = new Statements();
as->reserve(statements->dim);
for (size_t i = 0; i < statements->dim; i++)
{ Statement *s = (*statements)[i];
if (s)
{
as->push(s->doInlineStatement(ids));
if (ids->foundReturn)
break;
}
else
as->push(NULL);
}
return new UnrolledLoopStatement(loc, as);
}