本文整理汇总了C++中BasicBlock::getBBLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ BasicBlock::getBBLabel方法的具体用法?C++ BasicBlock::getBBLabel怎么用?C++ BasicBlock::getBBLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BasicBlock
的用法示例。
在下文中一共展示了BasicBlock::getBBLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: createDotFile
void ReachingDefAna::createDotFile(string& name){
std::string Filename = "cfg." + name + ".dot";
ofstream ost;
ost.open(Filename.c_str());
BasicBlock* succN;
ost <<"digraph \"CFG for " << name << "' function\" {\n label=\"CFG for " << name <<"\";\n";
for (list<BasicBlock*>::iterator it = pr->get_begin(), bbie = pr->get_end(); it != bbie; ++it){
BasicBlock* BB = *it;
ost << "\nNode" << BB << " [shape=record,label=\"{ Node:"<< BB->getBBLabel() << ": ";
printBB(BB,ost);
for (list<instruction*>::iterator instit = BB->get_begin_inst(), instend = BB->get_end_inst(); instit != instend; ++instit) {
ost << "\\l";
(*instit)->print_instruction(ost);
}
ost << "}}\"];";
for (list<BasicBlock*>::iterator SI = BB->get_begin_succ(), E = BB->get_end_succ(); SI != E; ++SI) {
succN = *SI;
ost << "\n";
ost <<"Node" << BB <<" -> "<<"Node" << succN <<";";
}
}
ost << "}\n";
}