本文整理汇总了C++中module::const_alias_iterator::hasInternalLinkage方法的典型用法代码示例。如果您正苦于以下问题:C++ const_alias_iterator::hasInternalLinkage方法的具体用法?C++ const_alias_iterator::hasInternalLinkage怎么用?C++ const_alias_iterator::hasInternalLinkage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类module::const_alias_iterator
的用法示例。
在下文中一共展示了const_alias_iterator::hasInternalLinkage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doFinalization
bool AsmPrinter::doFinalization(Module &M) {
if (TAI->getWeakRefDirective()) {
if (!ExtWeakSymbols.empty())
SwitchToDataSection("");
for (std::set<const GlobalValue*>::iterator i = ExtWeakSymbols.begin(),
e = ExtWeakSymbols.end(); i != e; ++i) {
const GlobalValue *GV = *i;
std::string Name = Mang->getValueName(GV);
O << TAI->getWeakRefDirective() << Name << "\n";
}
}
if (TAI->getSetDirective()) {
if (!M.alias_empty())
SwitchToTextSection(TAI->getTextSection());
O << "\n";
for (Module::const_alias_iterator I = M.alias_begin(), E = M.alias_end();
I!=E; ++I) {
std::string Name = Mang->getValueName(I);
std::string Target;
if (const GlobalValue *GV = I->getAliasedGlobal())
Target = Mang->getValueName(GV);
else
assert(0 && "Unsupported aliasee");
if (I->hasExternalLinkage())
O << "\t.globl\t" << Name << "\n";
else if (I->hasWeakLinkage())
O << TAI->getWeakRefDirective() << Name << "\n";
else if (!I->hasInternalLinkage())
assert(0 && "Invalid alias linkage");
O << TAI->getSetDirective() << Name << ", " << Target << "\n";
}
}
delete Mang; Mang = 0;
return false;
}