本文整理汇总了C++中UnitEmitter::insertMergeableTypeAlias方法的典型用法代码示例。如果您正苦于以下问题:C++ UnitEmitter::insertMergeableTypeAlias方法的具体用法?C++ UnitEmitter::insertMergeableTypeAlias怎么用?C++ UnitEmitter::insertMergeableTypeAlias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnitEmitter
的用法示例。
在下文中一共展示了UnitEmitter::insertMergeableTypeAlias方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: txn
void UnitRepoProxy::GetUnitMergeablesStmt
::get(UnitEmitter& ue) {
RepoTxn txn(m_repo);
if (!prepared()) {
std::stringstream ssSelect;
ssSelect << "SELECT mergeableIx,mergeableKind,mergeableId,mergeableValue"
" FROM "
<< m_repo.table(m_repoId, "UnitMergeables")
<< " WHERE unitSn == @unitSn ORDER BY mergeableIx ASC;";
txn.prepare(*this, ssSelect.str());
}
RepoTxnQuery query(txn, *this);
query.bindInt64("@unitSn", ue.m_sn);
do {
query.step();
if (query.row()) {
int mergeableIx; /**/ query.getInt(0, mergeableIx);
int mergeableKind; /**/ query.getInt(1, mergeableKind);
Id mergeableId; /**/ query.getInt(2, mergeableId);
auto k = MergeKind(mergeableKind);
if (UNLIKELY(!RuntimeOption::RepoAuthoritative)) {
/*
* We're using a repo generated in WholeProgram mode,
* but we're not using it in RepoAuthoritative mode
* (this is dodgy to start with). We're not going to
* deal with requires at merge time, so drop them
* here, and clear the mergeOnly flag for the unit.
* The two exceptions are persistent constants and
* TypeAliases which are allowed in systemlib.
*/
if ((k != MergeKind::PersistentDefine && k != MergeKind::TypeAlias)
|| SystemLib::s_inited) {
ue.m_mergeOnly = false;
}
}
switch (k) {
case MergeKind::TypeAlias:
ue.insertMergeableTypeAlias(mergeableIx, k, mergeableId);
break;
case MergeKind::ReqDoc:
ue.insertMergeableInclude(mergeableIx, k, mergeableId);
break;
case MergeKind::PersistentDefine:
case MergeKind::Define:
case MergeKind::Global: {
TypedValue mergeableValue; /**/ query.getTypedValue(3,
mergeableValue);
ue.insertMergeableDef(mergeableIx, k, mergeableId, mergeableValue);
break;
}
default: break;
}
}
} while (!query.done());
txn.commit();
}