本文整理汇总了C++中BasicBlock::getIn方法的典型用法代码示例。如果您正苦于以下问题:C++ BasicBlock::getIn方法的具体用法?C++ BasicBlock::getIn怎么用?C++ BasicBlock::getIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BasicBlock
的用法示例。
在下文中一共展示了BasicBlock::getIn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ComputeINOUTIterative
void ReachingDefAna::ComputeINOUTIterative(){
BasicBlock* entry = *pr->get_begin();
bool changed = true;
int i = 0;
do{
map <BasicBlock*,bool> visitedFlag;
queue <BasicBlock*> toVisit;
toVisit.push(entry);
visitedFlag[entry] = true;
cout<<"\n## Iteration "<<i++<<" ##\n";
while(!toVisit.empty()){
BasicBlock* cBB = toVisit.front();
toVisit.pop();
for(list<BasicBlock*>::iterator it = cBB->get_begin_succ(), end = cBB->get_end_succ(); it != end; ++it){
if(visitedFlag.find(*it) == visitedFlag.end()){
toVisit.push(*it);
visitedFlag[*it] = true;
}
}
bitvec in = cBB->getIn();
bitvec out = cBB->getOut();
bitvec tin(in.getSize());
bitvec tout(out.getSize());
for(list<BasicBlock*>::iterator pit = cBB->get_begin_pred(), pend = cBB->get_end_pred(); pit != pend; ++pit){
tin = tin | (*pit)->getOut();
}
tout = tin - cBB->getKill();
tout = tout | cBB->getGen();
if( (in == tin) && (out == tout) )
changed = false;
else{
changed = true;
cBB->setIn(tin);
cBB->setOut(tout);
}
printBB(cBB);
}
//ts.append("1");
string ts("Iteration");
createDotFile(ts.append(std::to_string(i)));
}while(changed);
}
示例2: ComputeINOUTWtList
void ReachingDefAna::ComputeINOUTWtList(){
map <BasicBlock*,bool> visitedFlag;
queue <BasicBlock*> toVisit;
for( list<BasicBlock*>::iterator it = pr->get_begin(), end = pr->get_end(); it != end; ++it){
toVisit.push(*it);
visitedFlag[*it] = true;
}
while( !toVisit.empty() ){
BasicBlock* cBB = toVisit.front();
cout << "\n::VISITING " << cBB->getBBLabel() << " ::\n";
toVisit.pop();
visitedFlag[cBB] = false;
bitvec in = cBB->getIn();
bitvec out = cBB->getOut();
bitvec tin(in.getSize());
bitvec tout(out.getSize());
for(list<BasicBlock*>::iterator pit = cBB->get_begin_pred(), pend = cBB->get_end_pred(); pit != pend; ++pit){
tin = tin | (*pit)->getOut();
}
tout = tin - cBB->getKill();
tout = tout | cBB->getGen();
cBB->setIn(tin);
if( out != tout ){
cBB->setOut(tout);
for(list<BasicBlock*>::iterator it = cBB->get_begin_succ(), end = cBB->get_end_succ(); it != end; ++it){
if(visitedFlag[*it] == false){
visitedFlag[*it] = true;
toVisit.push(*it);
}
}
}
printBB(cBB);
}
string ts("ReachingDefWtList");
createDotFile(ts);
}