本文整理汇总了C++中FunctionInvocation::Output方法的典型用法代码示例。如果您正苦于以下问题:C++ FunctionInvocation::Output方法的具体用法?C++ FunctionInvocation::Output怎么用?C++ FunctionInvocation::Output使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionInvocation
的用法示例。
在下文中一共展示了FunctionInvocation::Output方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cg_context
void
OutputMgr::OutputMain(std::ostream &out)
{
CGContext cg_context(GetFirstFunction() /* BOGUS -- not in first func. */,
Effect::get_empty_effect(),
0);
FunctionInvocation *invoke = NULL;
invoke = ExtensionMgr::MakeFuncInvocation(GetFirstFunction(), cg_context);
out << endl << endl;
output_comment_line(out, "----------------------------------------");
ExtensionMgr::OutputInit(out);
// output initializers for global array variables
OutputArrayInitializers(*VariableSelector::GetGlobalVariables(), out, 1);
if (CGOptions::blind_check_global()) {
ExtensionMgr::OutputFirstFunInvocation(out, invoke);
std::vector<Variable *>& vars = *VariableSelector::GetGlobalVariables();
for (size_t i=0; i<vars.size(); i++) {
vars[i]->output_value_dump(out, "checksum ", 1);
}
}
else {
// set up a global variable that controls if we print the hash value after computing it for each global
out << " int print_hash_value = 0;" << endl;
if (CGOptions::accept_argc()) {
out << " if (argc == 2 && strcmp(argv[1], \"1\") == 0) print_hash_value = 1;" << endl;
}
out << " platform_main_begin();" << endl;
if (CGOptions::compute_hash()) {
out << " crc32_gentab();" << endl;
}
ExtensionMgr::OutputFirstFunInvocation(out, invoke);
#if 0
out << " ";
invoke->Output(out);
out << ";" << endl;
#endif
// resetting all global dangling pointer to null per Rohit's request
if (!CGOptions::dangling_global_ptrs()) {
OutputPtrResets(out, GetFirstFunction()->dead_globals);
}
if (CGOptions::step_hash_by_stmt())
OutputMgr::OutputHashFuncInvocation(out, 1);
else
HashGlobalVariables(out);
if (CGOptions::compute_hash()) {
out << " platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value);" << endl;
} else {
out << " platform_main_end(0,0);" << endl;
}
}
ExtensionMgr::OutputTail(out);
out << "}" << endl;
delete invoke;
}