ROSE  0.11.2.0
BinaryUnparserArm.h
1 #ifndef ROSE_BinaryAnalysis_UnparserArm_H
2 #define ROSE_BinaryAnalysis_UnparserArm_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_ASM_A64
5 
6 #include <BinaryUnparserBase.h>
7 
8 namespace Rose {
9 namespace BinaryAnalysis {
10 namespace Unparser {
11 
12 struct ArmSettings: public Settings {};
13 
17 class Arm: public Base {
18  ArmSettings settings_;
19 
20 protected:
21  explicit Arm(const ArmSettings &settings)
22  : settings_(settings) {}
23 
24 public:
25  ~Arm() {}
26 
27  static Ptr instance(const ArmSettings &settings = ArmSettings()) {
28  return Ptr(new Arm(settings));
29  }
30 
31  Ptr copy() const ROSE_OVERRIDE {
32  return instance(settings());
33  }
34 
35  const ArmSettings& settings() const ROSE_OVERRIDE { return settings_; }
36  ArmSettings& settings() ROSE_OVERRIDE { return settings_; }
37 
38 protected:
39  void emitInstructionMnemonic(std::ostream&, SgAsmInstruction*, State&) const ROSE_OVERRIDE;
40  void emitOperandBody(std::ostream&, SgAsmExpression*, State&) const ROSE_OVERRIDE;
41 
42 protected:
43  static std::string unparseArmCondition(A64InstructionCondition);
44  void outputExpr(std::ostream&, SgAsmExpression*, State&) const;
45  void outputRegister(std::ostream&, SgAsmRegisterReferenceExpression*, State&) const;
46 };
47 
48 } // namespace
49 } // namespace
50 } // namespace
51 
52 #endif
53 #endif
Sawyer::SharedPointer< Node > Ptr
Shared-ownership pointer to an expression Node.
Base class for references to a machine register.
void copy(const Word *src, const BitRange &srcRange, Word *dst, const BitRange &dstRange)
Copy some bits.
Base class for machine instructions.
STL namespace.
Main namespace for the ROSE library.
Base class for expressions.