本文整理汇总了C++中StringPrintStream::length方法的典型用法代码示例。如果您正苦于以下问题:C++ StringPrintStream::length方法的具体用法?C++ StringPrintStream::length怎么用?C++ StringPrintStream::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringPrintStream
的用法示例。
在下文中一共展示了StringPrintStream::length方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: logRegisterPressure
void logRegisterPressure(Code& code)
{
const unsigned totalColumns = 200;
const unsigned registerColumns = 100;
RegLiveness liveness(code);
for (BasicBlock* block : code) {
RegLiveness::LocalCalc localCalc(liveness, block);
block->dumpHeader(WTF::dataFile());
Vector<CString> instDumps;
for (unsigned instIndex = block->size(); instIndex--;) {
Inst& inst = block->at(instIndex);
Inst* prevInst = block->get(instIndex - 1);
localCalc.execute(instIndex);
RegisterSet set;
set.setAll(localCalc.live());
Inst::forEachDefWithExtraClobberedRegs<Reg>(
prevInst, &inst,
[&] (Reg reg, Arg::Role, Arg::Type, Arg::Width) {
set.set(reg);
});
StringPrintStream instOut;
StringPrintStream lineOut;
lineOut.print(" ");
if (set.numberOfSetRegisters()) {
set.forEach(
[&] (Reg reg) {
CString text = toCString(" ", reg);
if (text.length() + lineOut.length() > totalColumns) {
instOut.print(lineOut.toCString(), "\n");
lineOut.reset();
lineOut.print(" ");
}
lineOut.print(text);
});
lineOut.print(":");
}
if (lineOut.length() > registerColumns) {
instOut.print(lineOut.toCString(), "\n");
lineOut.reset();
}
while (lineOut.length() < registerColumns)
lineOut.print(" ");
lineOut.print(" ");
lineOut.print(inst);
instOut.print(lineOut.toCString(), "\n");
instDumps.append(instOut.toCString());
}
for (unsigned i = instDumps.size(); i--;)
dataLog(instDumps[i]);
block->dumpFooter(WTF::dataFile());
}
}