本文整理汇总了C++中basicblock::iterator::dump方法的典型用法代码示例。如果您正苦于以下问题:C++ iterator::dump方法的具体用法?C++ iterator::dump怎么用?C++ iterator::dump使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类basicblock::iterator
的用法示例。
在下文中一共展示了iterator::dump方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print
void InterPro::print(raw_ostream &O, Module *M)
{
char pPath[100];
for(Module::iterator F = M->begin(); F != M->end(); F ++)
{
if(!F->getName().startswith("test"))
{
continue;
}
O << F->getName() << ":\n";
for(Function::iterator BB = F->begin(); BB != F->end(); ++ BB)
{
for(BasicBlock::iterator I = BB->begin(); I != BB->end(); I ++)
{
I->dump();
if( MDNode *N = I->getMetadata("dbg") )
{
DILocation Loc(N);
string sFileNameForInstruction = Loc.getDirectory().str() + "/" + Loc.getFilename().str();
realpath( sFileNameForInstruction.c_str() , pPath);
sFileNameForInstruction = string(pPath);
unsigned int uLineNoForInstruction = Loc.getLineNumber();
O << sFileNameForInstruction << ": " << uLineNoForInstruction << ": ";
}
O << this->InstBeforeSetMapping[I].size() << " ";
O << this->InstAfterSetMapping[I].size() << "\n";
}
}
O << "*********************************************\n";
}
}
示例2: HandleQueries
void ComputeSSO::HandleQueries(Module& M)
{
for(set<QueryInput*>::iterator qit = queryinputs.begin();qit!=queryinputs.end();++qit)
{
bool constCheck;
errs()<<"\n\n\n\n*******************************************************Query ";
errs()<<"\nOperation : "<<(*qit)->operation;
errs()<<"\nConstCheck : "<<(*qit)->constcheck;
string operation = (*qit)->operation;
set<string> labels = (*qit)->labels;
set<Value*> vals = (*qit)->labVals;
std::set<GraphNode*> taintedA;
std::set<GraphNode*> taintedB;
std::set<GraphNode*> intersectGraph;
for(set<string>::iterator label = labels.begin();label != labels.end();++label)
errs()<<" - "<<*label;
errs()<<"\n*******************************************************\n ";
constCheck = (*qit)->constcheck;
if(constCheck)
{
for(set<Value*>::iterator val = vals.begin();val != vals.end();++val)
{
taintedA = taintGraphMap[*val];
}
intersectGraph = taintedA;
}
else
{
for(set<Value*>::iterator val = vals.begin();val != vals.end();++val)
{
taintedA = taintGraphMap[*val];
++val;
if(val!=vals.end())
taintedB = taintGraphMap[*val];
}
if(strcmp(operation.c_str(),"intersect")==0)
{
// intersectGraph = getIntersect(taintedA,taintedB);
for(set<GraphNode*>::iterator gnode = taintedA.begin();gnode != taintedA.end();++gnode)
{
if(taintedB.count(*gnode) > 0)
{
GraphNode* interNode = (*gnode)->clone();
intersectGraph.insert(interNode);
}
}
}
}
int branches =0;
errs()<<"\n Intersect graph size :"<<intersectGraph.size();
//print intersect graph nodes:
// PrintTainted(intersectGraph);
// for(set<GraphNode*>::iterator gnode = intersectGraph.begin();gnode != intersectGraph.end();++gnode)
// {
// errs()<<"\n Node: "<<(*gnode)->getLabel();
// }
//Print appropriate vals....:
for (Module::iterator F = M.begin(), endF = M.end(); F != endF; ++F) {
string funcName = F->getName();
// errs()<<"\nTaints in function: "<<funcName;
for (Function::iterator BB = F->begin(), endBB = F->end(); BB != endBB; ++BB) {
string bbName ="noName";
if(BB->hasName())
{
bbName = BB->getName();
}
// errs()<<" - block: "<<bbName;
for (BasicBlock::iterator I = BB->begin(), endI = BB->end(); I
!= endI; ++I) {
GraphNode* g = depGraph->findNode(I);
if (intersectGraph.count(g)) {
errs()<<"\n Node found..:";
I->dump();
errs()<<"Taint in function : "<<funcName<<" :";
I->dump();
if (BranchInst *BI = dyn_cast<BranchInst>(I))
{
if(constCheck)
{
Value* conditional = BI->getCondition();
for (unsigned int i = 0; i < cast<User> (conditional)->getNumOperands(); i++)
{
//.........这里部分代码省略.........