71 nonRootSCCs.insert(rep);
85 if (it->second->getInEdges().empty())
87 for (
auto inEdge: it->second->getInEdges())
89 NodeID srcNodeId = inEdge->getSrcID();
90 if (!cgSCCNodes.test(srcNodeId))
98 if (!nonRootSCCs.count(repNodeId) && rootEntry[repNodeId] == fun)
104 for (
const auto& node: cgSCCNodes)
106 funcScc.insert(
callGraph->getGNode(node)->getFunction());
110 funcToWTO[it->second->getFunction()] = iwto;
129 std::vector<const ICFGCycleWTO*> cycles;
131 std::vector<const ICFGWTOComp*>
stack;
134 if (!kv.second)
continue;
135 for (
const ICFGWTOComp* comp : kv.second->getWTOComponents())
136 stack.push_back(comp);
138 while (!
stack.empty())
144 for (
const ICFGWTOComp* sub : cycle->getWTOComponents())
145 stack.push_back(sub);
146 cycles.push_back(cycle);
149 std::reverse(cycles.begin(), cycles.end());
160 std::vector<const ICFGNode*>
nodes;
161 nodes.push_back(cycle->head()->getICFGNode());
162 for (
const ICFGWTOComp* comp : cycle->getWTOComponents())
165 nodes.push_back(s->getICFGNode());
173 for (
const SVFStmt* stmt : node->getSVFStmts())
175 const ValVar* lhs =
nullptr;
189 for (
const SVFVar* fp : fe->getFormalParms())
AEWTO(SVFIR *pag, ICFG *icfg)
Map< const ICFGCycleWTO *, Set< const ValVar * > > cycleToValVars
CallGraphSCC * callGraphSCC
Map< const FunObjVar *, const ICFGWTO * > funcToWTO
void initWTO()
Build WTO for each function using call graph SCC.
static AndersenWaveDiff * createAndersenWaveDiff(SVFIR *_pag)
Create an singleton instance directly instead of invoking llvm pass manager.
const FunObjVar * getFunction() const
Get function of this call node.
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
bool isDeclaration() const
const GEdgeSetTy & getInEdges() const
NodeID getId() const
Get ID.
bool isProgEntryFunction(const FunObjVar *)
Program entry function e.g. main.
LLVM_NODISCARD std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > dyn_cast(const Y &Val)
WTOCycle< ICFG > ICFGCycleWTO
std::unordered_set< Key, Hash, KeyEqual, Allocator > Set
WTONode< ICFG > ICFGSingletonWTO
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
iter_range< typename GenericGraphTraits< GraphType >::nodes_iterator > nodes(const GraphType &G)
WTOComponent< ICFG > ICFGWTOComp