ROSE 0.11.145.147
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
9namespace Rose {
10namespace BinaryAnalysis {
11namespace Unparser {
12
13std::string unparseCilMnemonic(SgAsmCilInstruction*);
14std::string unparseCilExpression(SgAsmExpression*, const LabelMap*);
15
17struct CilSettings: public Settings {};
18
20class Cil: public Base {
21 CilSettings settings_;
22
23protected:
24 explicit Cil(const Architecture::BaseConstPtr&, const CilSettings&);
25
26public:
27 ~Cil();
28
29 static Ptr instance(const Architecture::BaseConstPtr&, const CilSettings& = CilSettings());
30
31 Ptr copy() const override;
32
33 const CilSettings& settings() const override { return settings_; }
34 CilSettings& settings() override { return settings_; }
35
36protected:
37 void emitInstruction(std::ostream&, SgAsmInstruction*, State&) const override;
38 void emitOperandBody(std::ostream&, SgAsmExpression*, State&) const override;
39
40private:
41 void outputExpr(std::ostream&, SgAsmExpression*, State&) const;
42};
43
44} // namespace
45} // namespace
46} // namespace
47
48#endif
49#endif
Abstract base class for unparsers.
const CilSettings & settings() const override
Property: Settings associated with this unparser.
void emitOperandBody(std::ostream &, SgAsmExpression *, State &) const override
Mid-level unparser function.
void emitInstruction(std::ostream &, SgAsmInstruction *, State &) const override
Mid-level unparser function.
CilSettings & settings() override
Property: Settings associated with this unparser.
Base class for expressions.
Base class for machine instructions.
std::shared_ptr< const Base > BaseConstPtr
Reference counted pointer for Architecture::Base.
std::map< uint64_t, std::string > LabelMap
Map from address to label.
The ROSE library.
Settings specific to the Cil unaprser.
Settings that control unparsing.