本文整理汇总了C++中Expression::doInline方法的典型用法代码示例。如果您正苦于以下问题:C++ Expression::doInline方法的具体用法?C++ Expression::doInline怎么用?C++ Expression::doInline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Expression
的用法示例。
在下文中一共展示了Expression::doInline方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
Expression *DeclarationExp::doInline(InlineDoState *ids)
{ DeclarationExp *de = (DeclarationExp *)copy();
VarDeclaration *vd;
//printf("DeclarationExp::doInline(%s)\n", toChars());
vd = declaration->isVarDeclaration();
if (vd)
{
#if 0
// Need to figure this out before inlining can work for tuples
TupleDeclaration *td = vd->toAlias()->isTupleDeclaration();
if (td)
{
for (size_t i = 0; i < td->objects->dim; i++)
{ DsymbolExp *se = (*td->objects)[i];
assert(se->op == TOKdsymbol);
se->s;
}
return st->objects->dim;
}
#endif
if (vd->isStatic())
;
else
{
VarDeclaration *vto;
vto = new VarDeclaration(vd->loc, vd->type, vd->ident, vd->init);
*vto = *vd;
vto->parent = ids->parent;
#if IN_DMD
vto->csym = NULL;
vto->isym = NULL;
#endif
ids->from.push(vd);
ids->to.push(vto);
if (vd->init)
{
if (vd->init->isVoidInitializer())
{
vto->init = new VoidInitializer(vd->init->loc);
}
else
{
Expression *e = vd->init->toExpression();
assert(e);
vto->init = new ExpInitializer(e->loc, e->doInline(ids));
}
}
de->declaration = (Dsymbol *) (void *)vto;
}
}
/* This needs work, like DeclarationExp::toElem(), if we are
* to handle TemplateMixin's. For now, we just don't inline them.
*/
return de;
}
示例2: Expressions
Expressions *arrayExpressiondoInline(Expressions *a, InlineDoState *ids)
{ Expressions *newa = NULL;
if (a)
{
newa = new Expressions();
newa->setDim(a->dim);
for (size_t i = 0; i < a->dim; i++)
{ Expression *e = (*a)[i];
if (e)
e = e->doInline(ids);
(*newa)[i] = e;
}
}
return newa;
}
示例3: Expressions
Expressions *arrayExpressiondoInline(Expressions *a, InlineDoState *ids)
{ Expressions *newa = NULL;
if (a)
{
newa = new Expressions();
newa->setDim(a->dim);
for (int i = 0; i < a->dim; i++)
{ Expression *e = (Expression *)a->data[i];
if (e)
{
e = e->doInline(ids);
newa->data[i] = (void *)e;
}
}
}
return newa;
}
示例4: assert
Expression *DeclarationExp::doInline(InlineDoState *ids)
{
//printf("DeclarationExp::doInline(%s)\n", toChars());
VarDeclaration *vd = declaration->isVarDeclaration();
if (vd)
{
#if 0
// Need to figure this out before inlining can work for tuples
TupleDeclaration *td = vd->toAlias()->isTupleDeclaration();
if (td)
{
for (size_t i = 0; i < td->objects->dim; i++)
{ DsymbolExp *se = (*td->objects)[i];
assert(se->op == TOKdsymbol);
se->s;
}
return st->objects->dim;
}
#endif
if (vd->isStatic())
;
else
{
VarDeclaration *vto;
if (ids->fd && vd == ids->fd->nrvo_var)
{
for (size_t i = 0; i < ids->from.dim; i++)
{
if (vd == ids->from[i])
{
vto = (VarDeclaration *)ids->to[i];
Expression *e;
if (vd->init && !vd->init->isVoidInitializer())
{
e = vd->init->toExpression();
assert(e);
e = e->doInline(ids);
}
else
e = new IntegerExp(vd->init->loc, 0, Type::tint32);
return e;
}
}
}
vto = new VarDeclaration(vd->loc, vd->type, vd->ident, vd->init);
memcpy((void *)vto, (void *)vd, sizeof(VarDeclaration));
vto->parent = ids->parent;
vto->csym = NULL;
vto->isym = NULL;
ids->from.push(vd);
ids->to.push(vto);
L1:
if (vd->init)
{
if (vd->init->isVoidInitializer())
{
vto->init = new VoidInitializer(vd->init->loc);
}
else
{
Expression *e = vd->init->toExpression();
assert(e);
vto->init = new ExpInitializer(e->loc, e->doInline(ids));
}
}
DeclarationExp *de = (DeclarationExp *)copy();
de->declaration = (Dsymbol *) (void *)vto;
return de;
}
}
/* This needs work, like DeclarationExp::toElem(), if we are
* to handle TemplateMixin's. For now, we just don't inline them.
*/
return Expression::doInline(ids);
}