-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcfg_transform.h
More file actions
43 lines (34 loc) · 1.12 KB
/
cfg_transform.h
File metadata and controls
43 lines (34 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#ifndef CFG_TRANSFORM_H
#define CFG_TRANSFORM_H
#include "cfg.h"
#include "live_vregs.h"
class ControlFlowGraph;
class ControlFlowGraphTransform {
private:
ControlFlowGraph* m_cfg;
LiveVregs* m_live_vregs;
ControlFlowGraph* prune(ControlFlowGraph* cfg);
InstructionSequence* prune_basic_block(BasicBlock* iseq);
public:
ControlFlowGraphTransform(ControlFlowGraph* cfg);
virtual ~ControlFlowGraphTransform();
ControlFlowGraph* get_orig_cfg();
ControlFlowGraph* transform_cfg();
virtual InstructionSequence* transform_basic_block(InstructionSequence* iseq) = 0;
};
class HighLevelControlFlowGraphTransform : public ControlFlowGraphTransform {
private:
ControlFlowGraph* m_cfg;
public:
using ControlFlowGraphTransform::ControlFlowGraphTransform;
InstructionSequence* transform_basic_block(InstructionSequence* iseq) override;
};
class X86_64ControlFlowGraphTransform : public ControlFlowGraphTransform {
private:
ControlFlowGraph* m_cfg;
public:
using ControlFlowGraphTransform::ControlFlowGraphTransform;
InstructionSequence* transform_basic_block(InstructionSequence* iseq) override;
};
#endif // CFG_TRANSFORM_H