本文整理汇总了C++中SymbolRef::isAbsoluteSymbol方法的典型用法代码示例。如果您正苦于以下问题:C++ SymbolRef::isAbsoluteSymbol方法的具体用法?C++ SymbolRef::isAbsoluteSymbol怎么用?C++ SymbolRef::isAbsoluteSymbol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymbolRef
的用法示例。
在下文中一共展示了SymbolRef::isAbsoluteSymbol方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
bool
BinOutput::ConvertValueToBytes(Value& value,
Location loc,
NumericOutput& num_out)
{
// Binary objects we need to resolve against object, not against section.
if (value.isRelative())
{
Location label_loc;
IntNum ssymval;
Expr syme;
SymbolRef rel = value.getRelative();
if (rel->isAbsoluteSymbol())
syme = Expr(0);
else if (rel->getLabel(&label_loc) && label_loc.bc->getContainer())
syme = Expr(rel);
else if (getBinSSymValue(*rel, &ssymval))
syme = Expr(ssymval);
else
goto done;
// Handle PC-relative
if (value.getSubLocation(&label_loc) && label_loc.bc->getContainer())
syme -= label_loc;
// Add into absolute portion
value.AddAbs(syme);
value.ClearRelative();
}
done:
// Simplify absolute portion of value, transforming symrecs
if (Expr* abs = value.getAbs())
{
BinSimplify(*abs);
abs->Simplify(getDiagnostics());
}
// Output
IntNum intn;
m_object.getArch()->setEndian(num_out.getBytes());
if (value.OutputBasic(num_out, &intn, getDiagnostics()))
return true;
// Couldn't output, assume it contains an external reference.
Diag(value.getSource().getBegin(), diag::err_bin_extern_ref);
return false;
}