diff --git a/instructionAPI/statefull_visitor.cpp b/instructionAPI/statefull_visitor.cpp index d83179e..6f80873 100644 --- a/instructionAPI/statefull_visitor.cpp +++ b/instructionAPI/statefull_visitor.cpp @@ -6,6 +6,7 @@ #include "InstructionDecoder.h" #include "Operand.h" #include "Register.h" +#include "MultiRegister.h" #include "Visitor.h" #include @@ -25,6 +26,7 @@ struct stateful_visitor : di::Visitor { bool foundImm{}; bool foundBin{}; bool foundDer{}; + bool foundMultiReg{}; void visit(di::BinaryFunction*) override { foundBin = true; } @@ -34,13 +36,17 @@ struct stateful_visitor : di::Visitor { void visit(di::Dereference*) override { foundDer = true; } + void visit(di::MultiRegisterAST*) override { foundMultiReg = true; } + + // clang-format off friend std::ostream& operator<<(std::ostream &os, stateful_visitor const& v) { std::cout << std::boolalpha << " foundReg: " << v.foundReg << '\n' << " foundImm: " << v.foundImm << '\n' << " foundBin: " << v.foundBin << '\n' - << " foundDer: " << v.foundDer << '\n'; + << " foundDer: " << v.foundDer << '\n' + << " foundMultiReg: " << v.foundMultiReg << '\n'; return os; } diff --git a/instructionAPI/stateless_visitor.cpp b/instructionAPI/stateless_visitor.cpp index fdafa4d..6ca80e0 100644 --- a/instructionAPI/stateless_visitor.cpp +++ b/instructionAPI/stateless_visitor.cpp @@ -6,6 +6,7 @@ #include "InstructionDecoder.h" #include "Operand.h" #include "Register.h" +#include "MultiRegister.h" #include "Visitor.h" #include @@ -38,6 +39,11 @@ class printer : public di::Visitor { void visit(di::RegisterAST* r) override { std::cout << " Register '" << r->format(di::defaultStyle) << "'\n"; } + + void visit(di::MultiRegisterAST* r) override { + std::cout << " MultiRegister '" << r->format(di::defaultStyle) << "'\n"; + } + }; void print(di::Instruction const& insn) {