diff --git a/sapfor/experts/Sapfor_2017/_src/CFGraph/DataFlow/data_flow.h b/sapfor/experts/Sapfor_2017/_src/CFGraph/DataFlow/data_flow.h index d43c4af..d58755f 100644 --- a/sapfor/experts/Sapfor_2017/_src/CFGraph/DataFlow/data_flow.h +++ b/sapfor/experts/Sapfor_2017/_src/CFGraph/DataFlow/data_flow.h @@ -6,11 +6,7 @@ #include "../CFGraph.h" #include "../IR.h" -enum DATA_FLOW_UPD_STATUS { - NO_CHANGE = 0, - FORWARD, - NEW -}; +enum class DATA_FLOW_UPD_STATUS { NO_CHANGE = 0, PROPAGATED, GENERATED }; template class DataFlowAnalysisNode { diff --git a/sapfor/experts/Sapfor_2017/_src/CFGraph/DataFlow/data_flow_impl.h b/sapfor/experts/Sapfor_2017/_src/CFGraph/DataFlow/data_flow_impl.h index b1dd26a..c6a88f6 100644 --- a/sapfor/experts/Sapfor_2017/_src/CFGraph/DataFlow/data_flow_impl.h +++ b/sapfor/experts/Sapfor_2017/_src/CFGraph/DataFlow/data_flow_impl.h @@ -46,7 +46,7 @@ void DataFlowAnalysisNode::doStep() if (inserted && next->out_cnt > out_max_cnt) out_max_cnt = next->out_cnt; - uniq_change |= status == DATA_FLOW_UPD_STATUS::NEW; + uniq_change |= status == DATA_FLOW_UPD_STATUS::GENERATED; } } } diff --git a/sapfor/experts/Sapfor_2017/_src/CFGraph/live_variable_analysis.cpp b/sapfor/experts/Sapfor_2017/_src/CFGraph/live_variable_analysis.cpp index 54b5d74..a9d9333 100644 --- a/sapfor/experts/Sapfor_2017/_src/CFGraph/live_variable_analysis.cpp +++ b/sapfor/experts/Sapfor_2017/_src/CFGraph/live_variable_analysis.cpp @@ -259,7 +259,7 @@ public: if (live.find(byArg.first) == live.end() && dead.find(byArg.first) == dead.end()) inserted |= getBlock()->addLiveIn({ byArg }); - return inserted ? DATA_FLOW_UPD_STATUS::FORWARD : DATA_FLOW_UPD_STATUS::NO_CHANGE; + return inserted ? DATA_FLOW_UPD_STATUS::PROPAGATED : DATA_FLOW_UPD_STATUS::NO_CHANGE; } LiveVarAnalysisNode(SAPFOR::BasicBlock* block, vector& formal_parameters, @@ -738,7 +738,7 @@ void runLiveVariableAnalysis(const map>& if (exit->addIn(converted)) { exit->setInCnt(max_cnt); - if (exit->forwardData(converted)) + if (exit->forwardData(converted) != DATA_FLOW_UPD_STATUS::NO_CHANGE) exit->setOutCnt(max_cnt); } } diff --git a/sapfor/experts/Sapfor_2017/_src/Transformations/dead_code.cpp b/sapfor/experts/Sapfor_2017/_src/Transformations/dead_code.cpp index 1e27602..c2b8901 100644 --- a/sapfor/experts/Sapfor_2017/_src/Transformations/dead_code.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Transformations/dead_code.cpp @@ -254,7 +254,7 @@ public: DATA_FLOW_UPD_STATUS forwardData(const map>& data) { - bool inserted_forward = false, inserted_new = false; + bool inserted_prop = false, inserted_gen = false; SAPFOR::BasicBlock* bb = getBlock(); @@ -281,7 +281,7 @@ public: if (data_it == data.end()) printInternalError(convertFileName(__FILE__).c_str(), __LINE__); - inserted_forward |= bb->addLiveIn({ *data_it }); + inserted_prop |= bb->addLiveIn({ *data_it }); } else { @@ -295,7 +295,7 @@ public: bb->removeLiveIn(arg); } if(!skip) - inserted_new |= bb->addLiveIn({ { arg, { bb } } }); + inserted_gen |= bb->addLiveIn({ { arg, { bb } } }); } } } @@ -308,17 +308,17 @@ public: { useful_block = true; - inserted_new = true; + inserted_gen = true; next_notempty_out = { this }; break; } } } - if(inserted_new) - return DATA_FLOW_UPD_STATUS::NEW; - else if(inserted_forward) - return DATA_FLOW_UPD_STATUS::FORWARD; + if(inserted_gen) + return DATA_FLOW_UPD_STATUS::GENERATED; + else if(inserted_prop) + return DATA_FLOW_UPD_STATUS::PROPAGATED; return DATA_FLOW_UPD_STATUS::NO_CHANGE; }