本文整理汇总了C++中SymbolRef::Use方法的典型用法代码示例。如果您正苦于以下问题:C++ SymbolRef::Use方法的具体用法?C++ SymbolRef::Use怎么用?C++ SymbolRef::Use使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymbolRef
的用法示例。
在下文中一共展示了SymbolRef::Use方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
void
Win64Object::DirProcFrame(DirectiveInfo& info, Diagnostic& diags)
{
assert(info.isObject(m_object));
NameValues& namevals = info.getNameValues();
SourceLocation source = info.getSource();
NameValue& name_nv = namevals.front();
if (!name_nv.isId())
{
diags.Report(info.getSource(), diag::err_value_id)
<< name_nv.getValueRange();
return;
}
llvm::StringRef name = name_nv.getId();
if (m_proc_frame.isValid())
{
diags.Report(info.getSource(),
diags.getCustomDiagID(Diagnostic::Error,
"nested procedures not supported (didn't use [ENDPROC_FRAME]?)"));
diags.Report(m_proc_frame,
diags.getCustomDiagID(Diagnostic::Note,
"previous procedure started here"));
return;
}
m_proc_frame = source;
m_done_prolog = SourceLocation();
m_unwind.reset(new UnwindInfo);
SymbolRef proc = m_object.getSymbol(name);
proc->Use(source);
m_unwind->setProc(proc);
// Optional error handler
if (namevals.size() > 1)
{
NameValue& ehandler_nv = namevals[1];
if (!ehandler_nv.isId())
{
diags.Report(info.getSource(), diag::err_value_id)
<< ehandler_nv.getValueRange();
return;
}
SymbolRef ehandler = m_object.getSymbol(ehandler_nv.getId());
ehandler->Use(ehandler_nv.getValueRange().getBegin());
m_unwind->setEHandler(ehandler);
}
}
示例2: switch
std::auto_ptr<Expr>
NameValue::ReleaseExpr(Object& object)
{
switch (m_type)
{
case ID:
{
SymbolRef sym = object.getSymbol(getId());
sym->Use(m_value_range.getBegin());
return std::auto_ptr<Expr>(new Expr(sym, m_value_range.getBegin()));
}
case EXPR:
return m_expr;
default:
return std::auto_ptr<Expr>(0);
}
}
示例3: Expr
Expr
NameValue::getExpr(Object& object) const
{
switch (m_type)
{
case ID:
{
SymbolRef sym = object.getSymbol(getId());
sym->Use(m_value_range.getBegin());
return Expr(sym);
}
case EXPR:
return *m_expr;
default:
assert(false && "name/value not convertible to expression");
return Expr();
}
}