本文整理汇总了C++中AsmPrinter::GetTempSymbol方法的典型用法代码示例。如果您正苦于以下问题:C++ AsmPrinter::GetTempSymbol方法的具体用法?C++ AsmPrinter::GetTempSymbol怎么用?C++ AsmPrinter::GetTempSymbol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AsmPrinter
的用法示例。
在下文中一共展示了AsmPrinter::GetTempSymbol方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: finishAssembly
//.........这里部分代码省略.........
// safe point.
const ConstantArray * fieldOffsetArray = cast<ConstantArray>(
fieldOffsetsVar->getInitializer());
for (ConstantArray::const_op_iterator el = fieldOffsetArray->op_begin();
el != fieldOffsetArray->op_end(); ++el) {
fieldOffsets.push_back(
offset + dscOffset + toInt(cast<llvm::Constant>(*el), AP.TM));
}
}
}
}
} else {
// No metadata, so it's an object reference - just add the field offset.
fieldOffsets.push_back(offset);
}
}
// Nothing to trace? Then we're done.
if (fieldOffsets.empty() && traceMethods.empty()) {
continue;
}
// Create a folding set node and merge with any identical trace tables.
std::sort(fieldOffsets.begin(), fieldOffsets.end());
llvm::FoldingSetNodeID id;
StackTraceTable::ProfileEntries(id, fieldOffsets, traceMethods);
void * insertPos;
StackTraceTable * sTable = traceTables.FindNodeOrInsertPos(id, insertPos);
if (sTable == NULL) {
sTable = new StackTraceTable(fieldOffsets, traceMethods);
// Generate the labels for the trace table and field offset table.
sTable->fieldOffsetsLabel = AP.GetTempSymbol("gc_stack_offsets", nextLabel);
sTable->traceTableLabel = AP.GetTempSymbol("gc_stack", nextLabel++);
// Add to folding set
traceTables.InsertNode(sTable, insertPos);
// Generate the trace table
outStream.AddBlankLine();
AP.EmitAlignment(addressAlignLog);
// First the field offset descriptor
outStream.EmitLabel(sTable->traceTableLabel);
size_t traceMethodCount = sTable->traceMethods.size();
if (!sTable->fieldOffsets.empty()) {
outStream.EmitIntValue(traceMethodCount == 0 ? 1 : 0, 2, 0);
outStream.EmitIntValue(sTable->fieldOffsets.size(), 2, 0);
outStream.EmitIntValue(0, 4, 0);
outStream.EmitSymbolValue(sTable->fieldOffsetsLabel, pointerSize, 0);
}
// Next the trace method descriptors
for (size_t i = 0; i < traceMethodCount; ++i) {
const TraceMethodEntry * tm = &sTable->traceMethods[i];
const Function * method = dyn_cast<Function>(tm->method());
if (method == NULL) {
method = cast<Function>(tm->method()->getOperand(0));
}
outStream.EmitIntValue((i + 1 == traceMethodCount ? 1 : 0), 2, 0);
outStream.EmitIntValue(0, 2, 0);
outStream.EmitIntValue(tm->offset(), 4, 0);
MCSymbol * methodSym = AP.Mang->getSymbol(method);
outStream.EmitSymbolValue(methodSym, pointerSize, 0);