blob: 0dd6d834b7fba6453fddf66837f806cbd7b52019 [file] [log] [blame]
Ian Romanickadfb0cd2010-03-10 10:43:16 -08001/*
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
Eric Anholtac95f2f2010-06-22 10:38:52 -070024#include "ir.h"
Ian Romanickadfb0cd2010-03-10 10:43:16 -080025#include "glsl_parser_extras.h"
Ian Romanick8bde4ce2010-03-19 11:57:24 -070026#include "glsl_symbol_table.h"
Ian Romanickadfb0cd2010-03-10 10:43:16 -080027#include "builtin_variables.h"
28
29#ifndef Elements
30#define Elements(x) (sizeof(x)/sizeof(*(x)))
31#endif
32
Ian Romanick22971e92010-06-29 15:29:56 -070033static void generate_ARB_draw_buffers_variables(exec_list *,
34 struct _mesa_glsl_parse_state *,
35 bool, _mesa_glsl_parser_targets);
Ian Romanick9c4b1f22010-06-29 15:10:09 -070036
Ian Romanickc77b2572010-04-07 16:59:46 -070037static ir_variable *
Ian Romanicked0626e2010-06-21 11:42:57 -070038add_variable(const char *name, enum ir_variable_mode mode, int slot,
Ian Romanick3f9a73d2010-04-02 11:59:57 -070039 const glsl_type *type, exec_list *instructions,
Ian Romanick8bde4ce2010-03-19 11:57:24 -070040 glsl_symbol_table *symtab)
Ian Romanickadfb0cd2010-03-10 10:43:16 -080041{
Ian Romanick7e2aa912010-07-19 17:12:42 -070042 ir_variable *var = new(symtab) ir_variable(type, name, mode);
Ian Romanickadfb0cd2010-03-10 10:43:16 -080043
Eric Anholt71df19f2010-04-19 11:10:37 -070044 switch (var->mode) {
Ian Romanicke2f84f02010-06-29 15:19:11 -070045 case ir_var_auto:
46 var->read_only = true;
47 break;
Eric Anholt71df19f2010-04-19 11:10:37 -070048 case ir_var_in:
49 var->shader_in = true;
Ian Romanickadfb0cd2010-03-10 10:43:16 -080050 var->read_only = true;
Eric Anholt71df19f2010-04-19 11:10:37 -070051 break;
52 case ir_var_inout:
53 var->shader_in = true;
54 var->shader_out = true;
Ian Romanickff236fa2010-04-21 15:08:08 -070055 break;
Eric Anholt71df19f2010-04-19 11:10:37 -070056 case ir_var_out:
57 var->shader_out = true;
58 break;
59 case ir_var_uniform:
60 var->shader_in = true;
61 var->read_only = true;
62 break;
63 default:
64 assert(0);
65 break;
66 }
Ian Romanickadfb0cd2010-03-10 10:43:16 -080067
Ian Romanicked0626e2010-06-21 11:42:57 -070068 var->location = slot;
69
Ian Romanickadfb0cd2010-03-10 10:43:16 -080070 /* Once the variable is created an initialized, add it to the symbol table
71 * and add the declaration to the IR stream.
72 */
73 instructions->push_tail(var);
74
Ian Romanick8bde4ce2010-03-19 11:57:24 -070075 symtab->add_variable(var->name, var);
Ian Romanickc77b2572010-04-07 16:59:46 -070076 return var;
Ian Romanickadfb0cd2010-03-10 10:43:16 -080077}
78
Ian Romanick3f9a73d2010-04-02 11:59:57 -070079
80static void
81add_builtin_variable(const builtin_variable *proto, exec_list *instructions,
82 glsl_symbol_table *symtab)
83{
84 /* Create a new variable declaration from the description supplied by
85 * the caller.
86 */
87 const glsl_type *const type = symtab->get_type(proto->type);
88
89 assert(type != NULL);
90
Ian Romanicked0626e2010-06-21 11:42:57 -070091 add_variable(proto->name, proto->mode, proto->slot, type, instructions,
92 symtab);
Ian Romanick3f9a73d2010-04-02 11:59:57 -070093}
94
Eric Anholtf8946692010-07-20 14:03:35 -070095static void
96add_builtin_constant(exec_list *instructions,
97 struct _mesa_glsl_parse_state *state,
98 const char *name, int value)
99{
100 ir_variable *const var = add_variable(name, ir_var_auto,
101 -1, glsl_type::int_type,
102 instructions, state->symbols);
103 var->constant_value = new(var) ir_constant(value);
104}
Ian Romanick3f9a73d2010-04-02 11:59:57 -0700105
Eric Anholt78fe3c92010-03-28 01:46:48 -0700106static void
107generate_110_uniforms(exec_list *instructions,
Ian Romanick127308b2010-07-01 13:30:50 -0700108 struct _mesa_glsl_parse_state *state)
Eric Anholt78fe3c92010-03-28 01:46:48 -0700109{
110 for (unsigned i = 0
111 ; i < Elements(builtin_110_deprecated_uniforms)
112 ; i++) {
113 add_builtin_variable(& builtin_110_deprecated_uniforms[i],
Ian Romanick127308b2010-07-01 13:30:50 -0700114 instructions, state->symbols);
Eric Anholt78fe3c92010-03-28 01:46:48 -0700115 }
116
Eric Anholtf8946692010-07-20 14:03:35 -0700117 add_builtin_constant(instructions, state, "gl_MaxLights",
118 state->Const.MaxLights);
119 add_builtin_constant(instructions, state, "gl_MaxClipPlanes",
120 state->Const.MaxClipPlanes);
121 add_builtin_constant(instructions, state, "gl_MaxTextureUnits",
122 state->Const.MaxTextureUnits);
123 add_builtin_constant(instructions, state, "gl_MaxTextureCoords",
124 state->Const.MaxTextureCoords);
125 add_builtin_constant(instructions, state, "gl_MaxVertexAttribs",
126 state->Const.MaxVertexAttribs);
127 add_builtin_constant(instructions, state, "gl_MaxVertexUniformComponents",
128 state->Const.MaxVertexUniformComponents);
129 add_builtin_constant(instructions, state, "gl_MaxVaryingFloats",
130 state->Const.MaxVaryingFloats);
131 add_builtin_constant(instructions, state, "gl_MaxVertexTextureImageUnits",
132 state->Const.MaxVertexTextureImageUnits);
133 add_builtin_constant(instructions, state, "gl_MaxCombinedTextureImageUnits",
134 state->Const.MaxCombinedTextureImageUnits);
135 add_builtin_constant(instructions, state, "gl_MaxTextureImageUnits",
136 state->Const.MaxTextureImageUnits);
137 add_builtin_constant(instructions, state, "gl_MaxFragmentUniformComponents",
138 state->Const.MaxFragmentUniformComponents);
Ian Romanick127308b2010-07-01 13:30:50 -0700139
Ian Romanick3eba5932010-04-26 14:59:32 -0700140 const glsl_type *const mat4_array_type =
Ian Romanickf38d15b2010-07-20 15:33:40 -0700141 glsl_type::get_array_instance(glsl_type::mat4_type,
Ian Romanick127308b2010-07-01 13:30:50 -0700142 state->Const.MaxTextureCoords);
Ian Romanick3eba5932010-04-26 14:59:32 -0700143
Ian Romanicked0626e2010-06-21 11:42:57 -0700144 add_variable("gl_TextureMatrix", ir_var_uniform, -1, mat4_array_type,
Ian Romanick127308b2010-07-01 13:30:50 -0700145 instructions, state->symbols);
Eric Anholt78fe3c92010-03-28 01:46:48 -0700146
147 /* FINISHME: Add support for gl_DepthRangeParameters */
148 /* FINISHME: Add support for gl_ClipPlane[] */
149 /* FINISHME: Add support for gl_PointParameters */
150
151 /* FINISHME: Add support for gl_MaterialParameters
152 * FINISHME: (glFrontMaterial, glBackMaterial)
153 */
154
Eric Anholtaa579432010-05-19 14:09:04 -0700155 /* FINISHME: The size of this array is implementation dependent based on the
156 * FINISHME: value of GL_MAX_TEXTURE_LIGHTS. GL_MAX_TEXTURE_LIGHTS must be
157 * FINISHME: at least 8, so hard-code 8 for now.
158 */
159 const glsl_type *const light_source_array_type =
Ian Romanickf38d15b2010-07-20 15:33:40 -0700160 glsl_type::get_array_instance(state->symbols->get_type("gl_LightSourceParameters"), 8);
Eric Anholtaa579432010-05-19 14:09:04 -0700161
Ian Romanicked0626e2010-06-21 11:42:57 -0700162 add_variable("gl_LightSource", ir_var_uniform, -1, light_source_array_type,
Ian Romanick127308b2010-07-01 13:30:50 -0700163 instructions, state->symbols);
Eric Anholtaa579432010-05-19 14:09:04 -0700164
Eric Anholt78fe3c92010-03-28 01:46:48 -0700165 /* FINISHME: Add support for gl_LightModel */
166 /* FINISHME: Add support for gl_FrontLightProduct[], gl_BackLightProduct[] */
167 /* FINISHME: Add support for gl_TextureEnvColor[] */
168 /* FINISHME: Add support for gl_ObjectPlane*[], gl_EyePlane*[] */
169 /* FINISHME: Add support for gl_Fog */
170}
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800171
172static void
173generate_110_vs_variables(exec_list *instructions,
Ian Romanick22971e92010-06-29 15:29:56 -0700174 struct _mesa_glsl_parse_state *state)
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800175{
176 for (unsigned i = 0; i < Elements(builtin_core_vs_variables); i++) {
177 add_builtin_variable(& builtin_core_vs_variables[i],
Ian Romanick22971e92010-06-29 15:29:56 -0700178 instructions, state->symbols);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800179 }
180
181 for (unsigned i = 0
182 ; i < Elements(builtin_110_deprecated_vs_variables)
183 ; i++) {
184 add_builtin_variable(& builtin_110_deprecated_vs_variables[i],
Ian Romanick22971e92010-06-29 15:29:56 -0700185 instructions, state->symbols);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800186 }
Ian Romanick127308b2010-07-01 13:30:50 -0700187 generate_110_uniforms(instructions, state);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800188
Ian Romanickcd00d5b2010-07-01 13:17:54 -0700189 /* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec:
190 *
191 * "As with all arrays, indices used to subscript gl_TexCoord must
192 * either be an integral constant expressions, or this array must be
193 * re-declared by the shader with a size. The size can be at most
194 * gl_MaxTextureCoords. Using indexes close to 0 may aid the
195 * implementation in preserving varying resources."
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800196 */
Ian Romanick3f9a73d2010-04-02 11:59:57 -0700197 const glsl_type *const vec4_array_type =
Ian Romanickf38d15b2010-07-20 15:33:40 -0700198 glsl_type::get_array_instance(glsl_type::vec4_type, 0);
Ian Romanick3f9a73d2010-04-02 11:59:57 -0700199
Ian Romanicked0626e2010-06-21 11:42:57 -0700200 add_variable("gl_TexCoord", ir_var_out, VERT_RESULT_TEX0, vec4_array_type,
Ian Romanick22971e92010-06-29 15:29:56 -0700201 instructions, state->symbols);
202
203 generate_ARB_draw_buffers_variables(instructions, state, false,
204 vertex_shader);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800205}
206
207
208static void
209generate_120_vs_variables(exec_list *instructions,
Ian Romanick22971e92010-06-29 15:29:56 -0700210 struct _mesa_glsl_parse_state *state)
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800211{
212 /* GLSL version 1.20 did not add any built-in variables in the vertex
213 * shader.
214 */
Ian Romanick22971e92010-06-29 15:29:56 -0700215 generate_110_vs_variables(instructions, state);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800216}
217
218
219static void
220generate_130_vs_variables(exec_list *instructions,
Ian Romanick22971e92010-06-29 15:29:56 -0700221 struct _mesa_glsl_parse_state *state)
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800222{
Ian Romanick22971e92010-06-29 15:29:56 -0700223 generate_120_vs_variables(instructions, state);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800224
225 for (unsigned i = 0; i < Elements(builtin_130_vs_variables); i++) {
226 add_builtin_variable(& builtin_130_vs_variables[i],
Ian Romanick22971e92010-06-29 15:29:56 -0700227 instructions, state->symbols);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800228 }
229
Eric Anholt271e1992010-04-02 23:47:06 -0700230 /* FINISHME: The size of this array is implementation dependent based on
231 * FINISHME: the value of GL_MAX_CLIP_DISTANCES.
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800232 */
Eric Anholt271e1992010-04-02 23:47:06 -0700233 const glsl_type *const clip_distance_array_type =
Ian Romanickf38d15b2010-07-20 15:33:40 -0700234 glsl_type::get_array_instance(glsl_type::float_type, 8);
Ian Romanicked0626e2010-06-21 11:42:57 -0700235
236 /* FINISHME: gl_ClipDistance needs a real location assigned. */
237 add_variable("gl_ClipDistance", ir_var_out, -1, clip_distance_array_type,
Ian Romanick22971e92010-06-29 15:29:56 -0700238 instructions, state->symbols);
Eric Anholt271e1992010-04-02 23:47:06 -0700239
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800240}
241
242
243static void
244initialize_vs_variables(exec_list *instructions,
245 struct _mesa_glsl_parse_state *state)
246{
247
248 switch (state->language_version) {
249 case 110:
Ian Romanick22971e92010-06-29 15:29:56 -0700250 generate_110_vs_variables(instructions, state);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800251 break;
252 case 120:
Ian Romanick22971e92010-06-29 15:29:56 -0700253 generate_120_vs_variables(instructions, state);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800254 break;
255 case 130:
Ian Romanick22971e92010-06-29 15:29:56 -0700256 generate_130_vs_variables(instructions, state);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800257 break;
258 }
259}
260
Eric Anholtb3f743a2010-03-25 14:48:25 -0700261static void
262generate_110_fs_variables(exec_list *instructions,
Ian Romanick5e18b052010-06-29 14:21:05 -0700263 struct _mesa_glsl_parse_state *state)
Eric Anholtb3f743a2010-03-25 14:48:25 -0700264{
265 for (unsigned i = 0; i < Elements(builtin_core_fs_variables); i++) {
266 add_builtin_variable(& builtin_core_fs_variables[i],
Ian Romanick5e18b052010-06-29 14:21:05 -0700267 instructions, state->symbols);
Eric Anholtb3f743a2010-03-25 14:48:25 -0700268 }
269
Eric Anholt0f09aea2010-03-27 12:48:57 -0700270 for (unsigned i = 0
271 ; i < Elements(builtin_110_deprecated_fs_variables)
272 ; i++) {
273 add_builtin_variable(& builtin_110_deprecated_fs_variables[i],
Ian Romanick5e18b052010-06-29 14:21:05 -0700274 instructions, state->symbols);
Eric Anholt0f09aea2010-03-27 12:48:57 -0700275 }
Ian Romanick127308b2010-07-01 13:30:50 -0700276 generate_110_uniforms(instructions, state);
Eric Anholt0f09aea2010-03-27 12:48:57 -0700277
Ian Romanickcd00d5b2010-07-01 13:17:54 -0700278 /* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec:
279 *
280 * "As with all arrays, indices used to subscript gl_TexCoord must
281 * either be an integral constant expressions, or this array must be
282 * re-declared by the shader with a size. The size can be at most
283 * gl_MaxTextureCoords. Using indexes close to 0 may aid the
284 * implementation in preserving varying resources."
Ian Romanick3f9a73d2010-04-02 11:59:57 -0700285 */
Ian Romanick3f9a73d2010-04-02 11:59:57 -0700286 const glsl_type *const vec4_array_type =
Ian Romanickf38d15b2010-07-20 15:33:40 -0700287 glsl_type::get_array_instance(glsl_type::vec4_type, 0);
Ian Romanick3f9a73d2010-04-02 11:59:57 -0700288
Ian Romanicked0626e2010-06-21 11:42:57 -0700289 add_variable("gl_TexCoord", ir_var_in, FRAG_ATTRIB_TEX0, vec4_array_type,
Ian Romanick5e18b052010-06-29 14:21:05 -0700290 instructions, state->symbols);
Ian Romanick9c4b1f22010-06-29 15:10:09 -0700291
Ian Romanick22971e92010-06-29 15:29:56 -0700292 generate_ARB_draw_buffers_variables(instructions, state, false,
293 fragment_shader);
Eric Anholtb3f743a2010-03-25 14:48:25 -0700294}
295
Ian Romanickc77b2572010-04-07 16:59:46 -0700296
297static void
Ian Romanick22971e92010-06-29 15:29:56 -0700298generate_ARB_draw_buffers_variables(exec_list *instructions,
299 struct _mesa_glsl_parse_state *state,
300 bool warn, _mesa_glsl_parser_targets target)
Ian Romanickc77b2572010-04-07 16:59:46 -0700301{
Ian Romanick22971e92010-06-29 15:29:56 -0700302 /* gl_MaxDrawBuffers is available in all shader stages.
303 */
Ian Romanicke2f84f02010-06-29 15:19:11 -0700304 ir_variable *const mdb =
305 add_variable("gl_MaxDrawBuffers", ir_var_auto, -1,
306 glsl_type::int_type, instructions, state->symbols);
307
308 if (warn)
309 mdb->warn_extension = "GL_ARB_draw_buffers";
310
311 mdb->constant_value = new(mdb)
312 ir_constant(int(state->Const.MaxDrawBuffers));
313
Ian Romanickc77b2572010-04-07 16:59:46 -0700314
Ian Romanick22971e92010-06-29 15:29:56 -0700315 /* gl_FragData is only available in the fragment shader.
316 */
317 if (target == fragment_shader) {
318 const glsl_type *const vec4_array_type =
Ian Romanickf38d15b2010-07-20 15:33:40 -0700319 glsl_type::get_array_instance(glsl_type::vec4_type,
Ian Romanick22971e92010-06-29 15:29:56 -0700320 state->Const.MaxDrawBuffers);
Ian Romanickc77b2572010-04-07 16:59:46 -0700321
Ian Romanick22971e92010-06-29 15:29:56 -0700322 ir_variable *const fd =
323 add_variable("gl_FragData", ir_var_out, FRAG_RESULT_DATA0,
324 vec4_array_type, instructions, state->symbols);
325
326 if (warn)
327 fd->warn_extension = "GL_ARB_draw_buffers";
328 }
Ian Romanickc77b2572010-04-07 16:59:46 -0700329}
330
331
Eric Anholtb3f743a2010-03-25 14:48:25 -0700332static void
333generate_120_fs_variables(exec_list *instructions,
Ian Romanick5e18b052010-06-29 14:21:05 -0700334 struct _mesa_glsl_parse_state *state)
Eric Anholtb3f743a2010-03-25 14:48:25 -0700335{
Ian Romanick5e18b052010-06-29 14:21:05 -0700336 generate_110_fs_variables(instructions, state);
Eric Anholt152b55e2010-07-07 19:45:22 -0700337
338 for (unsigned i = 0
339 ; i < Elements(builtin_120_fs_variables)
340 ; i++) {
341 add_builtin_variable(& builtin_120_fs_variables[i],
342 instructions, state->symbols);
343 }
Eric Anholtb3f743a2010-03-25 14:48:25 -0700344}
345
346static void
347generate_130_fs_variables(exec_list *instructions,
Ian Romanick5e18b052010-06-29 14:21:05 -0700348 struct _mesa_glsl_parse_state *state)
Eric Anholtb3f743a2010-03-25 14:48:25 -0700349{
Ian Romanick5e18b052010-06-29 14:21:05 -0700350 generate_120_fs_variables(instructions, state);
Eric Anholtb3f743a2010-03-25 14:48:25 -0700351
Ian Romanick8645a952010-04-07 16:47:44 -0700352 /* FINISHME: The size of this array is implementation dependent based on
353 * FINISHME: the value of GL_MAX_CLIP_DISTANCES.
Eric Anholtb3f743a2010-03-25 14:48:25 -0700354 */
Ian Romanick8645a952010-04-07 16:47:44 -0700355 const glsl_type *const clip_distance_array_type =
Ian Romanickf38d15b2010-07-20 15:33:40 -0700356 glsl_type::get_array_instance(glsl_type::float_type, 8);
Ian Romanicked0626e2010-06-21 11:42:57 -0700357
358 /* FINISHME: gl_ClipDistance needs a real location assigned. */
359 add_variable("gl_ClipDistance", ir_var_in, -1, clip_distance_array_type,
Ian Romanick5e18b052010-06-29 14:21:05 -0700360 instructions, state->symbols);
Eric Anholtb3f743a2010-03-25 14:48:25 -0700361}
362
363static void
364initialize_fs_variables(exec_list *instructions,
365 struct _mesa_glsl_parse_state *state)
366{
367
368 switch (state->language_version) {
369 case 110:
Ian Romanick5e18b052010-06-29 14:21:05 -0700370 generate_110_fs_variables(instructions, state);
Eric Anholtb3f743a2010-03-25 14:48:25 -0700371 break;
372 case 120:
Ian Romanick5e18b052010-06-29 14:21:05 -0700373 generate_120_fs_variables(instructions, state);
Eric Anholtb3f743a2010-03-25 14:48:25 -0700374 break;
375 case 130:
Ian Romanick5e18b052010-06-29 14:21:05 -0700376 generate_130_fs_variables(instructions, state);
Eric Anholtb3f743a2010-03-25 14:48:25 -0700377 break;
378 }
379}
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800380
381void
382_mesa_glsl_initialize_variables(exec_list *instructions,
383 struct _mesa_glsl_parse_state *state)
384{
385 switch (state->target) {
386 case vertex_shader:
387 initialize_vs_variables(instructions, state);
388 break;
389 case geometry_shader:
Eric Anholtb3f743a2010-03-25 14:48:25 -0700390 break;
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800391 case fragment_shader:
Eric Anholtb3f743a2010-03-25 14:48:25 -0700392 initialize_fs_variables(instructions, state);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800393 break;
Eric Anholt81f49a72010-04-29 17:57:28 -0700394 case ir_shader:
395 fprintf(stderr, "ir reader has no builtin variables");
396 exit(1);
397 break;
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800398 }
399}