ROSE  0.11.145.0
Unparser/Cil.h
1 #ifndef ROSE_BinaryAnalysis_Unparser_Cil_H
2 #define ROSE_BinaryAnalysis_Unparser_Cil_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 unparseCilMnemonic(SgAsmCilInstruction*);
14 std::string unparseCilExpression(SgAsmExpression*, const LabelMap*, RegisterDictionaryPtr);
15 
17 struct CilSettings: public Settings {};
18 
20 class Cil: public Base {
21  CilSettings settings_;
22 
23 protected:
24  explicit Cil(const CilSettings &settings)
25  : settings_(settings) {}
26 
27 public:
28  static Ptr instance(const CilSettings &settings = CilSettings()) {
29  return Ptr(new Cil(settings));
30  }
31 
32  Ptr copy() const override {
33  return instance(settings());
34  }
35 
36  const CilSettings& settings() const override { return settings_; }
37  CilSettings& 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
Base class for machine instructions.
Sawyer::SharedPointer< RegisterDictionary > RegisterDictionaryPtr
Reference counting pointer.
Main namespace for the ROSE library.
Settings that control unparsing.
Base class for expressions.
Settings specific to the Cil unaprser.
Definition: Unparser/Cil.h:17