本文整理汇总了C++中StringExp::writeTo方法的典型用法代码示例。如果您正苦于以下问题:C++ StringExp::writeTo方法的具体用法?C++ StringExp::writeTo怎么用?C++ StringExp::writeTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringExp
的用法示例。
在下文中一共展示了StringExp::writeTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visit
void visit(PragmaDeclaration *pd)
{
if (pd->ident == Id::lib)
{
assert(pd->args && pd->args->dim == 1);
Expression *e = (*pd->args)[0];
assert(e->op == TOKstring);
StringExp *se = (StringExp *)e;
char *name = (char *)mem.xmalloc(se->numberOfCodeUnits() + 1);
se->writeTo(name, true);
/* Embed the library names into the object file.
* The linker will then automatically
* search that library, too.
*/
if (!obj_includelib(name))
{
/* The format does not allow embedded library names,
* so instead append the library name to the list to be passed
* to the linker.
*/
global.params.libfiles->push(name);
}
}
else if (pd->ident == Id::startaddress)
{
assert(pd->args && pd->args->dim == 1);
Expression *e = (*pd->args)[0];
Dsymbol *sa = getDsymbol(e);
FuncDeclaration *f = sa->isFuncDeclaration();
assert(f);
Symbol *s = toSymbol(f);
obj_startaddress(s);
}
visit((AttribDeclaration *)pd);
}