@@ -30,29 +30,29 @@ namespace psr {
3030 * version is used if existend, otherwise a new one is created and inserted
3131 * into the cache.
3232 */
33- template <typename N, typename D, typename M , typename T, typename V,
33+ template <typename N, typename D, typename F , typename T, typename V,
3434 typename L, typename I>
3535class FlowEdgeFunctionCache {
3636private:
37- IDETabulationProblem<N, D, M , T, V, L, I> &problem;
37+ IDETabulationProblem<N, D, F , T, V, L, I> &problem;
3838 // Auto add zero
3939 bool autoAddZero;
4040 D zeroValue;
4141 // Caches for the flow functions
4242 std::map<std::tuple<N, N>, std::shared_ptr<FlowFunction<D>>>
4343 NormalFlowFunctionCache;
44- std::map<std::tuple<N, M >, std::shared_ptr<FlowFunction<D>>>
44+ std::map<std::tuple<N, F >, std::shared_ptr<FlowFunction<D>>>
4545 CallFlowFunctionCache;
46- std::map<std::tuple<N, M , N, N>, std::shared_ptr<FlowFunction<D>>>
46+ std::map<std::tuple<N, F , N, N>, std::shared_ptr<FlowFunction<D>>>
4747 ReturnFlowFunctionCache;
48- std::map<std::tuple<N, N, std::set<M >>, std::shared_ptr<FlowFunction<D>>>
48+ std::map<std::tuple<N, N, std::set<F >>, std::shared_ptr<FlowFunction<D>>>
4949 CallToRetFlowFunctionCache;
5050 // Caches for the edge functions
5151 std::map<std::tuple<N, D, N, D>, std::shared_ptr<EdgeFunction<L>>>
5252 NormalEdgeFunctionCache;
53- std::map<std::tuple<N, D, M , D>, std::shared_ptr<EdgeFunction<L>>>
53+ std::map<std::tuple<N, D, F , D>, std::shared_ptr<EdgeFunction<L>>>
5454 CallEdgeFunctionCache;
55- std::map<std::tuple<N, M , N, D, N, D>, std::shared_ptr<EdgeFunction<L>>>
55+ std::map<std::tuple<N, F , N, D, N, D>, std::shared_ptr<EdgeFunction<L>>>
5656 ReturnEdgeFunctionCache;
5757 std::map<std::tuple<N, D, N, D>, std::shared_ptr<EdgeFunction<L>>>
5858 CallToRetEdgeFunctionCache;
@@ -62,7 +62,7 @@ class FlowEdgeFunctionCache {
6262public:
6363 // Ctor allows access to the IDEProblem in order to get access to flow and
6464 // edge function factory functions.
65- FlowEdgeFunctionCache (IDETabulationProblem<N, D, M , T, V, L, I> &problem)
65+ FlowEdgeFunctionCache (IDETabulationProblem<N, D, F , T, V, L, I> &problem)
6666 : problem(problem),
6767 autoAddZero (problem.getIFDSIDESolverConfig().autoAddZero),
6868 zeroValue(problem.getZeroValue()) {
@@ -133,16 +133,16 @@ class FlowEdgeFunctionCache {
133133 }
134134 }
135135
136- std::shared_ptr<FlowFunction<D>> getCallFlowFunction (N callStmt, M destMthd ) {
136+ std::shared_ptr<FlowFunction<D>> getCallFlowFunction (N callStmt, F destFun ) {
137137 PAMM_GET_INSTANCE;
138138 auto &lg = lg::get ();
139139 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
140140 << " Call flow function factory call" );
141141 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
142142 << " (N) Call Stmt : " << problem.NtoString (callStmt));
143143 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
144- << " (M ) Dest Mthd : " << problem.FtoString (destMthd ));
145- auto key = std::tie (callStmt, destMthd );
144+ << " (F ) Dest Fun : " << problem.FtoString (destFun ));
145+ auto key = std::tie (callStmt, destFun );
146146 if (CallFlowFunctionCache.count (key)) {
147147 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
148148 << " Flow function fetched from cache" );
@@ -154,16 +154,16 @@ class FlowEdgeFunctionCache {
154154 auto ff =
155155 (autoAddZero)
156156 ? std::make_shared<ZeroedFlowFunction<D>>(
157- problem.getCallFlowFunction (callStmt, destMthd ), zeroValue)
158- : problem.getCallFlowFunction (callStmt, destMthd );
157+ problem.getCallFlowFunction (callStmt, destFun ), zeroValue)
158+ : problem.getCallFlowFunction (callStmt, destFun );
159159 CallFlowFunctionCache.insert (std::make_pair (key, ff));
160160 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG) << " Flow function constructed" );
161161 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG) << ' ' );
162162 return ff;
163163 }
164164 }
165165
166- std::shared_ptr<FlowFunction<D>> getRetFlowFunction (N callSite, M calleeMthd ,
166+ std::shared_ptr<FlowFunction<D>> getRetFlowFunction (N callSite, F calleeFun ,
167167 N exitStmt, N retSite) {
168168 PAMM_GET_INSTANCE;
169169 auto &lg = lg::get ();
@@ -172,12 +172,12 @@ class FlowEdgeFunctionCache {
172172 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
173173 << " (N) Call Site : " << problem.NtoString (callSite));
174174 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
175- << " (M ) Callee : " << problem.FtoString (calleeMthd ));
175+ << " (F ) Callee : " << problem.FtoString (calleeFun ));
176176 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
177177 << " (N) Exit Stmt : " << problem.NtoString (exitStmt));
178178 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
179179 << " (N) Ret Site : " << problem.NtoString (retSite));
180- auto key = std::tie (callSite, calleeMthd , exitStmt, retSite);
180+ auto key = std::tie (callSite, calleeFun , exitStmt, retSite);
181181 if (ReturnFlowFunctionCache.count (key)) {
182182 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
183183 << " Flow function fetched from cache" );
@@ -188,10 +188,10 @@ class FlowEdgeFunctionCache {
188188 INC_COUNTER (" Return-FF Construction" , 1 , PAMM_SEVERITY_LEVEL::Full);
189189 auto ff = (autoAddZero)
190190 ? std::make_shared<ZeroedFlowFunction<D>>(
191- problem.getRetFlowFunction (callSite, calleeMthd ,
191+ problem.getRetFlowFunction (callSite, calleeFun ,
192192 exitStmt, retSite),
193193 zeroValue)
194- : problem.getRetFlowFunction (callSite, calleeMthd , exitStmt,
194+ : problem.getRetFlowFunction (callSite, calleeFun , exitStmt,
195195 retSite);
196196 ReturnFlowFunctionCache.insert (std::make_pair (key, ff));
197197 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG) << " Flow function constructed" );
@@ -201,7 +201,7 @@ class FlowEdgeFunctionCache {
201201 }
202202
203203 std::shared_ptr<FlowFunction<D>>
204- getCallToRetFlowFunction (N callSite, N retSite, std::set<M > callees) {
204+ getCallToRetFlowFunction (N callSite, N retSite, std::set<F > callees) {
205205 PAMM_GET_INSTANCE;
206206 auto &lg = lg::get ();
207207 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
@@ -210,7 +210,7 @@ class FlowEdgeFunctionCache {
210210 << " (N) Call Site : " << problem.NtoString (callSite));
211211 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
212212 << " (N) Ret Site : " << problem.NtoString (retSite));
213- LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG) << " (M ) Callee's : " );
213+ LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG) << " (F ) Callee's : " );
214214 for (auto callee : callees) {
215215 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
216216 << " " << problem.FtoString (callee));
@@ -239,7 +239,7 @@ class FlowEdgeFunctionCache {
239239 }
240240
241241 std::shared_ptr<FlowFunction<D>> getSummaryFlowFunction (N callStmt,
242- M destMthd ) {
242+ F destFun ) {
243243 // PAMM_GET_INSTANCE;
244244 // INC_COUNTER("Summary-FF Construction", 1, PAMM_SEVERITY_LEVEL::Full);
245245 auto &lg = lg::get ();
@@ -248,9 +248,9 @@ class FlowEdgeFunctionCache {
248248 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
249249 << " (N) Call Stmt : " << problem.NtoString (callStmt));
250250 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
251- << " (M ) Dest Mthd : " << problem.FtoString (destMthd ));
251+ << " (F ) Dest Mthd : " << problem.FtoString (destFun ));
252252 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG) << ' ' );
253- auto ff = problem.getSummaryFlowFunction (callStmt, destMthd );
253+ auto ff = problem.getSummaryFlowFunction (callStmt, destFun );
254254 return ff;
255255 }
256256
@@ -286,7 +286,7 @@ class FlowEdgeFunctionCache {
286286 }
287287
288288 std::shared_ptr<EdgeFunction<L>>
289- getCallEdgeFunction (N callStmt, D srcNode, M destinationMethod , D destNode) {
289+ getCallEdgeFunction (N callStmt, D srcNode, F destinationFunction , D destNode) {
290290 PAMM_GET_INSTANCE;
291291 auto &lg = lg::get ();
292292 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
@@ -296,11 +296,11 @@ class FlowEdgeFunctionCache {
296296 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
297297 << " (D) Src Node : " << problem.DtoString (srcNode));
298298 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
299- << " (M ) Dest Mthd : "
300- << problem.FtoString (destinationMethod ));
299+ << " (F ) Dest Fun : "
300+ << problem.FtoString (destinationFunction ));
301301 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
302302 << " (D) Dest Node : " << problem.DtoString (destNode));
303- auto key = std::tie (callStmt, srcNode, destinationMethod , destNode);
303+ auto key = std::tie (callStmt, srcNode, destinationFunction , destNode);
304304 if (CallEdgeFunctionCache.count (key)) {
305305 INC_COUNTER (" Call-EF Cache Hit" , 1 , PAMM_SEVERITY_LEVEL::Full);
306306 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
@@ -310,7 +310,7 @@ class FlowEdgeFunctionCache {
310310 } else {
311311 INC_COUNTER (" Call-EF Construction" , 1 , PAMM_SEVERITY_LEVEL::Full);
312312 auto ef = problem.getCallEdgeFunction (callStmt, srcNode,
313- destinationMethod , destNode);
313+ destinationFunction , destNode);
314314 CallEdgeFunctionCache.insert (std::make_pair (key, ef));
315315 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG) << " Edge function constructed" );
316316 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG) << ' ' );
@@ -319,7 +319,7 @@ class FlowEdgeFunctionCache {
319319 }
320320
321321 std::shared_ptr<EdgeFunction<L>> getReturnEdgeFunction (N callSite,
322- M calleeMethod ,
322+ F calleeFunction ,
323323 N exitStmt, D exitNode,
324324 N reSite, D retNode) {
325325 PAMM_GET_INSTANCE;
@@ -329,7 +329,7 @@ class FlowEdgeFunctionCache {
329329 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
330330 << " (N) Call Site : " << problem.NtoString (callSite));
331331 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
332- << " (M ) Callee : " << problem.FtoString (calleeMethod ));
332+ << " (F ) Callee : " << problem.FtoString (calleeFunction ));
333333 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
334334 << " (N) Exit Stmt : " << problem.NtoString (exitStmt));
335335 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
@@ -339,7 +339,7 @@ class FlowEdgeFunctionCache {
339339 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
340340 << " (D) Ret Node : " << problem.DtoString (retNode));
341341 auto key =
342- std::tie (callSite, calleeMethod , exitStmt, exitNode, reSite, retNode);
342+ std::tie (callSite, calleeFunction , exitStmt, exitNode, reSite, retNode);
343343 if (ReturnEdgeFunctionCache.count (key)) {
344344 INC_COUNTER (" Return-EF Cache Hit" , 1 , PAMM_SEVERITY_LEVEL::Full);
345345 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
@@ -348,7 +348,7 @@ class FlowEdgeFunctionCache {
348348 return ReturnEdgeFunctionCache.at (key);
349349 } else {
350350 INC_COUNTER (" Return-EF Construction" , 1 , PAMM_SEVERITY_LEVEL::Full);
351- auto ef = problem.getReturnEdgeFunction (callSite, calleeMethod , exitStmt,
351+ auto ef = problem.getReturnEdgeFunction (callSite, calleeFunction , exitStmt,
352352 exitNode, reSite, retNode);
353353 ReturnEdgeFunctionCache.insert (std::make_pair (key, ef));
354354 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG) << " Edge function constructed" );
@@ -359,7 +359,7 @@ class FlowEdgeFunctionCache {
359359
360360 std::shared_ptr<EdgeFunction<L>>
361361 getCallToRetEdgeFunction (N callSite, D callNode, N retSite, D retSiteNode,
362- std::set<M > callees) {
362+ std::set<F > callees) {
363363 PAMM_GET_INSTANCE;
364364 auto &lg = lg::get ();
365365 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
@@ -372,7 +372,7 @@ class FlowEdgeFunctionCache {
372372 << " (N) Ret Site : " << problem.NtoString (retSite));
373373 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
374374 << " (D) Ret Node : " << problem.DtoString (retSiteNode));
375- LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG) << " (M ) Callee's : " );
375+ LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG) << " (F ) Callee's : " );
376376 for (auto callee : callees) {
377377 LOG_IF_ENABLE (BOOST_LOG_SEV (lg, DEBUG)
378378 << " " << problem.FtoString (callee));
0 commit comments