本文整理汇总了C++中SgStatement::set_file_info方法的典型用法代码示例。如果您正苦于以下问题:C++ SgStatement::set_file_info方法的具体用法?C++ SgStatement::set_file_info怎么用?C++ SgStatement::set_file_info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SgStatement
的用法示例。
在下文中一共展示了SgStatement::set_file_info方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: translate_to_upc
/**
* Convert for_stmt to a upc_forall statement if it has an affinity exp
* in the global map.
*/
SgStatement* translate_to_upc(SgForStatement* for_stmt) {
/* return value is either SgUpcForAllStmt or SgForStmt */
SgStatement* retval;
/* translate if the for_stmt was upc_forall stmt */
aff_map_t::iterator affinity_exp_it = aff_exp_map.find(for_stmt);
if (affinity_exp_it != aff_exp_map.end()) {
/* build a new upc_forall statement */
retval = SageBuilder::buildUpcForAllStatement_nfi(
for_stmt->get_for_init_stmt(), /* initialize stmt */
for_stmt->get_test(), /* condition */
for_stmt->get_increment(), /* increment */
affinity_exp_it->second, /* affinity */
for_stmt->get_loop_body() /* loop body */
);
/* set file info */
Sg_File_Info* old_file_info = for_stmt->get_file_info();
retval->set_file_info( old_file_info );
} else {
/* for_stmt was never a upc_forall stmt */
retval = for_stmt;
}
return retval;
}