本文整理汇总了C++中ProblemDomain::top方法的典型用法代码示例。如果您正苦于以下问题:C++ ProblemDomain::top方法的具体用法?C++ ProblemDomain::top怎么用?C++ ProblemDomain::top使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProblemDomain
的用法示例。
在下文中一共展示了ProblemDomain::top方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void mtac::LiveVariableAnalysisProblem::meet(ProblemDomain& out, const ProblemDomain& in){
if(out.top()){
out = in;
return;
} else if(in.top()){
//out does not change
return;
}
for(auto& value : in.values()){
out.values().insert(value);
}
}
示例2: if
void mtac::global_cse::meet(ProblemDomain& in, const ProblemDomain& out){
eddic_assert(!in.top() || !out.top(), "At least one lattice should not be a top element");
if(in.top()){
in = out;
} else if(out.top()){
//in does not change
} else {
auto& first = in.values();
auto& second = out.values();
std::set<expression> intersection;
std::set_intersection(first.begin(), first.end(), second.begin(), second.end(), std::inserter(intersection, intersection.begin()));
in.values() = std::move(intersection);
}
}
示例3: result
ProblemDomain mtac::LiveVariableAnalysisProblem::meet(ProblemDomain& out, ProblemDomain& in){
if(out.top()){
return in;
} else if(in.top()){
return out;
}
typename ProblemDomain::Values values;
ProblemDomain result(values);
for(auto& value : in.values()){
result.values().insert(value);
}
for(auto& value : out.values()){
result.values().insert(value);
}
return result;
}
示例4:
void mtac::LiveVariableAnalysisProblem::transfer(mtac::basic_block_p/* basic_block*/, mtac::Quadruple& quadruple, ProblemDomain& in){
if(in.top()){
ProblemDomain::Values values;
in.int_values = values;
}
if(quadruple.op != mtac::Operator::NOP){
if(mtac::erase_result(quadruple.op)){
in.values().erase(quadruple.result);
} else {
in.values().insert(quadruple.result);
}
if_init<std::shared_ptr<Variable>>(quadruple.arg1, [&in](std::shared_ptr<Variable>& var){in.values().insert(var);});
if_init<std::shared_ptr<Variable>>(quadruple.arg2, [&in](std::shared_ptr<Variable>& var){in.values().insert(var);});
}
}