本文整理汇总了C++中SymbolRef::okToDeclare方法的典型用法代码示例。如果您正苦于以下问题:C++ SymbolRef::okToDeclare方法的具体用法?C++ SymbolRef::okToDeclare怎么用?C++ SymbolRef::okToDeclare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymbolRef
的用法示例。
在下文中一共展示了SymbolRef::okToDeclare方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Section
Section*
BinObject::AppendSection(llvm::StringRef name,
SourceLocation source,
Diagnostic& diags)
{
bool bss = (name == ".bss");
bool code = (name == ".text");
Section* section = new Section(name, code, bss, source);
m_object.AppendSection(std::auto_ptr<Section>(section));
// Initialize section data and symbols.
std::auto_ptr<BinSection> bsd(new BinSection());
SymbolRef start = m_object.getSymbol(("section."+name+".start").str());
if (start->okToDeclare(Symbol::EXTERN))
{
start->Declare(Symbol::EXTERN);
start->setDeclSource(source);
}
start->AddAssocData(std::auto_ptr<BinSymbol>
(new BinSymbol(*section, *bsd, BinSymbol::START)));
SymbolRef vstart = m_object.getSymbol(("section."+name+".vstart").str());
if (vstart->okToDeclare(Symbol::EXTERN))
{
vstart->Declare(Symbol::EXTERN);
vstart->setDeclSource(source);
}
vstart->AddAssocData(std::auto_ptr<BinSymbol>
(new BinSymbol(*section, *bsd, BinSymbol::VSTART)));
SymbolRef length = m_object.getSymbol(("section."+name+".length").str());
if (length->okToDeclare(Symbol::EXTERN))
{
length->Declare(Symbol::EXTERN);
length->setDeclSource(source);
}
length->AddAssocData(std::auto_ptr<BinSymbol>
(new BinSymbol(*section, *bsd, BinSymbol::LENGTH)));
section->AddAssocData(std::auto_ptr<BinSection>(bsd.release()));
return section;
}