1 /* valaswitchlabel.c generated by valac, the Vala compiler
2  * generated from valaswitchlabel.vala, do not modify */
3 
4 /* valaswitchlabel.vala
5  *
6  * Copyright (C) 2006-2010  Jürg Billeter
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12 
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17 
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
21  *
22  * Author:
23  * 	Jürg Billeter <j@bitron.ch>
24  */
25 
26 #include "vala.h"
27 #include <glib.h>
28 #include <valagee.h>
29 #include <glib-object.h>
30 #include <stdlib.h>
31 #include <string.h>
32 
33 #define _vala_code_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL)))
34 #define _g_free0(var) (var = (g_free (var), NULL))
35 #define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
36 
37 struct _ValaSwitchLabelPrivate {
38 	ValaExpression* _expression;
39 };
40 
41 static gint ValaSwitchLabel_private_offset;
42 static gpointer vala_switch_label_parent_class = NULL;
43 
44 static void vala_switch_label_real_accept (ValaCodeNode* base,
45                                     ValaCodeVisitor* visitor);
46 static void vala_switch_label_real_accept_children (ValaCodeNode* base,
47                                              ValaCodeVisitor* visitor);
48 static gboolean vala_switch_label_real_check (ValaCodeNode* base,
49                                        ValaCodeContext* context);
50 static void vala_switch_label_real_emit (ValaCodeNode* base,
51                                   ValaCodeGenerator* codegen);
52 static void vala_switch_label_finalize (ValaCodeNode * obj);
53 static GType vala_switch_label_get_type_once (void);
54 
55 static inline gpointer
vala_switch_label_get_instance_private(ValaSwitchLabel * self)56 vala_switch_label_get_instance_private (ValaSwitchLabel* self)
57 {
58 	return G_STRUCT_MEMBER_P (self, ValaSwitchLabel_private_offset);
59 }
60 
61 ValaExpression*
vala_switch_label_get_expression(ValaSwitchLabel * self)62 vala_switch_label_get_expression (ValaSwitchLabel* self)
63 {
64 	ValaExpression* result;
65 	ValaExpression* _tmp0_;
66 	g_return_val_if_fail (self != NULL, NULL);
67 	_tmp0_ = self->priv->_expression;
68 	result = _tmp0_;
69 	return result;
70 }
71 
72 static gpointer
_vala_code_node_ref0(gpointer self)73 _vala_code_node_ref0 (gpointer self)
74 {
75 	return self ? vala_code_node_ref (self) : NULL;
76 }
77 
78 void
vala_switch_label_set_expression(ValaSwitchLabel * self,ValaExpression * value)79 vala_switch_label_set_expression (ValaSwitchLabel* self,
80                                   ValaExpression* value)
81 {
82 	ValaExpression* _tmp0_;
83 	ValaExpression* _tmp1_;
84 	g_return_if_fail (self != NULL);
85 	_tmp0_ = _vala_code_node_ref0 (value);
86 	_vala_code_node_unref0 (self->priv->_expression);
87 	self->priv->_expression = _tmp0_;
88 	_tmp1_ = self->priv->_expression;
89 	vala_code_node_set_parent_node ((ValaCodeNode*) _tmp1_, (ValaCodeNode*) self);
90 }
91 
92 ValaSwitchSection*
vala_switch_label_get_section(ValaSwitchLabel * self)93 vala_switch_label_get_section (ValaSwitchLabel* self)
94 {
95 	ValaSwitchSection* result;
96 	ValaCodeNode* _tmp0_;
97 	ValaCodeNode* _tmp1_;
98 	g_return_val_if_fail (self != NULL, NULL);
99 	_tmp0_ = vala_code_node_get_parent_node ((ValaCodeNode*) self);
100 	_tmp1_ = _tmp0_;
101 	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_SWITCH_SECTION, ValaSwitchSection);
102 	return result;
103 }
104 
105 /**
106  * Creates a new switch case label.
107  *
108  * @param expr   label expression
109  * @param source reference to source code
110  * @return       newly created switch case label
111  */
112 ValaSwitchLabel*
vala_switch_label_construct(GType object_type,ValaExpression * expr,ValaSourceReference * source)113 vala_switch_label_construct (GType object_type,
114                              ValaExpression* expr,
115                              ValaSourceReference* source)
116 {
117 	ValaSwitchLabel* self = NULL;
118 	g_return_val_if_fail (expr != NULL, NULL);
119 	self = (ValaSwitchLabel*) vala_code_node_construct (object_type);
120 	vala_switch_label_set_expression (self, expr);
121 	vala_code_node_set_source_reference ((ValaCodeNode*) self, source);
122 	return self;
123 }
124 
125 ValaSwitchLabel*
vala_switch_label_new(ValaExpression * expr,ValaSourceReference * source)126 vala_switch_label_new (ValaExpression* expr,
127                        ValaSourceReference* source)
128 {
129 	return vala_switch_label_construct (VALA_TYPE_SWITCH_LABEL, expr, source);
130 }
131 
132 /**
133  * Creates a new switch default label.
134  *
135  * @param source reference to source code
136  * @return       newly created switch default label
137  */
138 ValaSwitchLabel*
vala_switch_label_construct_with_default(GType object_type,ValaSourceReference * source)139 vala_switch_label_construct_with_default (GType object_type,
140                                           ValaSourceReference* source)
141 {
142 	ValaSwitchLabel* self = NULL;
143 	self = (ValaSwitchLabel*) vala_code_node_construct (object_type);
144 	vala_code_node_set_source_reference ((ValaCodeNode*) self, source);
145 	return self;
146 }
147 
148 ValaSwitchLabel*
vala_switch_label_new_with_default(ValaSourceReference * source)149 vala_switch_label_new_with_default (ValaSourceReference* source)
150 {
151 	return vala_switch_label_construct_with_default (VALA_TYPE_SWITCH_LABEL, source);
152 }
153 
154 static void
vala_switch_label_real_accept(ValaCodeNode * base,ValaCodeVisitor * visitor)155 vala_switch_label_real_accept (ValaCodeNode* base,
156                                ValaCodeVisitor* visitor)
157 {
158 	ValaSwitchLabel * self;
159 	self = (ValaSwitchLabel*) base;
160 	g_return_if_fail (visitor != NULL);
161 	vala_code_visitor_visit_switch_label (visitor, self);
162 }
163 
164 static void
vala_switch_label_real_accept_children(ValaCodeNode * base,ValaCodeVisitor * visitor)165 vala_switch_label_real_accept_children (ValaCodeNode* base,
166                                         ValaCodeVisitor* visitor)
167 {
168 	ValaSwitchLabel * self;
169 	ValaExpression* _tmp0_;
170 	ValaExpression* _tmp1_;
171 	self = (ValaSwitchLabel*) base;
172 	g_return_if_fail (visitor != NULL);
173 	_tmp0_ = vala_switch_label_get_expression (self);
174 	_tmp1_ = _tmp0_;
175 	if (_tmp1_ != NULL) {
176 		ValaExpression* _tmp2_;
177 		ValaExpression* _tmp3_;
178 		ValaExpression* _tmp4_;
179 		ValaExpression* _tmp5_;
180 		_tmp2_ = vala_switch_label_get_expression (self);
181 		_tmp3_ = _tmp2_;
182 		vala_code_node_accept ((ValaCodeNode*) _tmp3_, visitor);
183 		_tmp4_ = vala_switch_label_get_expression (self);
184 		_tmp5_ = _tmp4_;
185 		vala_code_visitor_visit_end_full_expression (visitor, _tmp5_);
186 	}
187 }
188 
189 static gpointer
_vala_iterable_ref0(gpointer self)190 _vala_iterable_ref0 (gpointer self)
191 {
192 	return self ? vala_iterable_ref (self) : NULL;
193 }
194 
195 static gboolean
vala_switch_label_real_check(ValaCodeNode * base,ValaCodeContext * context)196 vala_switch_label_real_check (ValaCodeNode* base,
197                               ValaCodeContext* context)
198 {
199 	ValaSwitchLabel * self;
200 	gboolean _tmp0_;
201 	gboolean _tmp1_;
202 	ValaExpression* _tmp4_;
203 	ValaExpression* _tmp5_;
204 	gboolean result = FALSE;
205 	self = (ValaSwitchLabel*) base;
206 	g_return_val_if_fail (context != NULL, FALSE);
207 	_tmp0_ = vala_code_node_get_checked ((ValaCodeNode*) self);
208 	_tmp1_ = _tmp0_;
209 	if (_tmp1_) {
210 		gboolean _tmp2_;
211 		gboolean _tmp3_;
212 		_tmp2_ = vala_code_node_get_error ((ValaCodeNode*) self);
213 		_tmp3_ = _tmp2_;
214 		result = !_tmp3_;
215 		return result;
216 	}
217 	vala_code_node_set_checked ((ValaCodeNode*) self, TRUE);
218 	_tmp4_ = vala_switch_label_get_expression (self);
219 	_tmp5_ = _tmp4_;
220 	if (_tmp5_ != NULL) {
221 		ValaSwitchStatement* switch_statement = NULL;
222 		ValaSwitchSection* _tmp6_;
223 		ValaSwitchSection* _tmp7_;
224 		ValaCodeNode* _tmp8_;
225 		ValaCodeNode* _tmp9_;
226 		ValaSwitchStatement* _tmp10_;
227 		ValaDataType* condition_target_type = NULL;
228 		ValaSwitchStatement* _tmp11_;
229 		ValaExpression* _tmp12_;
230 		ValaExpression* _tmp13_;
231 		ValaDataType* _tmp14_;
232 		ValaDataType* _tmp15_;
233 		ValaDataType* _tmp16_;
234 		gboolean _tmp17_ = FALSE;
235 		gboolean _tmp18_ = FALSE;
236 		ValaExpression* _tmp19_;
237 		ValaExpression* _tmp20_;
238 		ValaSymbol* _tmp21_;
239 		ValaSymbol* _tmp22_;
240 		ValaExpression* _tmp57_;
241 		ValaExpression* _tmp58_;
242 		ValaExpression* _tmp59_;
243 		ValaExpression* _tmp60_;
244 		ValaExpression* _tmp65_;
245 		ValaExpression* _tmp66_;
246 		ValaDataType* _tmp67_;
247 		ValaDataType* _tmp68_;
248 		ValaSwitchStatement* _tmp69_;
249 		ValaExpression* _tmp70_;
250 		ValaExpression* _tmp71_;
251 		ValaDataType* _tmp72_;
252 		ValaDataType* _tmp73_;
253 		_tmp6_ = vala_switch_label_get_section (self);
254 		_tmp7_ = _tmp6_;
255 		_tmp8_ = vala_code_node_get_parent_node ((ValaCodeNode*) _tmp7_);
256 		_tmp9_ = _tmp8_;
257 		_tmp10_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, VALA_TYPE_SWITCH_STATEMENT, ValaSwitchStatement));
258 		switch_statement = _tmp10_;
259 		_tmp11_ = switch_statement;
260 		_tmp12_ = vala_switch_statement_get_expression (_tmp11_);
261 		_tmp13_ = _tmp12_;
262 		_tmp14_ = vala_expression_get_target_type (_tmp13_);
263 		_tmp15_ = _tmp14_;
264 		_tmp16_ = _vala_code_node_ref0 (_tmp15_);
265 		condition_target_type = _tmp16_;
266 		_tmp19_ = vala_switch_label_get_expression (self);
267 		_tmp20_ = _tmp19_;
268 		_tmp21_ = vala_expression_get_symbol_reference (_tmp20_);
269 		_tmp22_ = _tmp21_;
270 		if (_tmp22_ == NULL) {
271 			ValaDataType* _tmp23_;
272 			_tmp23_ = condition_target_type;
273 			_tmp18_ = _tmp23_ != NULL;
274 		} else {
275 			_tmp18_ = FALSE;
276 		}
277 		if (_tmp18_) {
278 			ValaDataType* _tmp24_;
279 			ValaTypeSymbol* _tmp25_;
280 			ValaTypeSymbol* _tmp26_;
281 			_tmp24_ = condition_target_type;
282 			_tmp25_ = vala_data_type_get_type_symbol (_tmp24_);
283 			_tmp26_ = _tmp25_;
284 			_tmp17_ = VALA_IS_ENUM (_tmp26_);
285 		} else {
286 			_tmp17_ = FALSE;
287 		}
288 		if (_tmp17_) {
289 			ValaEnum* enum_type = NULL;
290 			ValaDataType* _tmp27_;
291 			ValaTypeSymbol* _tmp28_;
292 			ValaTypeSymbol* _tmp29_;
293 			ValaEnum* _tmp30_;
294 			_tmp27_ = condition_target_type;
295 			_tmp28_ = vala_data_type_get_type_symbol (_tmp27_);
296 			_tmp29_ = _tmp28_;
297 			_tmp30_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, VALA_TYPE_ENUM, ValaEnum));
298 			enum_type = _tmp30_;
299 			{
300 				ValaList* _val_list = NULL;
301 				ValaEnum* _tmp31_;
302 				ValaList* _tmp32_;
303 				ValaList* _tmp33_;
304 				gint _val_size = 0;
305 				ValaList* _tmp34_;
306 				gint _tmp35_;
307 				gint _tmp36_;
308 				gint _val_index = 0;
309 				_tmp31_ = enum_type;
310 				_tmp32_ = vala_enum_get_values (_tmp31_);
311 				_tmp33_ = _vala_iterable_ref0 (_tmp32_);
312 				_val_list = _tmp33_;
313 				_tmp34_ = _val_list;
314 				_tmp35_ = vala_collection_get_size ((ValaCollection*) _tmp34_);
315 				_tmp36_ = _tmp35_;
316 				_val_size = _tmp36_;
317 				_val_index = -1;
318 				while (TRUE) {
319 					gint _tmp37_;
320 					gint _tmp38_;
321 					ValaEnumValue* val = NULL;
322 					ValaList* _tmp39_;
323 					gpointer _tmp40_;
324 					ValaExpression* _tmp41_;
325 					ValaExpression* _tmp42_;
326 					gchar* _tmp43_;
327 					gchar* _tmp44_;
328 					ValaEnumValue* _tmp45_;
329 					const gchar* _tmp46_;
330 					const gchar* _tmp47_;
331 					gboolean _tmp48_;
332 					_val_index = _val_index + 1;
333 					_tmp37_ = _val_index;
334 					_tmp38_ = _val_size;
335 					if (!(_tmp37_ < _tmp38_)) {
336 						break;
337 					}
338 					_tmp39_ = _val_list;
339 					_tmp40_ = vala_list_get (_tmp39_, _val_index);
340 					val = (ValaEnumValue*) _tmp40_;
341 					_tmp41_ = vala_switch_label_get_expression (self);
342 					_tmp42_ = _tmp41_;
343 					_tmp43_ = vala_code_node_to_string ((ValaCodeNode*) _tmp42_);
344 					_tmp44_ = _tmp43_;
345 					_tmp45_ = val;
346 					_tmp46_ = vala_symbol_get_name ((ValaSymbol*) _tmp45_);
347 					_tmp47_ = _tmp46_;
348 					_tmp48_ = g_strcmp0 (_tmp44_, _tmp47_) == 0;
349 					_g_free0 (_tmp44_);
350 					if (_tmp48_) {
351 						ValaExpression* _tmp49_;
352 						ValaExpression* _tmp50_;
353 						ValaDataType* _tmp51_;
354 						ValaDataType* _tmp52_;
355 						ValaDataType* _tmp53_;
356 						ValaExpression* _tmp54_;
357 						ValaExpression* _tmp55_;
358 						ValaEnumValue* _tmp56_;
359 						_tmp49_ = vala_switch_label_get_expression (self);
360 						_tmp50_ = _tmp49_;
361 						_tmp51_ = condition_target_type;
362 						_tmp52_ = vala_data_type_copy (_tmp51_);
363 						_tmp53_ = _tmp52_;
364 						vala_expression_set_target_type (_tmp50_, _tmp53_);
365 						_vala_code_node_unref0 (_tmp53_);
366 						_tmp54_ = vala_switch_label_get_expression (self);
367 						_tmp55_ = _tmp54_;
368 						_tmp56_ = val;
369 						vala_expression_set_symbol_reference (_tmp55_, (ValaSymbol*) _tmp56_);
370 						_vala_code_node_unref0 (val);
371 						break;
372 					}
373 					_vala_code_node_unref0 (val);
374 				}
375 				_vala_iterable_unref0 (_val_list);
376 			}
377 			_vala_code_node_unref0 (enum_type);
378 		}
379 		_tmp57_ = vala_switch_label_get_expression (self);
380 		_tmp58_ = _tmp57_;
381 		if (!vala_code_node_check ((ValaCodeNode*) _tmp58_, context)) {
382 			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
383 			result = FALSE;
384 			_vala_code_node_unref0 (condition_target_type);
385 			_vala_code_node_unref0 (switch_statement);
386 			return result;
387 		}
388 		_tmp59_ = vala_switch_label_get_expression (self);
389 		_tmp60_ = _tmp59_;
390 		if (!vala_expression_is_constant (_tmp60_)) {
391 			ValaExpression* _tmp61_;
392 			ValaExpression* _tmp62_;
393 			ValaSourceReference* _tmp63_;
394 			ValaSourceReference* _tmp64_;
395 			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
396 			_tmp61_ = vala_switch_label_get_expression (self);
397 			_tmp62_ = _tmp61_;
398 			_tmp63_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp62_);
399 			_tmp64_ = _tmp63_;
400 			vala_report_error (_tmp64_, "Expression must be constant");
401 			result = FALSE;
402 			_vala_code_node_unref0 (condition_target_type);
403 			_vala_code_node_unref0 (switch_statement);
404 			return result;
405 		}
406 		_tmp65_ = vala_switch_label_get_expression (self);
407 		_tmp66_ = _tmp65_;
408 		_tmp67_ = vala_expression_get_value_type (_tmp66_);
409 		_tmp68_ = _tmp67_;
410 		_tmp69_ = switch_statement;
411 		_tmp70_ = vala_switch_statement_get_expression (_tmp69_);
412 		_tmp71_ = _tmp70_;
413 		_tmp72_ = vala_expression_get_value_type (_tmp71_);
414 		_tmp73_ = _tmp72_;
415 		if (!vala_data_type_compatible (_tmp68_, _tmp73_)) {
416 			ValaExpression* _tmp74_;
417 			ValaExpression* _tmp75_;
418 			ValaSourceReference* _tmp76_;
419 			ValaSourceReference* _tmp77_;
420 			ValaExpression* _tmp78_;
421 			ValaExpression* _tmp79_;
422 			ValaDataType* _tmp80_;
423 			ValaDataType* _tmp81_;
424 			gchar* _tmp82_;
425 			gchar* _tmp83_;
426 			ValaSwitchStatement* _tmp84_;
427 			ValaExpression* _tmp85_;
428 			ValaExpression* _tmp86_;
429 			ValaDataType* _tmp87_;
430 			ValaDataType* _tmp88_;
431 			gchar* _tmp89_;
432 			gchar* _tmp90_;
433 			gchar* _tmp91_;
434 			gchar* _tmp92_;
435 			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
436 			_tmp74_ = vala_switch_label_get_expression (self);
437 			_tmp75_ = _tmp74_;
438 			_tmp76_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp75_);
439 			_tmp77_ = _tmp76_;
440 			_tmp78_ = vala_switch_label_get_expression (self);
441 			_tmp79_ = _tmp78_;
442 			_tmp80_ = vala_expression_get_value_type (_tmp79_);
443 			_tmp81_ = _tmp80_;
444 			_tmp82_ = vala_code_node_to_string ((ValaCodeNode*) _tmp81_);
445 			_tmp83_ = _tmp82_;
446 			_tmp84_ = switch_statement;
447 			_tmp85_ = vala_switch_statement_get_expression (_tmp84_);
448 			_tmp86_ = _tmp85_;
449 			_tmp87_ = vala_expression_get_value_type (_tmp86_);
450 			_tmp88_ = _tmp87_;
451 			_tmp89_ = vala_code_node_to_string ((ValaCodeNode*) _tmp88_);
452 			_tmp90_ = _tmp89_;
453 			_tmp91_ = g_strdup_printf ("Cannot convert from `%s' to `%s'", _tmp83_, _tmp90_);
454 			_tmp92_ = _tmp91_;
455 			vala_report_error (_tmp77_, _tmp92_);
456 			_g_free0 (_tmp92_);
457 			_g_free0 (_tmp90_);
458 			_g_free0 (_tmp83_);
459 			result = FALSE;
460 			_vala_code_node_unref0 (condition_target_type);
461 			_vala_code_node_unref0 (switch_statement);
462 			return result;
463 		}
464 		_vala_code_node_unref0 (condition_target_type);
465 		_vala_code_node_unref0 (switch_statement);
466 	}
467 	result = TRUE;
468 	return result;
469 }
470 
471 static void
vala_switch_label_real_emit(ValaCodeNode * base,ValaCodeGenerator * codegen)472 vala_switch_label_real_emit (ValaCodeNode* base,
473                              ValaCodeGenerator* codegen)
474 {
475 	ValaSwitchLabel * self;
476 	self = (ValaSwitchLabel*) base;
477 	g_return_if_fail (codegen != NULL);
478 	vala_code_visitor_visit_switch_label ((ValaCodeVisitor*) codegen, self);
479 }
480 
481 static void
vala_switch_label_class_init(ValaSwitchLabelClass * klass,gpointer klass_data)482 vala_switch_label_class_init (ValaSwitchLabelClass * klass,
483                               gpointer klass_data)
484 {
485 	vala_switch_label_parent_class = g_type_class_peek_parent (klass);
486 	((ValaCodeNodeClass *) klass)->finalize = vala_switch_label_finalize;
487 	g_type_class_adjust_private_offset (klass, &ValaSwitchLabel_private_offset);
488 	((ValaCodeNodeClass *) klass)->accept = (void (*) (ValaCodeNode*, ValaCodeVisitor*)) vala_switch_label_real_accept;
489 	((ValaCodeNodeClass *) klass)->accept_children = (void (*) (ValaCodeNode*, ValaCodeVisitor*)) vala_switch_label_real_accept_children;
490 	((ValaCodeNodeClass *) klass)->check = (gboolean (*) (ValaCodeNode*, ValaCodeContext*)) vala_switch_label_real_check;
491 	((ValaCodeNodeClass *) klass)->emit = (void (*) (ValaCodeNode*, ValaCodeGenerator*)) vala_switch_label_real_emit;
492 }
493 
494 static void
vala_switch_label_instance_init(ValaSwitchLabel * self,gpointer klass)495 vala_switch_label_instance_init (ValaSwitchLabel * self,
496                                  gpointer klass)
497 {
498 	self->priv = vala_switch_label_get_instance_private (self);
499 }
500 
501 static void
vala_switch_label_finalize(ValaCodeNode * obj)502 vala_switch_label_finalize (ValaCodeNode * obj)
503 {
504 	ValaSwitchLabel * self;
505 	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_SWITCH_LABEL, ValaSwitchLabel);
506 	_vala_code_node_unref0 (self->priv->_expression);
507 	VALA_CODE_NODE_CLASS (vala_switch_label_parent_class)->finalize (obj);
508 }
509 
510 /**
511  * Represents a switch label in the source code.
512  */
513 static GType
vala_switch_label_get_type_once(void)514 vala_switch_label_get_type_once (void)
515 {
516 	static const GTypeInfo g_define_type_info = { sizeof (ValaSwitchLabelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_switch_label_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaSwitchLabel), 0, (GInstanceInitFunc) vala_switch_label_instance_init, NULL };
517 	GType vala_switch_label_type_id;
518 	vala_switch_label_type_id = g_type_register_static (VALA_TYPE_CODE_NODE, "ValaSwitchLabel", &g_define_type_info, 0);
519 	ValaSwitchLabel_private_offset = g_type_add_instance_private (vala_switch_label_type_id, sizeof (ValaSwitchLabelPrivate));
520 	return vala_switch_label_type_id;
521 }
522 
523 GType
vala_switch_label_get_type(void)524 vala_switch_label_get_type (void)
525 {
526 	static volatile gsize vala_switch_label_type_id__volatile = 0;
527 	if (g_once_init_enter (&vala_switch_label_type_id__volatile)) {
528 		GType vala_switch_label_type_id;
529 		vala_switch_label_type_id = vala_switch_label_get_type_once ();
530 		g_once_init_leave (&vala_switch_label_type_id__volatile, vala_switch_label_type_id);
531 	}
532 	return vala_switch_label_type_id__volatile;
533 }
534 
535