本文整理汇总了C++中SymbolMap::get_record方法的典型用法代码示例。如果您正苦于以下问题:C++ SymbolMap::get_record方法的具体用法?C++ SymbolMap::get_record怎么用?C++ SymbolMap::get_record使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymbolMap
的用法示例。
在下文中一共展示了SymbolMap::get_record方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: markOuterVarsWithIntents
// Mark the variables listed in 'with' clauses, if any, with tiMark markers.
// Same as markOuterVarsWithIntents() in implementForallIntents.cpp,
// except uses byrefVars instead of forallIntents.
static void markOuterVarsWithIntents(CallExpr* byrefVars, SymbolMap& uses) {
if (!byrefVars) return;
Symbol* marker = NULL;
// Keep in sync with setupForallIntents() - the actuals alternate:
// (tiMark arg | reduce opExpr), task-intent variable [, repeat]
for_actuals(actual, byrefVars) {
SymExpr* se = toSymExpr(actual);
INT_ASSERT(se); // comes as an UnresolvedSymExpr from the parser,
// should have been resolved in ScopeResolve
// or it is a SymExpr over a tiMark ArgSymbol
// or over chpl__reduceGlob
Symbol* var = se->symbol();
if (marker) {
SymbolMapElem* elem = uses.get_record(var);
if (elem) {
elem->value = marker;
} else {
if (isVarSymbol(marker)) {
// this is a globalOp created in setupOneReduceIntent()
INT_ASSERT(!strcmp(marker->name, "chpl__reduceGlob"));
USR_WARN(byrefVars, "the variable '%s' is given a reduce intent and not mentioned in the loop body - it will have the unit value after the loop", var->name);
}
}
marker = NULL;
} else {
marker = var;
INT_ASSERT(marker); // otherwise the alternation logic will not work
}
}