本文整理汇总了C++中Cfg::copy方法的典型用法代码示例。如果您正苦于以下问题:C++ Cfg::copy方法的具体用法?C++ Cfg::copy怎么用?C++ Cfg::copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cfg
的用法示例。
在下文中一共展示了Cfg::copy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runtime_error
std::vector<Cfg> tmr::post(const Cfg& cfg, unsigned short tid, MemorySetup msetup) {
// execute low-level action
auto post = get_post_cfgs(cfg, tid, msetup);
#define RETURN return post;
// check for high-level simulation
#if REPLACE_INTERFERENCE_WITH_SUMMARY
assert(msetup == PRF);
assert(tid == 0);
// initial and summaries do not need a summary
auto& stmt = *cfg.pc[tid];
if (ignore_for_summary(stmt)) {
RETURN;
}
// find those post cfgs that require a summary, i.e. that changed the shared heap
auto require_summaries = find_effectful_configurations(cfg, post);
if (require_summaries.size() == 0) {
RETURN;
}
// frees shall have an empty summary
if (stmt.clazz() == Statement::FREE) {
// if a free comes that far, we are in trouble as it requires a non-empty summary
throw std::runtime_error("Misbehaving Summary: free stmt requires non-empty summary.");
}
// prepare summary
Cfg tmp = cfg.copy();
tmp.pc[tid] = &stmt.function().summary();
if (stmt.function().has_output()) tmp.inout[tid] = OValue();
// execute summary
auto sumpost = get_post_cfgs(tmp, tid, msetup);
// check summary
for (const Cfg& postcfg : require_summaries) {
bool covered = false;
for (const Cfg& summarycfg : sumpost) {
if (subset_shared(postcfg, summarycfg)) {
covered = true;
break;
}
}
if (!covered) throw std::runtime_error("Misbehaving Summary: failed to mimic low-level action.");
}
#endif
RETURN;
}