Code Listener  [unstable] git snapshot
cl.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 Kamil Dudka <kdudka@redhat.com>
3  *
4  * This file is part of predator.
5  *
6  * predator is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * any later version.
10  *
11  * predator is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with predator. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef H_GUARD_CL_H
21 #define H_GUARD_CL_H
22 
23 /**
24  * @file cl.hh
25  * ICodeListener interface
26  */
27 
28 #include <cl/code_listener.h>
29 
30 /**
31  * C++ interface for listener objects. It can be wrapped to struct
32  * cl_code_listener object when exposing to pure C world.
33  *
34  * @copydoc cl_code_listener
35  */
37  public:
38  virtual ~ICodeListener() { }
39 
40  /// See cl_code_listener::file_open
41  virtual void file_open(
42  const char *file_name)
43  = 0;
44 
45  /// See cl_code_listener::file_close
46  virtual void file_close()
47  = 0;
48 
49  /// See cl_code_listener::fnc_open
50  virtual void fnc_open(
51  const struct cl_operand *fnc)
52  = 0;
53 
54  /// See cl_code_listener::fnc_arg_decl
55  virtual void fnc_arg_decl(
56  int arg_id,
57  const struct cl_operand *arg_src)
58  = 0;
59 
60  /// See cl_code_listener::fnc_close
61  virtual void fnc_close()
62  = 0;
63 
64  /// See cl_code_listener::bb_open
65  virtual void bb_open(
66  const char *bb_name)
67  = 0;
68 
69  /// See cl_code_listener::insn
70  virtual void insn(
71  const struct cl_insn *cli)
72  = 0;
73 
74  /// See cl_code_listener::insn_call_open
75  virtual void insn_call_open(
76  const struct cl_loc *loc,
77  const struct cl_operand *dst,
78  const struct cl_operand *fnc)
79  = 0;
80 
81  /// See cl_code_listener::insn_call_arg
82  virtual void insn_call_arg(
83  int arg_id,
84  const struct cl_operand *arg_src)
85  = 0;
86 
87  /// See cl_code_listener::insn_call_close
88  virtual void insn_call_close()
89  = 0;
90 
91  /// See cl_code_listener::insn_switch_open
92  virtual void insn_switch_open(
93  const struct cl_loc *loc,
94  const struct cl_operand *src)
95  = 0;
96 
97  /// See cl_code_listener::insn_switch_case
98  virtual void insn_switch_case(
99  const struct cl_loc *loc,
100  const struct cl_operand *val_lo,
101  const struct cl_operand *val_hi,
102  const char *label)
103  = 0;
104 
105  /// See cl_code_listener::insn_switch_close
106  virtual void insn_switch_close()
107  = 0;
108 
109  /// See cl_code_listener::acknowledge
110  virtual void acknowledge()
111  = 0;
112 };
113 
114 #endif /* H_GUARD_CL_H */