本文整理汇总了C++中DSGraph::AssertGraphOK方法的典型用法代码示例。如果您正苦于以下问题:C++ DSGraph::AssertGraphOK方法的具体用法?C++ DSGraph::AssertGraphOK怎么用?C++ DSGraph::AssertGraphOK使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DSGraph
的用法示例。
在下文中一共展示了DSGraph::AssertGraphOK方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
//.........这里部分代码省略.........
bool hasPtr = false;
for (Function::arg_iterator ii = I->arg_begin(), ee = I->arg_end();
ii != ee;
++ii)
if (isa<PointerType>(ii->getType())) {
hasPtr = true;
break;
}
if (!hasPtr)
eraseCallsTo(I);
}
if(!DisableStdLib) {
//
// Scan through the function summaries and process functions by summary.
//
for (int x = 0; recFuncs[x].name; ++x)
if (Function* F = M.getFunction(recFuncs[x].name))
if (F->isDeclaration()) {
processFunction(x, F);
}
std::set<std::string>::iterator ai = AllocWrappersAnalysis->alloc_begin();
std::set<std::string>::iterator ae = AllocWrappersAnalysis->alloc_end();
int x;
for (x = 0; recFuncs[x].name; ++x) {
if(recFuncs[x].name == std::string("malloc"))
break;
}
for(;ai != ae; ++ai) {
if(Function* F = M.getFunction(*ai))
processFunction(x, F);
}
ai = AllocWrappersAnalysis->dealloc_begin();
ae = AllocWrappersAnalysis->dealloc_end();
for (x = 0; recFuncs[x].name; ++x) {
if(recFuncs[x].name == std::string("free"))
break;
}
for(;ai != ae; ++ai) {
if(Function* F = M.getFunction(*ai))
processFunction(x, F);
}
//
// Merge return values and checked pointer values for SAFECode run-time
// checks.
//
processRuntimeCheck (M, "boundscheck", 2);
processRuntimeCheck (M, "boundscheckui", 2);
processRuntimeCheck (M, "exactcheck2", 1);
processRuntimeCheck (M, "boundscheck_debug", 2);
processRuntimeCheck (M, "boundscheckui_debug", 2);
processRuntimeCheck (M, "exactcheck2_debug", 1);
processRuntimeCheck (M, "pchk_getActualValue", 1);
}
//
// In the Local DSA Pass, we marked nodes passed to/returned from 'StdLib'
// functions as External because, at that point, they were. However, they no
// longer are necessarily External, and we need to update accordingly.
//
GlobalsGraph->maskIncompleteMarkers();
GlobalsGraph->computeExternalFlags(DSGraph::ResetExternal);
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (!I->isDeclaration()) {
DSGraph * G = getDSGraph(*I);
unsigned EFlags = 0
| DSGraph::ResetExternal
| DSGraph::DontMarkFormalsExternal
| DSGraph::ProcessCallSites;
G->maskIncompleteMarkers();
G->markIncompleteNodes(DSGraph::MarkFormalArgs
|DSGraph::IgnoreGlobals);
G->computeExternalFlags(EFlags);
DEBUG(G->AssertGraphOK());
}
GlobalsGraph->markIncompleteNodes(DSGraph::MarkFormalArgs
|DSGraph::IgnoreGlobals);
GlobalsGraph->computeExternalFlags(DSGraph::ProcessCallSites);
DEBUG(GlobalsGraph->AssertGraphOK());
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (!I->isDeclaration()) {
DSGraph *Graph = getOrCreateGraph(I);
Graph->maskIncompleteMarkers();
cloneGlobalsInto(Graph, DSGraph::DontCloneCallNodes |
DSGraph::DontCloneAuxCallNodes);
Graph->markIncompleteNodes(DSGraph::MarkFormalArgs
|DSGraph::IgnoreGlobals);
}
return false;
}