SymEval for POWER: WIP
[dyninst.git] / symEval / rose / SgAsmPowerpcInstruction.h
1 //
2 // C++ Interface: SgAsmPowerpcInstruction
3 //
4 // Description: 
5 //
6 //
7 // Author: Bill Williams <bill@follis.cs.wisc.edu>, (C) 2010
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12
13 #if !defined(SG_ASM_POWERPC_INSN_H)
14 #define SG_ASM_POWERPC_INSN_H
15
16 #include "external/rose/rose-compat.h"
17 #include "typedefs.h"
18 #include "SgNode.h"
19 #include "SgAsmOperandList.h"
20 #include "powerpcInstructionEnum.h"
21
22 // Class Definition for SgAsmPowerpcInstruction
23 class SgAsmPowerpcInstruction : public SgNode
24 {
25
26     public:
27         rose_addr_t get_address() const;
28         void set_address(rose_addr_t addr);
29         void set_mnemonic(std::string mnem);
30         std::string get_mnemonic() const;
31         void set_operandSize(X86InstructionSize) {}
32         void set_addressSize(X86InstructionSize) {}
33         void set_raw_bytes(std::vector<unsigned char> bytes);
34         SgUnsignedCharList get_raw_bytes() const;
35         virtual SgAsmOperandList* get_operandList() const;
36         void set_operandList(SgAsmOperandList* operands);
37         /*! \brief returns a string representing the class name */
38         virtual std::string class_name() const;
39
40         /*! \brief returns new style SageIII enum values */
41         virtual VariantT variantT() const; // MS: new variant used in tree traversal
42
43         /*! \brief static variant value */
44         static const VariantT static_variant = V_SgAsmPowerpcInstruction;
45
46         /* the generated cast function */
47         /*! \brief Casts pointer from base class to derived class */
48         friend       SgAsmPowerpcInstruction* isSgAsmPowerpcInstruction(       SgNode * s );
49         /*! \brief Casts pointer from base class to derived class (for const pointers) */
50         friend const SgAsmPowerpcInstruction* isSgAsmPowerpcInstruction( const SgNode * s );
51
52     public:
53         PowerpcInstructionKind get_kind() const;
54         void set_kind(PowerpcInstructionKind kind);
55
56
57     public:
58         virtual ~SgAsmPowerpcInstruction() {}
59
60
61     public:
62         SgAsmPowerpcInstruction(rose_addr_t address = 0, std::string mnemonic = "", PowerpcInstructionKind kind =
63                 powerpc_unknown_instruction);
64
65     protected:
66         unsigned int p_address;
67         PowerpcInstructionKind p_kind;
68         SgAsmOperandList* p_operandList;
69         std::string p_mnemonic;
70         SgUnsignedCharList p_raw_bytes;
71 };
72
73    const char* regclassToString(PowerpcRegisterClass n);
74
75    
76 #endif //!defined(SG_ASM_POWERPC_INSN_H)