本文整理汇总了C++中module::global_iterator::hasCommonLinkage方法的典型用法代码示例。如果您正苦于以下问题:C++ global_iterator::hasCommonLinkage方法的具体用法?C++ global_iterator::hasCommonLinkage怎么用?C++ global_iterator::hasCommonLinkage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类module::global_iterator
的用法示例。
在下文中一共展示了global_iterator::hasCommonLinkage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getObjFileLowering
/// doInitialization - Perform Module level initializations here.
/// One task that we do here is to sectionize all global variables.
/// The MemSelOptimizer pass depends on the sectionizing.
///
bool PIC16AsmPrinter::doInitialization(Module &M) {
bool Result = AsmPrinter::doInitialization(M);
// Every asmbly contains these std headers.
O << "\n#include p16f1xxx.inc";
O << "\n#include stdmacros.inc";
// Set the section names for all globals.
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
I != E; ++I) {
// Record External Var Decls.
if (I->isDeclaration()) {
ExternalVarDecls.push_back(I);
continue;
}
// Record Exteranl Var Defs.
if (I->hasExternalLinkage() || I->hasCommonLinkage()) {
ExternalVarDefs.push_back(I);
}
// Sectionify actual data.
if (!I->hasAvailableExternallyLinkage()) {
const MCSection *S = getObjFileLowering().SectionForGlobal(I, Mang, TM);
I->setSection(((const PIC16Section *)S)->getName());
}
}
DbgInfo.BeginModule(M);
EmitFunctionDecls(M);
EmitUndefinedVars(M);
EmitDefinedVars(M);
EmitIData(M);
EmitUData(M);
EmitRomData(M);
EmitSharedUdata(M);
EmitUserSections(M);
return Result;
}