ROSE  0.11.145.0
Unparser/Powerpc.h
1 #ifndef ROSE_BinaryAnalysis_Unparser_Powerpc_H
2 #define ROSE_BinaryAnalysis_Unparser_Powerpc_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 #include <Rose/BinaryAnalysis/Unparser/Base.h>
6 
7 #include <Rose/BinaryAnalysis/BasicTypes.h>
8 
9 namespace Rose {
10 namespace BinaryAnalysis {
11 namespace Unparser {
12 
13 std::string unparsePowerpcMnemonic(SgAsmPowerpcInstruction*);
14 std::string unparsePowerpcExpression(SgAsmExpression*, const LabelMap*, const RegisterDictionaryPtr&);
15 
17 struct PowerpcSettings: public Settings {};
18 
20 class Powerpc: public Base {
21  PowerpcSettings settings_;
22 
23 protected:
24  explicit Powerpc(const PowerpcSettings &settings)
25  : settings_(settings) {}
26 
27 public:
28  static Ptr instance(const PowerpcSettings &settings = PowerpcSettings()) {
29  return Ptr(new Powerpc(settings));
30  }
31 
32  Ptr copy() const override {
33  return instance(settings());
34  }
35 
36  const PowerpcSettings& settings() const override { return settings_; }
37  PowerpcSettings& settings() override { return settings_; }
38 
39 protected:
40  void emitInstruction(std::ostream&, SgAsmInstruction*, State&) const override;
41  void emitOperandBody(std::ostream&, SgAsmExpression*, State&) const override;
42 
43 private:
44  void outputExpr(std::ostream&, SgAsmExpression*, State&) const;
45 };
46 
47 } // namespace
48 } // namespace
49 } // namespace
50 
51 #endif
52 #endif
Settings specific to the PowerPC unparser.
Unparser for PowerPC instruction sets.
Base class for machine instructions.
Sawyer::SharedPointer< RegisterDictionary > RegisterDictionaryPtr
Reference counting pointer.
Main namespace for the ROSE library.
Settings that control unparsing.
Represents one PowerPC machine instruction.
Base class for expressions.