Commit 09a934d5 authored by zygzagZ's avatar zygzagZ

Cleanup dead code

parent 19fd741d
...@@ -3,21 +3,6 @@ ...@@ -3,21 +3,6 @@
#include "../Compiler.h" #include "../Compiler.h"
void BasicBlock::finishQuads() { void BasicBlock::finishQuads() {
assert(afterInit.empty());
if (!afterInit.empty()) {
while (!quads.empty() && quads.back()->isFinal()) {
auto final = quads.back();
quads.pop_back();
afterInit.emplace_back(final);
}
for (const auto& q : afterInit) {
assert(q->block.get() == this);
quads.push_back(q);
}
afterInit.clear();
}
for (const auto& q : quads) { for (const auto& q : quads) {
q->useVariables(); q->useVariables();
} }
......
...@@ -19,7 +19,6 @@ public: ...@@ -19,7 +19,6 @@ public:
quads.emplace_back(phi); quads.emplace_back(phi);
}; };
vector<QuadruplePtr> quads; vector<QuadruplePtr> quads;
vector<QuadruplePtr> afterInit;
vector<BasicBlockPtr> in, out; vector<BasicBlockPtr> in, out;
shared_ptr<QPhi> phi; shared_ptr<QPhi> phi;
void append(const BasicBlockPtr& after) { void append(const BasicBlockPtr& after) {
...@@ -39,10 +38,6 @@ public: ...@@ -39,10 +38,6 @@ public:
return "?"; return "?";
} }
void addJumpInitQuad(const QuadruplePtr& q) {
afterInit.push_back(q);
}
map<VariablePtr, VariablePtr> &findPhi(const BasicBlockPtr& blk) { map<VariablePtr, VariablePtr> &findPhi(const BasicBlockPtr& blk) {
auto it = find(in.begin(), in.end(), blk); auto it = find(in.begin(), in.end(), blk);
if (it == in.end()) throw runtime_error("blk not found in incoming blocks"); if (it == in.end()) throw runtime_error("blk not found in incoming blocks");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment