如果想让上面这段代码测试通过,下面的while里面应该填什么 下面这段代码中while里面的空应该怎么填? #include "SVF-LLVM/LLVMUtil.h" #include "SVF-LLVM/SVFIRBuilder.h" #include "WPA/Andersen.h" #include "Assignment-3.h" using namespace SVF; using namespace llvm; using namespace std; // TODO: Implement your Andersen's Algorithm here void AndersenPTA::solveWorklist(){ processAllAddr(); // Keep solving until workList is empty. while (!isWorklistEmpty()) { } } // Process all address constraints to initialize pointers' points-to sets void AndersenPTA::processAllAddr(){ for (ConstraintGraph::const_iterator nodeIt = consCG->begin(), nodeEit = consCG->end(); nodeIt != nodeEit; nodeIt++) { ConstraintNode cgNode = nodeIt->second; for (ConstraintEdge edge : cgNode->getAddrInEdges()) { const AddrCGEdge *addr = SVFUtil::cast<AddrCGEdge>(edge); NodeID dst = addr->getDstID(); NodeID src = addr->getSrcID(); if (addPts(dst, src)) pushIntoWorklist(dst); } } }
时间: 2023-06-27 11:06:08 浏览: 204
js代码-这是一段测试代码
在while循环中,应该调用worklist算法中的popFromWorklist()方法,从worklist中取出一个节点进行处理,直到worklist为空为止。代码如下:
```
void AndersenPTA::solveWorklist(){
processAllAddr();
// Keep solving until workList is empty.
while (!isWorklistEmpty()) {
NodeID node = popFromWorklist();
processNode(node);
}
}
```
其中,processNode()方法是处理一个节点的函数,需要在之后实现。
阅读全文