tentatively fix clang 7 build
MODIFY
ir/constant.cpp
ir/constant.cpp
@@ -135,7 +135,21 @@ expr BoolPred::toSMT() const {
void CmpPred::print(ostream &os) const {
- // TODO
+ const char *p = nullptr;
+ switch (pred) {
+ case EQ: p = " == "; break;
+ case NE: p = " != "; break;
+ case SLE: p = " <= "; break;
+ case SLT: p = " < "; break;
+ case SGE: p = " >= "; break;
+ case SGT: p = " > "; break;
+ case ULE: p = " u<= "; break;
+ case ULT: p = " u< "; break;
+ case UGE: p = " u>= "; break;
+ case UGT: p = " u> "; break;
+ }
+ lhs.print(os);
+ rhs.print(os << p);
}
expr CmpPred::toSMT() const {

MODIFY
ir/function.cpp
ir/function.cpp
@@ -113,6 +113,11 @@ void Function::instr_iterator::operator++(void) {
}
void Function::print(ostream &os, bool print_header) const {
+ if (precondition) {
+ os << "Pre: ";
+ precondition->print(os);
+ }
+
if (print_header) {
os << "declare @" << name << '(';
bool first = true;

MODIFY
ir/function.h
ir/function.h
@@ -21,7 +21,7 @@ namespace IR {
class Function;
-class BasicBlock {
+class BasicBlock final {
std::string name;
std::vector<std::unique_ptr<Instr>> m_instrs;
@@ -43,7 +43,7 @@ public:
};
-class Function {
+class Function final {
IR::Type *type = nullptr;
std::string name;
std::unordered_map<std::string, BasicBlock> BBs;

tentatively fix clang 7 build