本文整理汇总了C++中Outbuffer::write方法的典型用法代码示例。如果您正苦于以下问题:C++ Outbuffer::write方法的具体用法?C++ Outbuffer::write怎么用?C++ Outbuffer::write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Outbuffer
的用法示例。
在下文中一共展示了Outbuffer::write方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cv8_writeLexicalScope
/******************************************
* write lexical scope records up to the line where the symbol sa is created
* if sa == NULL, flush all remaining records
*/
void cv8_writeLexicalScope(Funcsym *s, symbol *sa, VarStatistics* vs)
{
if (vs->cntUsedVarStats == 0)
return;
unsigned line;
if(sa)
{
line = sa->lnoscopestart + 1;
}
else
{
// flush all
line = vs->firstVarStatsLine + vs->cntUsedVarStats;
}
while (vs->nextVarStatsLine < line && vs->nextVarStatsLine < vs->firstVarStatsLine + vs->cntUsedVarStats)
{
Outbuffer *buf = currentfuncdata.f1buf;
unsigned idx = vs->nextVarStatsLine - vs->firstVarStatsLine;
for(int d = 0; d < vs->varStats[idx].numDel; d++)
{
static unsigned short s_end[] = { 2, S_END };
buf->write(s_end, sizeof(s_end));
}
for(int n = 0; n < vs->varStats[idx].numNew; n++)
{
unsigned offset = vs->varStats[idx].offset;
unsigned length = vs->varStats[vs->varStats[idx].endLine - vs->firstVarStatsLine].offset - offset;
unsigned soffset = buf->size();
// parent and end to be filled by linker
block_v3_data block32 = { sizeof(block_v3_data) - 2, S_BLOCK_V3, 0, 0, length, offset, 0, { 0 } };
buf->write(&block32, sizeof(block32));
size_t offOffset = (char*)&block32.offset - (char*)&block32;
F1_Fixups f1f;
f1f.s = s;
f1f.offset = soffset + offOffset;
f1f.value = offset;
currentfuncdata.f1fixup->write(&f1f, sizeof(f1f));
}
vs->nextVarStatsLine++;
}
}