From 5728736bc2c87ca663c43456c7088b735b42c4ab Mon Sep 17 00:00:00 2001 From: mkoch Date: Sun, 14 Jan 2024 13:26:21 +0300 Subject: [PATCH] live analysis: remove redunant ';' --- .../_src/CFGraph/live_variable_analysis.cpp | 18 +++++++++--------- .../_src/CFGraph/live_variable_analysis.h | 2 +- .../_src/Transformations/dead_code.cpp | 16 ++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) 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 51b4d14..5f79f52 100644 --- a/sapfor/experts/Sapfor_2017/_src/CFGraph/live_variable_analysis.cpp +++ b/sapfor/experts/Sapfor_2017/_src/CFGraph/live_variable_analysis.cpp @@ -95,7 +95,7 @@ namespace SAPFOR } return inserted; - }; + } bool BasicBlock::removeLive(SAPFOR::Argument* to_remove, bool in) { @@ -126,7 +126,7 @@ namespace SAPFOR } return removed; - }; + } map> BasicBlock::getLive(bool in) const { auto& current_set = in ? live_in : live_out; @@ -231,22 +231,22 @@ public: map> getIn() { return getBlock()->getLiveOut(); - }; + } map> getOut() { return getBlock()->getLiveIn(); - }; + } bool addIn(const map>& data) { return getBlock()->addLiveOut(data); - }; + } bool addOut(const map>& data) { return getBlock()->addLiveIn(data); - }; + } bool forwardData(const map>& data) { @@ -257,7 +257,7 @@ public: inserted |= getBlock()->addLiveIn({ byArg }); return inserted; - }; + } LiveVarAnalysisNode(SAPFOR::BasicBlock* block, vector& formal_parameters, vector& fcalls, const map& funcByName) @@ -279,11 +279,11 @@ protected: LiveVarAnalysisNode* createNode(SAPFOR::BasicBlock* block) override { return new LiveVarAnalysisNode(block, formal_parameters, fcalls, funcByName); - }; + } public: LiveVarAnalysis(vector& formal_parameters, vector& fcalls, const map& funcByName) : formal_parameters(formal_parameters), fcalls(fcalls), funcByName(funcByName) - { }; + { } }; void getUseDefForInstruction(SAPFOR::BasicBlock* block, SAPFOR::Instruction* instr, diff --git a/sapfor/experts/Sapfor_2017/_src/CFGraph/live_variable_analysis.h b/sapfor/experts/Sapfor_2017/_src/CFGraph/live_variable_analysis.h index d4a2c6a..7e6cd73 100644 --- a/sapfor/experts/Sapfor_2017/_src/CFGraph/live_variable_analysis.h +++ b/sapfor/experts/Sapfor_2017/_src/CFGraph/live_variable_analysis.h @@ -37,7 +37,7 @@ void insertIfVar(IT begin, IT end, DEST& to) { for (auto it = begin; it != end; it++) if (*it && (*it)->getType() == SAPFOR::CFG_ARG_TYPE::VAR) to.insert(*it); -}; +} void getUseDefForInstruction(SAPFOR::BasicBlock* block, SAPFOR::Instruction* instr, std::set& use, std::set& def, diff --git a/sapfor/experts/Sapfor_2017/_src/Transformations/dead_code.cpp b/sapfor/experts/Sapfor_2017/_src/Transformations/dead_code.cpp index 8cb4b18..9b6411f 100644 --- a/sapfor/experts/Sapfor_2017/_src/Transformations/dead_code.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Transformations/dead_code.cpp @@ -190,11 +190,11 @@ public: map> getIn() { return getBlock()->getLiveOut(); - }; + } map> getOut() { return getBlock()->getLiveIn(); - }; + } bool addIn(const map>& data) { bool inserted = getBlock()->addLiveOut(data); @@ -205,11 +205,11 @@ public: inserted |= updateJumpStatus(); return inserted; - }; + } bool addOut(const map>& data) { return getBlock()->addLiveIn(data); - }; + } bool forwardData(const map>& data) { bool inserted = false; @@ -279,7 +279,7 @@ public: } return inserted; - }; + } DeadCodeAnalysisNode(SAPFOR::BasicBlock* block, vector& formal_parameters) : formal_parameters(formal_parameters) @@ -295,7 +295,7 @@ public: getBlock()->addLiveIn({ { arg, { getBlock() } } }); } - const vector& getResult() { return useful; }; + const vector& getResult() { return useful; } }; class DeadCodeAnalysis : public BackwardDataFlowAnalysis { @@ -304,11 +304,11 @@ protected: DeadCodeAnalysisNode* createNode(SAPFOR::BasicBlock* block) override { return new DeadCodeAnalysisNode(block, formal_parameters); - }; + } public: DeadCodeAnalysis(vector& formal_parameters) : formal_parameters(formal_parameters) - { }; + { } };