Commit 643396b9 authored by zygzagZ's avatar zygzagZ

Support gcc8 (students...)

parent 544f4eaa
...@@ -62,7 +62,7 @@ public: ...@@ -62,7 +62,7 @@ public:
set<VariablePtr> in, out, def, use; set<VariablePtr> in, out, def, use;
BasicBlock *b {}; BasicBlock *b {};
void addUse(const VariablePtr& v) { void addUse(const VariablePtr& v) {
if (!def.contains(v)) use.emplace(v); if (!def.count(v)) use.emplace(v);
} }
void addDef(const VariablePtr &v) { void addDef(const VariablePtr &v) {
......
...@@ -347,7 +347,7 @@ public: ...@@ -347,7 +347,7 @@ public:
auto self = shared_from_this(); auto self = shared_from_this();
for (const auto& b : phi) { for (const auto& b : phi) {
for (const auto &v : b) { for (const auto &v : b) {
if (!written.contains(v.first)) { if (!written.count(v.first)) {
v.first->writes.emplace_back(self); v.first->writes.emplace_back(self);
written.emplace(v.first); written.emplace(v.first);
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <utility> #include <utility>
#include <map> #include <map>
#include <algorithm>
#include "../TypeDefs.h" #include "../TypeDefs.h"
#include "../Info.h" #include "../Info.h"
...@@ -29,8 +30,8 @@ public: ...@@ -29,8 +30,8 @@ public:
int localOffset = 0; int localOffset = 0;
void clear(const QuadruplePtr& q) { void clear(const QuadruplePtr& q) {
uses.erase(std::remove(uses.begin(), uses.end(), q), uses.end()); uses.erase(std::remove_if(uses.begin(), uses.end(), [&q](const QuadruplePtr &el) { return el == q; }), uses.end());
writes.erase(std::remove(writes.begin(), writes.end(), q), writes.end()); writes.erase(std::remove_if(writes.begin(), writes.end(), [&q](const QuadruplePtr &el) { return el == q; }), writes.end());
} }
}; };
......
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