blob: ad474878355e11b6b84dd094d5124f674a9637e3 [file] [log] [blame]
Ian Romanick8895bae2010-05-14 12:39:23 -07001/*
2 * Copyright © 2010 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23#define NULL 0
24#include "ir.h"
25#include "ir_hierarchical_visitor.h"
26
27ir_visitor_status
28ir_hierarchical_visitor::visit(ir_variable *ir)
29{
30 (void) ir;
31 return visit_continue;
32}
33
34ir_visitor_status
35ir_hierarchical_visitor::visit(ir_constant *ir)
36{
37 (void) ir;
38 return visit_continue;
39}
40
41ir_visitor_status
42ir_hierarchical_visitor::visit(ir_loop_jump *ir)
43{
44 (void) ir;
45 return visit_continue;
46}
47
48ir_visitor_status
Ian Romanickf3a002b2010-05-19 12:02:19 +020049ir_hierarchical_visitor::visit(ir_dereference_variable *ir)
50{
51 (void) ir;
52 return visit_continue;
53}
54
55ir_visitor_status
Ian Romanick8895bae2010-05-14 12:39:23 -070056ir_hierarchical_visitor::visit_enter(ir_loop *ir)
57{
58 (void) ir;
59 return visit_continue;
60}
61
62ir_visitor_status
63ir_hierarchical_visitor::visit_leave(ir_loop *ir)
64{
65 (void) ir;
66 return visit_continue;
67}
68
69ir_visitor_status
70ir_hierarchical_visitor::visit_enter(ir_function_signature *ir)
71{
72 (void) ir;
73 return visit_continue;
74}
75
76ir_visitor_status
77ir_hierarchical_visitor::visit_leave(ir_function_signature *ir)
78{
79 (void) ir;
80 return visit_continue;
81}
82
83ir_visitor_status
84ir_hierarchical_visitor::visit_enter(ir_function *ir)
85{
86 (void) ir;
87 return visit_continue;
88}
89
90ir_visitor_status
91ir_hierarchical_visitor::visit_leave(ir_function *ir)
92{
93 (void) ir;
94 return visit_continue;
95}
96
97ir_visitor_status
98ir_hierarchical_visitor::visit_enter(ir_expression *ir)
99{
100 (void) ir;
101 return visit_continue;
102}
103
104ir_visitor_status
105ir_hierarchical_visitor::visit_leave(ir_expression *ir)
106{
107 (void) ir;
108 return visit_continue;
109}
110
111ir_visitor_status
112ir_hierarchical_visitor::visit_enter(ir_swizzle *ir)
113{
114 (void) ir;
115 return visit_continue;
116}
117
118ir_visitor_status
119ir_hierarchical_visitor::visit_leave(ir_swizzle *ir)
120{
121 (void) ir;
122 return visit_continue;
123}
124
125ir_visitor_status
Ian Romanickf3a002b2010-05-19 12:02:19 +0200126ir_hierarchical_visitor::visit_enter(ir_dereference_array *ir)
Ian Romanick8895bae2010-05-14 12:39:23 -0700127{
128 (void) ir;
129 return visit_continue;
130}
131
132ir_visitor_status
Ian Romanickf3a002b2010-05-19 12:02:19 +0200133ir_hierarchical_visitor::visit_leave(ir_dereference_array *ir)
134{
135 (void) ir;
136 return visit_continue;
137}
138
139ir_visitor_status
140ir_hierarchical_visitor::visit_enter(ir_dereference_record *ir)
141{
142 (void) ir;
143 return visit_continue;
144}
145
146ir_visitor_status
147ir_hierarchical_visitor::visit_leave(ir_dereference_record *ir)
Ian Romanick8895bae2010-05-14 12:39:23 -0700148{
149 (void) ir;
150 return visit_continue;
151}
152
153ir_visitor_status
154ir_hierarchical_visitor::visit_enter(ir_assignment *ir)
155{
156 (void) ir;
157 return visit_continue;
158}
159
160ir_visitor_status
161ir_hierarchical_visitor::visit_leave(ir_assignment *ir)
162{
163 (void) ir;
164 return visit_continue;
165}
166
167ir_visitor_status
168ir_hierarchical_visitor::visit_enter(ir_call *ir)
169{
170 (void) ir;
171 return visit_continue;
172}
173
174ir_visitor_status
175ir_hierarchical_visitor::visit_leave(ir_call *ir)
176{
177 (void) ir;
178 return visit_continue;
179}
180
181ir_visitor_status
182ir_hierarchical_visitor::visit_enter(ir_return *ir)
183{
184 (void) ir;
185 return visit_continue;
186}
187
188ir_visitor_status
189ir_hierarchical_visitor::visit_leave(ir_return *ir)
190{
191 (void) ir;
192 return visit_continue;
193}
194
195ir_visitor_status
196ir_hierarchical_visitor::visit_enter(ir_if *ir)
197{
198 (void) ir;
199 return visit_continue;
200}
201
202ir_visitor_status
203ir_hierarchical_visitor::visit_leave(ir_if *ir)
204{
205 (void) ir;
206 return visit_continue;
207}
208
209void
210ir_hierarchical_visitor::run(exec_list *instructions)
211{
212 foreach_list(n, instructions) {
213 ir_instruction *ir = (ir_instruction *) n;
214
215 if (ir->accept(this) != visit_continue)
216 break;
217 }
218}