blob: 4593c1811278c2d23d024ad1e5b9137a3657d39b [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{
Carl Worth1660a292010-06-23 18:11:51 -070042 ir_variable *var = new(symtab) ir_variable(type, name);
Ian Romanickadfb0cd2010-03-10 10:43:16 -080043
Ian Romanick3f9a73d2010-04-02 11:59:57 -070044 var->mode = mode;
Eric Anholt71df19f2010-04-19 11:10:37 -070045 switch (var->mode) {
Ian Romanicke2f84f02010-06-29 15:19:11 -070046 case ir_var_auto:
47 var->read_only = true;
48 break;
Eric Anholt71df19f2010-04-19 11:10:37 -070049 case ir_var_in:
50 var->shader_in = true;
Ian Romanickadfb0cd2010-03-10 10:43:16 -080051 var->read_only = true;
Eric Anholt71df19f2010-04-19 11:10:37 -070052 break;
53 case ir_var_inout:
54 var->shader_in = true;
55 var->shader_out = true;
Ian Romanickff236fa2010-04-21 15:08:08 -070056 break;
Eric Anholt71df19f2010-04-19 11:10:37 -070057 case ir_var_out:
58 var->shader_out = true;
59 break;
60 case ir_var_uniform:
61 var->shader_in = true;
62 var->read_only = true;
63 break;
64 default:
65 assert(0);
66 break;
67 }
Ian Romanickadfb0cd2010-03-10 10:43:16 -080068
Ian Romanicked0626e2010-06-21 11:42:57 -070069 var->location = slot;
70
Ian Romanickadfb0cd2010-03-10 10:43:16 -080071 /* Once the variable is created an initialized, add it to the symbol table
72 * and add the declaration to the IR stream.
73 */
74 instructions->push_tail(var);
75
Ian Romanick8bde4ce2010-03-19 11:57:24 -070076 symtab->add_variable(var->name, var);
Ian Romanickc77b2572010-04-07 16:59:46 -070077 return var;
Ian Romanickadfb0cd2010-03-10 10:43:16 -080078}
79
Ian Romanick3f9a73d2010-04-02 11:59:57 -070080
81static void
82add_builtin_variable(const builtin_variable *proto, exec_list *instructions,
83 glsl_symbol_table *symtab)
84{
85 /* Create a new variable declaration from the description supplied by
86 * the caller.
87 */
88 const glsl_type *const type = symtab->get_type(proto->type);
89
90 assert(type != NULL);
91
Ian Romanicked0626e2010-06-21 11:42:57 -070092 add_variable(proto->name, proto->mode, proto->slot, type, instructions,
93 symtab);
Ian Romanick3f9a73d2010-04-02 11:59:57 -070094}
95
Eric Anholtf8946692010-07-20 14:03:35 -070096static void
97add_builtin_constant(exec_list *instructions,
98 struct _mesa_glsl_parse_state *state,
99 const char *name, int value)
100{
101 ir_variable *const var = add_variable(name, ir_var_auto,
102 -1, glsl_type::int_type,
103 instructions, state->symbols);
104 var->constant_value = new(var) ir_constant(value);
105}
Ian Romanick3f9a73d2010-04-02 11:59:57 -0700106
Eric Anholt78fe3c92010-03-28 01:46:48 -0700107static void
108generate_110_uniforms(exec_list *instructions,
Ian Romanick127308b2010-07-01 13:30:50 -0700109 struct _mesa_glsl_parse_state *state)
Eric Anholt78fe3c92010-03-28 01:46:48 -0700110{
111 for (unsigned i = 0
112 ; i < Elements(builtin_110_deprecated_uniforms)
113 ; i++) {
114 add_builtin_variable(& builtin_110_deprecated_uniforms[i],
Ian Romanick127308b2010-07-01 13:30:50 -0700115 instructions, state->symbols);
Eric Anholt78fe3c92010-03-28 01:46:48 -0700116 }
117
Eric Anholtf8946692010-07-20 14:03:35 -0700118 add_builtin_constant(instructions, state, "gl_MaxLights",
119 state->Const.MaxLights);
120 add_builtin_constant(instructions, state, "gl_MaxClipPlanes",
121 state->Const.MaxClipPlanes);
122 add_builtin_constant(instructions, state, "gl_MaxTextureUnits",
123 state->Const.MaxTextureUnits);
124 add_builtin_constant(instructions, state, "gl_MaxTextureCoords",
125 state->Const.MaxTextureCoords);
126 add_builtin_constant(instructions, state, "gl_MaxVertexAttribs",
127 state->Const.MaxVertexAttribs);
128 add_builtin_constant(instructions, state, "gl_MaxVertexUniformComponents",
129 state->Const.MaxVertexUniformComponents);
130 add_builtin_constant(instructions, state, "gl_MaxVaryingFloats",
131 state->Const.MaxVaryingFloats);
132 add_builtin_constant(instructions, state, "gl_MaxVertexTextureImageUnits",
133 state->Const.MaxVertexTextureImageUnits);
134 add_builtin_constant(instructions, state, "gl_MaxCombinedTextureImageUnits",
135 state->Const.MaxCombinedTextureImageUnits);
136 add_builtin_constant(instructions, state, "gl_MaxTextureImageUnits",
137 state->Const.MaxTextureImageUnits);
138 add_builtin_constant(instructions, state, "gl_MaxFragmentUniformComponents",
139 state->Const.MaxFragmentUniformComponents);
Ian Romanick127308b2010-07-01 13:30:50 -0700140
Ian Romanick3eba5932010-04-26 14:59:32 -0700141 const glsl_type *const mat4_array_type =
Ian Romanick127308b2010-07-01 13:30:50 -0700142 glsl_type::get_array_instance(state->symbols, glsl_type::mat4_type,
143 state->Const.MaxTextureCoords);
Ian Romanick3eba5932010-04-26 14:59:32 -0700144
Ian Romanicked0626e2010-06-21 11:42:57 -0700145 add_variable("gl_TextureMatrix", ir_var_uniform, -1, mat4_array_type,
Ian Romanick127308b2010-07-01 13:30:50 -0700146 instructions, state->symbols);
Eric Anholt78fe3c92010-03-28 01:46:48 -0700147
148 /* FINISHME: Add support for gl_DepthRangeParameters */
149 /* FINISHME: Add support for gl_ClipPlane[] */
150 /* FINISHME: Add support for gl_PointParameters */
151
152 /* FINISHME: Add support for gl_MaterialParameters
153 * FINISHME: (glFrontMaterial, glBackMaterial)
154 */
155
Eric Anholtaa579432010-05-19 14:09:04 -0700156 /* FINISHME: The size of this array is implementation dependent based on the
157 * FINISHME: value of GL_MAX_TEXTURE_LIGHTS. GL_MAX_TEXTURE_LIGHTS must be
158 * FINISHME: at least 8, so hard-code 8 for now.
159 */
160 const glsl_type *const light_source_array_type =
Ian Romanick127308b2010-07-01 13:30:50 -0700161 glsl_type::get_array_instance(state->symbols,
162 state->symbols->get_type("gl_LightSourceParameters"), 8);
Eric Anholtaa579432010-05-19 14:09:04 -0700163
Ian Romanicked0626e2010-06-21 11:42:57 -0700164 add_variable("gl_LightSource", ir_var_uniform, -1, light_source_array_type,
Ian Romanick127308b2010-07-01 13:30:50 -0700165 instructions, state->symbols);
Eric Anholtaa579432010-05-19 14:09:04 -0700166
Eric Anholt78fe3c92010-03-28 01:46:48 -0700167 /* FINISHME: Add support for gl_LightModel */
168 /* FINISHME: Add support for gl_FrontLightProduct[], gl_BackLightProduct[] */
169 /* FINISHME: Add support for gl_TextureEnvColor[] */
170 /* FINISHME: Add support for gl_ObjectPlane*[], gl_EyePlane*[] */
171 /* FINISHME: Add support for gl_Fog */
172}
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800173
174static void
175generate_110_vs_variables(exec_list *instructions,
Ian Romanick22971e92010-06-29 15:29:56 -0700176 struct _mesa_glsl_parse_state *state)
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800177{
178 for (unsigned i = 0; i < Elements(builtin_core_vs_variables); i++) {
179 add_builtin_variable(& builtin_core_vs_variables[i],
Ian Romanick22971e92010-06-29 15:29:56 -0700180 instructions, state->symbols);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800181 }
182
183 for (unsigned i = 0
184 ; i < Elements(builtin_110_deprecated_vs_variables)
185 ; i++) {
186 add_builtin_variable(& builtin_110_deprecated_vs_variables[i],
Ian Romanick22971e92010-06-29 15:29:56 -0700187 instructions, state->symbols);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800188 }
Ian Romanick127308b2010-07-01 13:30:50 -0700189 generate_110_uniforms(instructions, state);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800190
Ian Romanickcd00d5b2010-07-01 13:17:54 -0700191 /* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec:
192 *
193 * "As with all arrays, indices used to subscript gl_TexCoord must
194 * either be an integral constant expressions, or this array must be
195 * re-declared by the shader with a size. The size can be at most
196 * gl_MaxTextureCoords. Using indexes close to 0 may aid the
197 * implementation in preserving varying resources."
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800198 */
Ian Romanick3f9a73d2010-04-02 11:59:57 -0700199 const glsl_type *const vec4_array_type =
Ian Romanickcd00d5b2010-07-01 13:17:54 -0700200 glsl_type::get_array_instance(state->symbols, glsl_type::vec4_type, 0);
Ian Romanick3f9a73d2010-04-02 11:59:57 -0700201
Ian Romanicked0626e2010-06-21 11:42:57 -0700202 add_variable("gl_TexCoord", ir_var_out, VERT_RESULT_TEX0, vec4_array_type,
Ian Romanick22971e92010-06-29 15:29:56 -0700203 instructions, state->symbols);
204
205 generate_ARB_draw_buffers_variables(instructions, state, false,
206 vertex_shader);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800207}
208
209
210static void
211generate_120_vs_variables(exec_list *instructions,
Ian Romanick22971e92010-06-29 15:29:56 -0700212 struct _mesa_glsl_parse_state *state)
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800213{
214 /* GLSL version 1.20 did not add any built-in variables in the vertex
215 * shader.
216 */
Ian Romanick22971e92010-06-29 15:29:56 -0700217 generate_110_vs_variables(instructions, state);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800218}
219
220
221static void
222generate_130_vs_variables(exec_list *instructions,
Ian Romanick22971e92010-06-29 15:29:56 -0700223 struct _mesa_glsl_parse_state *state)
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800224{
Ian Romanick22971e92010-06-29 15:29:56 -0700225 void *ctx = state->symbols;
226 generate_120_vs_variables(instructions, state);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800227
228 for (unsigned i = 0; i < Elements(builtin_130_vs_variables); i++) {
229 add_builtin_variable(& builtin_130_vs_variables[i],
Ian Romanick22971e92010-06-29 15:29:56 -0700230 instructions, state->symbols);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800231 }
232
Eric Anholt271e1992010-04-02 23:47:06 -0700233 /* FINISHME: The size of this array is implementation dependent based on
234 * FINISHME: the value of GL_MAX_CLIP_DISTANCES.
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800235 */
Eric Anholt271e1992010-04-02 23:47:06 -0700236 const glsl_type *const clip_distance_array_type =
Carl Worth12c41152010-06-18 17:52:59 -0700237 glsl_type::get_array_instance(ctx, glsl_type::float_type, 8);
Ian Romanicked0626e2010-06-21 11:42:57 -0700238
239 /* FINISHME: gl_ClipDistance needs a real location assigned. */
240 add_variable("gl_ClipDistance", ir_var_out, -1, clip_distance_array_type,
Ian Romanick22971e92010-06-29 15:29:56 -0700241 instructions, state->symbols);
Eric Anholt271e1992010-04-02 23:47:06 -0700242
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800243}
244
245
246static void
247initialize_vs_variables(exec_list *instructions,
248 struct _mesa_glsl_parse_state *state)
249{
250
251 switch (state->language_version) {
252 case 110:
Ian Romanick22971e92010-06-29 15:29:56 -0700253 generate_110_vs_variables(instructions, state);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800254 break;
255 case 120:
Ian Romanick22971e92010-06-29 15:29:56 -0700256 generate_120_vs_variables(instructions, state);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800257 break;
258 case 130:
Ian Romanick22971e92010-06-29 15:29:56 -0700259 generate_130_vs_variables(instructions, state);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800260 break;
261 }
262}
263
Eric Anholtb3f743a2010-03-25 14:48:25 -0700264static void
265generate_110_fs_variables(exec_list *instructions,
Ian Romanick5e18b052010-06-29 14:21:05 -0700266 struct _mesa_glsl_parse_state *state)
Eric Anholtb3f743a2010-03-25 14:48:25 -0700267{
268 for (unsigned i = 0; i < Elements(builtin_core_fs_variables); i++) {
269 add_builtin_variable(& builtin_core_fs_variables[i],
Ian Romanick5e18b052010-06-29 14:21:05 -0700270 instructions, state->symbols);
Eric Anholtb3f743a2010-03-25 14:48:25 -0700271 }
272
Eric Anholt0f09aea2010-03-27 12:48:57 -0700273 for (unsigned i = 0
274 ; i < Elements(builtin_110_deprecated_fs_variables)
275 ; i++) {
276 add_builtin_variable(& builtin_110_deprecated_fs_variables[i],
Ian Romanick5e18b052010-06-29 14:21:05 -0700277 instructions, state->symbols);
Eric Anholt0f09aea2010-03-27 12:48:57 -0700278 }
Ian Romanick127308b2010-07-01 13:30:50 -0700279 generate_110_uniforms(instructions, state);
Eric Anholt0f09aea2010-03-27 12:48:57 -0700280
Ian Romanickcd00d5b2010-07-01 13:17:54 -0700281 /* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec:
282 *
283 * "As with all arrays, indices used to subscript gl_TexCoord must
284 * either be an integral constant expressions, or this array must be
285 * re-declared by the shader with a size. The size can be at most
286 * gl_MaxTextureCoords. Using indexes close to 0 may aid the
287 * implementation in preserving varying resources."
Ian Romanick3f9a73d2010-04-02 11:59:57 -0700288 */
Ian Romanick3f9a73d2010-04-02 11:59:57 -0700289 const glsl_type *const vec4_array_type =
Ian Romanickcd00d5b2010-07-01 13:17:54 -0700290 glsl_type::get_array_instance(state->symbols, glsl_type::vec4_type, 0);
Ian Romanick3f9a73d2010-04-02 11:59:57 -0700291
Ian Romanicked0626e2010-06-21 11:42:57 -0700292 add_variable("gl_TexCoord", ir_var_in, FRAG_ATTRIB_TEX0, vec4_array_type,
Ian Romanick5e18b052010-06-29 14:21:05 -0700293 instructions, state->symbols);
Ian Romanick9c4b1f22010-06-29 15:10:09 -0700294
Ian Romanick22971e92010-06-29 15:29:56 -0700295 generate_ARB_draw_buffers_variables(instructions, state, false,
296 fragment_shader);
Eric Anholtb3f743a2010-03-25 14:48:25 -0700297}
298
Ian Romanickc77b2572010-04-07 16:59:46 -0700299
300static void
Ian Romanick22971e92010-06-29 15:29:56 -0700301generate_ARB_draw_buffers_variables(exec_list *instructions,
302 struct _mesa_glsl_parse_state *state,
303 bool warn, _mesa_glsl_parser_targets target)
Ian Romanickc77b2572010-04-07 16:59:46 -0700304{
Ian Romanick22971e92010-06-29 15:29:56 -0700305 /* gl_MaxDrawBuffers is available in all shader stages.
306 */
Ian Romanicke2f84f02010-06-29 15:19:11 -0700307 ir_variable *const mdb =
308 add_variable("gl_MaxDrawBuffers", ir_var_auto, -1,
309 glsl_type::int_type, instructions, state->symbols);
310
311 if (warn)
312 mdb->warn_extension = "GL_ARB_draw_buffers";
313
314 mdb->constant_value = new(mdb)
315 ir_constant(int(state->Const.MaxDrawBuffers));
316
Ian Romanickc77b2572010-04-07 16:59:46 -0700317
Ian Romanick22971e92010-06-29 15:29:56 -0700318 /* gl_FragData is only available in the fragment shader.
319 */
320 if (target == fragment_shader) {
321 const glsl_type *const vec4_array_type =
322 glsl_type::get_array_instance(state->symbols, glsl_type::vec4_type,
323 state->Const.MaxDrawBuffers);
Ian Romanickc77b2572010-04-07 16:59:46 -0700324
Ian Romanick22971e92010-06-29 15:29:56 -0700325 ir_variable *const fd =
326 add_variable("gl_FragData", ir_var_out, FRAG_RESULT_DATA0,
327 vec4_array_type, instructions, state->symbols);
328
329 if (warn)
330 fd->warn_extension = "GL_ARB_draw_buffers";
331 }
Ian Romanickc77b2572010-04-07 16:59:46 -0700332}
333
334
Eric Anholtb3f743a2010-03-25 14:48:25 -0700335static void
336generate_120_fs_variables(exec_list *instructions,
Ian Romanick5e18b052010-06-29 14:21:05 -0700337 struct _mesa_glsl_parse_state *state)
Eric Anholtb3f743a2010-03-25 14:48:25 -0700338{
Ian Romanick5e18b052010-06-29 14:21:05 -0700339 generate_110_fs_variables(instructions, state);
Eric Anholt152b55e2010-07-07 19:45:22 -0700340
341 for (unsigned i = 0
342 ; i < Elements(builtin_120_fs_variables)
343 ; i++) {
344 add_builtin_variable(& builtin_120_fs_variables[i],
345 instructions, state->symbols);
346 }
Eric Anholtb3f743a2010-03-25 14:48:25 -0700347}
348
349static void
350generate_130_fs_variables(exec_list *instructions,
Ian Romanick5e18b052010-06-29 14:21:05 -0700351 struct _mesa_glsl_parse_state *state)
Eric Anholtb3f743a2010-03-25 14:48:25 -0700352{
Ian Romanick5e18b052010-06-29 14:21:05 -0700353 void *ctx = state->symbols;
354 generate_120_fs_variables(instructions, state);
Eric Anholtb3f743a2010-03-25 14:48:25 -0700355
Ian Romanick8645a952010-04-07 16:47:44 -0700356 /* FINISHME: The size of this array is implementation dependent based on
357 * FINISHME: the value of GL_MAX_CLIP_DISTANCES.
Eric Anholtb3f743a2010-03-25 14:48:25 -0700358 */
Ian Romanick8645a952010-04-07 16:47:44 -0700359 const glsl_type *const clip_distance_array_type =
Carl Worth12c41152010-06-18 17:52:59 -0700360 glsl_type::get_array_instance(ctx, glsl_type::float_type, 8);
Ian Romanicked0626e2010-06-21 11:42:57 -0700361
362 /* FINISHME: gl_ClipDistance needs a real location assigned. */
363 add_variable("gl_ClipDistance", ir_var_in, -1, clip_distance_array_type,
Ian Romanick5e18b052010-06-29 14:21:05 -0700364 instructions, state->symbols);
Eric Anholtb3f743a2010-03-25 14:48:25 -0700365}
366
367static void
368initialize_fs_variables(exec_list *instructions,
369 struct _mesa_glsl_parse_state *state)
370{
371
372 switch (state->language_version) {
373 case 110:
Ian Romanick5e18b052010-06-29 14:21:05 -0700374 generate_110_fs_variables(instructions, state);
Eric Anholtb3f743a2010-03-25 14:48:25 -0700375 break;
376 case 120:
Ian Romanick5e18b052010-06-29 14:21:05 -0700377 generate_120_fs_variables(instructions, state);
Eric Anholtb3f743a2010-03-25 14:48:25 -0700378 break;
379 case 130:
Ian Romanick5e18b052010-06-29 14:21:05 -0700380 generate_130_fs_variables(instructions, state);
Eric Anholtb3f743a2010-03-25 14:48:25 -0700381 break;
382 }
383}
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800384
385void
386_mesa_glsl_initialize_variables(exec_list *instructions,
387 struct _mesa_glsl_parse_state *state)
388{
389 switch (state->target) {
390 case vertex_shader:
391 initialize_vs_variables(instructions, state);
392 break;
393 case geometry_shader:
Eric Anholtb3f743a2010-03-25 14:48:25 -0700394 break;
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800395 case fragment_shader:
Eric Anholtb3f743a2010-03-25 14:48:25 -0700396 initialize_fs_variables(instructions, state);
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800397 break;
Eric Anholt81f49a72010-04-29 17:57:28 -0700398 case ir_shader:
399 fprintf(stderr, "ir reader has no builtin variables");
400 exit(1);
401 break;
Ian Romanickadfb0cd2010-03-10 10:43:16 -0800402 }
403}