Index: src/a64/decoder-a64.h |
diff --git a/src/a64/decoder-a64.h b/src/a64/decoder-a64.h |
index 1a7f6c40903e2e0c9bb6f128a8fec0c2f065f343..56f9ba731bf21042fa756d8934ae04f6cb1f2a20 100644 |
--- a/src/a64/decoder-a64.h |
+++ b/src/a64/decoder-a64.h |
@@ -97,13 +97,11 @@ class DecoderVisitor { |
}; |
-class Decoder { |
+// A visitor that dispatches to a list of visitors. |
+class DispatchingDecoderVisitor : public DecoderVisitor { |
public: |
- Decoder() {} |
- |
- // Top-level instruction decoder function. Decodes an instruction and calls |
- // the visitor functions registered with the Decoder class. |
- void Decode(Instruction *instr); |
+ DispatchingDecoderVisitor() {} |
+ virtual ~DispatchingDecoderVisitor() {} |
// Register a new visitor class with the decoder. |
// Decode() will call the corresponding visitor method from all registered |
@@ -139,6 +137,20 @@ class Decoder { |
#undef DECLARE |
private: |
+ // Visitors are registered in a list. |
+ std::list<DecoderVisitor*> visitors_; |
+}; |
+ |
+ |
+class Decoder : public DispatchingDecoderVisitor { |
+ public: |
+ Decoder() {} |
+ |
+ // Top-level instruction decoder function. Decodes an instruction and calls |
+ // the visitor functions registered with the Decoder class. |
+ void Decode(Instruction *instr); |
+ |
+ private: |
// Decode the PC relative addressing instruction, and call the corresponding |
// visitors. |
// On entry, instruction bits 27:24 = 0x0. |
@@ -188,9 +200,6 @@ class Decoder { |
// tree, and call the corresponding visitors. |
// On entry, instruction bits 27:25 = 0x7. |
void DecodeAdvSIMDDataProcessing(Instruction* instr); |
- |
- // Visitors are registered in a list. |
- std::list<DecoderVisitor*> visitors_; |
}; |