本文整理汇总了C++中llvm::ArrayRef::back方法的典型用法代码示例。如果您正苦于以下问题:C++ ArrayRef::back方法的具体用法?C++ ArrayRef::back怎么用?C++ ArrayRef::back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类llvm::ArrayRef
的用法示例。
在下文中一共展示了ArrayRef::back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initModule
static void initModule(ModulePtr m, llvm::ArrayRef<string> importChain) {
if (m->initState == Module::DONE) return;
if (m->declaration != NULL) {
if (m->moduleName == "")
m->moduleName = toKey(m->declaration->name);
else if (m->moduleName != toKey(m->declaration->name))
error(m->declaration,
"module imported by name " + m->moduleName
+ " but declared with name " + toKey(m->declaration->name)
);
} else if (m->moduleName == "")
m->moduleName = "__main__";
if (m->initState == Module::RUNNING && !importChain.empty()) {
// allow prelude to import self
if (importChain.back() == m->moduleName) {
return;
}
}
vector<string> importChainNext = importChain;
importChainNext.push_back(m->moduleName);
if (m->initState == Module::RUNNING) {
circularImportsError(importChainNext);
}
m->initState = Module::RUNNING;
vector<ImportPtr>::iterator ii, iend;
for (ii = m->imports.begin(), iend = m->imports.end(); ii != iend; ++ii)
initModule((*ii)->module, importChainNext);
m->initState = Module::DONE;
verifyAttributes(m);
llvm::ArrayRef<TopLevelItemPtr> items = m->topLevelItems;
TopLevelItemPtr const *ti, *tend;
for (ti = items.begin(), tend = items.end(); ti != tend; ++ti) {
Object *obj = ti->ptr();
switch (obj->objKind) {
case OVERLOAD :
initOverload((Overload *)obj);
break;
case INSTANCE_DECL :
initVariantInstance((InstanceDecl *)obj);
break;
case STATIC_ASSERT_TOP_LEVEL:
checkStaticAssert((StaticAssertTopLevel *)obj);
break;
default:
break;
}
}
if (llvmDIBuilder != NULL) {
llvm::DIFile file = m->location.ok()
? m->location.source->getDebugInfo()
: llvm::DIFile(NULL);
m->debugInfo = (llvm::MDNode*)llvmDIBuilder->createNameSpace(
llvm::DICompileUnit(llvmDIBuilder->getCU()), // scope
m->moduleName, // name
file, // file
1 // line
);
}
}