Пример #1
0
static void vala_ccode_assignment_finalize (ValaCCodeNode* obj) {
	ValaCCodeAssignment * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_CCODE_ASSIGNMENT, ValaCCodeAssignment);
	_vala_ccode_node_unref0 (self->priv->_left);
	_vala_ccode_node_unref0 (self->priv->_right);
	VALA_CCODE_NODE_CLASS (vala_ccode_assignment_parent_class)->finalize (obj);
}
Пример #2
0
static void vala_ccode_do_statement_finalize (ValaCCodeNode* obj) {
	ValaCCodeDoStatement * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_CCODE_DO_STATEMENT, ValaCCodeDoStatement);
	_vala_ccode_node_unref0 (self->priv->_body);
	_vala_ccode_node_unref0 (self->priv->_condition);
	VALA_CCODE_NODE_CLASS (vala_ccode_do_statement_parent_class)->finalize (obj);
}
static void vala_ccode_if_statement_finalize (ValaCCodeNode* obj) {
	ValaCCodeIfStatement * self;
	self = VALA_CCODE_IF_STATEMENT (obj);
	_vala_ccode_node_unref0 (self->priv->_condition);
	_vala_ccode_node_unref0 (self->priv->_true_statement);
	_vala_ccode_node_unref0 (self->priv->_false_statement);
	VALA_CCODE_NODE_CLASS (vala_ccode_if_statement_parent_class)->finalize (obj);
}
static void vala_ccode_enum_value_finalize (ValaCCodeNode* obj) {
	ValaCCodeEnumValue * self;
	self = VALA_CCODE_ENUM_VALUE (obj);
	_g_free0 (self->priv->_name);
	_vala_ccode_node_unref0 (self->priv->_value);
	VALA_CCODE_NODE_CLASS (vala_ccode_enum_value_parent_class)->finalize (obj);
}
Пример #5
0
static void vala_dova_control_flow_module_real_visit_loop (ValaCodeVisitor* base, ValaLoop* stmt) {
	ValaDovaControlFlowModule * self;
	ValaCCodeFunction* _tmp0_;
	ValaCCodeFunction* _tmp1_;
	ValaCCodeConstant* _tmp2_;
	ValaCCodeConstant* _tmp3_;
	ValaLoop* _tmp4_;
	ValaBlock* _tmp5_;
	ValaBlock* _tmp6_;
	ValaCCodeFunction* _tmp7_;
	ValaCCodeFunction* _tmp8_;
	self = (ValaDovaControlFlowModule*) base;
	g_return_if_fail (stmt != NULL);
	_tmp0_ = vala_dova_base_module_get_ccode ((ValaDovaBaseModule*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = vala_ccode_constant_new ("true");
	_tmp3_ = _tmp2_;
	vala_ccode_function_open_while (_tmp1_, (ValaCCodeExpression*) _tmp3_);
	_vala_ccode_node_unref0 (_tmp3_);
	_tmp4_ = stmt;
	_tmp5_ = vala_loop_get_body (_tmp4_);
	_tmp6_ = _tmp5_;
	vala_code_node_emit ((ValaCodeNode*) _tmp6_, (ValaCodeGenerator*) self);
	_tmp7_ = vala_dova_base_module_get_ccode ((ValaDovaBaseModule*) self);
	_tmp8_ = _tmp7_;
	vala_ccode_function_close (_tmp8_);
}
static void vala_ccode_cast_expression_finalize (ValaCCodeNode* obj) {
	ValaCCodeCastExpression * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_CCODE_CAST_EXPRESSION, ValaCCodeCastExpression);
	_vala_ccode_node_unref0 (self->priv->_inner);
	_g_free0 (self->priv->_type_name);
	VALA_CCODE_NODE_CLASS (vala_ccode_cast_expression_parent_class)->finalize (obj);
}
void vala_ccode_file_add_include (ValaCCodeFile* self, const gchar* filename, gboolean local) {
	ValaSet* _tmp0_;
	const gchar* _tmp1_;
	gboolean _tmp2_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (filename != NULL);
	_tmp0_ = self->priv->includes;
	_tmp1_ = filename;
	_tmp2_ = vala_collection_contains ((ValaCollection*) _tmp0_, _tmp1_);
	if (!_tmp2_) {
		ValaCCodeFragment* _tmp3_;
		const gchar* _tmp4_;
		gboolean _tmp5_;
		ValaCCodeIncludeDirective* _tmp6_;
		ValaCCodeIncludeDirective* _tmp7_;
		ValaSet* _tmp8_;
		const gchar* _tmp9_;
		_tmp3_ = self->priv->include_directives;
		_tmp4_ = filename;
		_tmp5_ = local;
		_tmp6_ = vala_ccode_include_directive_new (_tmp4_, _tmp5_);
		_tmp7_ = _tmp6_;
		vala_ccode_fragment_append (_tmp3_, (ValaCCodeNode*) _tmp7_);
		_vala_ccode_node_unref0 (_tmp7_);
		_tmp8_ = self->priv->includes;
		_tmp9_ = filename;
		vala_collection_add ((ValaCollection*) _tmp8_, _tmp9_);
	}
}
static void vala_ccode_macro_replacement_finalize (ValaCCodeNode* obj) {
	ValaCCodeMacroReplacement * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_CCODE_MACRO_REPLACEMENT, ValaCCodeMacroReplacement);
	_g_free0 (self->priv->_name);
	_g_free0 (self->priv->_replacement);
	_vala_ccode_node_unref0 (self->priv->_replacement_expression);
	VALA_CCODE_NODE_CLASS (vala_ccode_macro_replacement_parent_class)->finalize (obj);
}
Пример #9
0
void vala_ccode_do_statement_set_body (ValaCCodeDoStatement* self, ValaCCodeStatement* value) {
	ValaCCodeStatement* _tmp0_;
	ValaCCodeStatement* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _vala_ccode_node_ref0 (_tmp0_);
	_vala_ccode_node_unref0 (self->priv->_body);
	self->priv->_body = _tmp1_;
}
void vala_ccode_if_statement_set_false_statement (ValaCCodeIfStatement* self, ValaCCodeStatement* value) {
	ValaCCodeStatement* _tmp0_;
	ValaCCodeStatement* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _vala_ccode_node_ref0 (_tmp0_);
	_vala_ccode_node_unref0 (self->priv->_false_statement);
	self->priv->_false_statement = _tmp1_;
}
void vala_ccode_cast_expression_set_inner (ValaCCodeCastExpression* self, ValaCCodeExpression* value) {
	ValaCCodeExpression* _tmp0_;
	ValaCCodeExpression* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _vala_ccode_node_ref0 (_tmp0_);
	_vala_ccode_node_unref0 (self->priv->_inner);
	self->priv->_inner = _tmp1_;
}
void vala_ccode_enum_value_set_value (ValaCCodeEnumValue* self, ValaCCodeExpression* value) {
	ValaCCodeExpression* _tmp0_;
	ValaCCodeExpression* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _vala_ccode_node_ref0 (_tmp0_);
	_vala_ccode_node_unref0 (self->priv->_value);
	self->priv->_value = _tmp1_;
}
Пример #13
0
void vala_ccode_node_set_line (ValaCCodeNode* self, ValaCCodeLineDirective* value) {
	ValaCCodeLineDirective* _tmp0_;
	ValaCCodeLineDirective* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _vala_ccode_node_ref0 (_tmp0_);
	_vala_ccode_node_unref0 (self->priv->_line);
	self->priv->_line = _tmp1_;
}
Пример #14
0
void vala_ccode_assignment_set_right (ValaCCodeAssignment* self, ValaCCodeExpression* value) {
	ValaCCodeExpression* _tmp0_;
	ValaCCodeExpression* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _vala_ccode_node_ref0 (_tmp0_);
	_vala_ccode_node_unref0 (self->priv->_right);
	self->priv->_right = _tmp1_;
}
void vala_ccode_switch_statement_set_expression (ValaCCodeSwitchStatement* self, ValaCCodeExpression* value) {
	ValaCCodeExpression* _tmp0_;
	ValaCCodeExpression* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _vala_ccode_node_ref0 (_tmp0_);
	_vala_ccode_node_unref0 (self->priv->_expression);
	self->priv->_expression = _tmp1_;
}
void vala_ccode_macro_replacement_set_replacement_expression (ValaCCodeMacroReplacement* self, ValaCCodeExpression* value) {
	ValaCCodeExpression* _tmp0_;
	ValaCCodeExpression* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _vala_ccode_node_ref0 (_tmp0_);
	_vala_ccode_node_unref0 (self->priv->_replacement_expression);
	self->priv->_replacement_expression = _tmp1_;
}
Пример #17
0
static void vala_dova_array_module_real_visit_element_access (ValaCodeVisitor* base, ValaElementAccess* expr) {
	ValaDovaArrayModule * self;
	ValaElementAccess* _tmp0_;
	ValaList* _tmp1_ = NULL;
	ValaList* indices;
	ValaElementAccess* _tmp2_;
	ValaExpression* _tmp3_;
	ValaExpression* _tmp4_;
	ValaCCodeExpression* _tmp5_ = NULL;
	ValaCCodeExpression* ccontainer;
	gpointer _tmp6_ = NULL;
	ValaExpression* _tmp7_;
	ValaCCodeExpression* _tmp8_ = NULL;
	ValaCCodeExpression* _tmp9_;
	ValaCCodeExpression* cindex;
	ValaElementAccess* _tmp10_;
	ValaCCodeElementAccess* _tmp11_;
	ValaCCodeElementAccess* _tmp12_;
	self = (ValaDovaArrayModule*) base;
	g_return_if_fail (expr != NULL);
	_tmp0_ = expr;
	_tmp1_ = vala_element_access_get_indices (_tmp0_);
	indices = _tmp1_;
	_tmp2_ = expr;
	_tmp3_ = vala_element_access_get_container (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = vala_dova_base_module_get_cvalue ((ValaDovaBaseModule*) self, _tmp4_);
	ccontainer = _tmp5_;
	_tmp6_ = vala_list_get (indices, 0);
	_tmp7_ = (ValaExpression*) _tmp6_;
	_tmp8_ = vala_dova_base_module_get_cvalue ((ValaDovaBaseModule*) self, _tmp7_);
	_tmp9_ = _tmp8_;
	_vala_code_node_unref0 (_tmp7_);
	cindex = _tmp9_;
	_tmp10_ = expr;
	_tmp11_ = vala_ccode_element_access_new (ccontainer, cindex);
	_tmp12_ = _tmp11_;
	vala_dova_base_module_set_cvalue ((ValaDovaBaseModule*) self, (ValaExpression*) _tmp10_, (ValaCCodeExpression*) _tmp12_);
	_vala_ccode_node_unref0 (_tmp12_);
	_vala_ccode_node_unref0 (cindex);
	_vala_ccode_node_unref0 (ccontainer);
	_vala_iterable_unref0 (indices);
}
Пример #18
0
static void vala_dova_control_flow_module_real_visit_if_statement (ValaCodeVisitor* base, ValaIfStatement* stmt) {
	ValaDovaControlFlowModule * self;
	ValaCCodeFunction* _tmp0_;
	ValaCCodeFunction* _tmp1_;
	ValaIfStatement* _tmp2_;
	ValaExpression* _tmp3_;
	ValaExpression* _tmp4_;
	ValaCCodeExpression* _tmp5_ = NULL;
	ValaCCodeExpression* _tmp6_;
	ValaIfStatement* _tmp7_;
	ValaBlock* _tmp8_;
	ValaBlock* _tmp9_;
	ValaIfStatement* _tmp10_;
	ValaBlock* _tmp11_;
	ValaBlock* _tmp12_;
	ValaCCodeFunction* _tmp18_;
	ValaCCodeFunction* _tmp19_;
	self = (ValaDovaControlFlowModule*) base;
	g_return_if_fail (stmt != NULL);
	_tmp0_ = vala_dova_base_module_get_ccode ((ValaDovaBaseModule*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = stmt;
	_tmp3_ = vala_if_statement_get_condition (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = vala_dova_base_module_get_cvalue ((ValaDovaBaseModule*) self, _tmp4_);
	_tmp6_ = _tmp5_;
	vala_ccode_function_open_if (_tmp1_, _tmp6_);
	_vala_ccode_node_unref0 (_tmp6_);
	_tmp7_ = stmt;
	_tmp8_ = vala_if_statement_get_true_statement (_tmp7_);
	_tmp9_ = _tmp8_;
	vala_code_node_emit ((ValaCodeNode*) _tmp9_, (ValaCodeGenerator*) self);
	_tmp10_ = stmt;
	_tmp11_ = vala_if_statement_get_false_statement (_tmp10_);
	_tmp12_ = _tmp11_;
	if (_tmp12_ != NULL) {
		ValaCCodeFunction* _tmp13_;
		ValaCCodeFunction* _tmp14_;
		ValaIfStatement* _tmp15_;
		ValaBlock* _tmp16_;
		ValaBlock* _tmp17_;
		_tmp13_ = vala_dova_base_module_get_ccode ((ValaDovaBaseModule*) self);
		_tmp14_ = _tmp13_;
		vala_ccode_function_add_else (_tmp14_);
		_tmp15_ = stmt;
		_tmp16_ = vala_if_statement_get_false_statement (_tmp15_);
		_tmp17_ = _tmp16_;
		vala_code_node_emit ((ValaCodeNode*) _tmp17_, (ValaCodeGenerator*) self);
	}
	_tmp18_ = vala_dova_base_module_get_ccode ((ValaDovaBaseModule*) self);
	_tmp19_ = _tmp18_;
	vala_ccode_function_close (_tmp19_);
}
Пример #19
0
static void vala_ccode_file_finalize (ValaCCodeFile* obj) {
	ValaCCodeFile * self;
	self = VALA_CCODE_FILE (obj);
	_vala_iterable_unref0 (self->priv->declarations);
	_vala_iterable_unref0 (self->priv->includes);
	_vala_ccode_node_unref0 (self->priv->comments);
	_vala_ccode_node_unref0 (self->priv->include_directives);
	_vala_ccode_node_unref0 (self->priv->type_declaration);
	_vala_ccode_node_unref0 (self->priv->type_definition);
	_vala_ccode_node_unref0 (self->priv->type_member_declaration);
	_vala_ccode_node_unref0 (self->priv->constant_declaration);
	_vala_ccode_node_unref0 (self->priv->type_member_definition);
}
Пример #20
0
void vala_ccode_file_add_function_declaration (ValaCCodeFile* self, ValaCCodeFunction* func) {
	ValaCCodeFunction* _tmp0_;
	ValaCCodeFunction* _tmp1_ = NULL;
	ValaCCodeFunction* decl;
	ValaCCodeFragment* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (func != NULL);
	_tmp0_ = func;
	_tmp1_ = vala_ccode_function_copy (_tmp0_);
	decl = _tmp1_;
	vala_ccode_function_set_is_declaration (decl, TRUE);
	_tmp2_ = self->priv->type_member_declaration;
	vala_ccode_fragment_append (_tmp2_, (ValaCCodeNode*) decl);
	_vala_ccode_node_unref0 (decl);
}
Пример #21
0
static void vala_ccode_do_statement_real_write (ValaCCodeNode* base, ValaCCodeWriter* writer) {
	ValaCCodeDoStatement * self;
	ValaCCodeWriter* _tmp0_;
	ValaCCodeLineDirective* _tmp1_;
	ValaCCodeLineDirective* _tmp2_;
	ValaCCodeWriter* _tmp3_;
	ValaCCodeStatement* _tmp4_;
	ValaCCodeStatement* _tmp8_;
	ValaCCodeWriter* _tmp9_;
	ValaCCodeWriter* _tmp10_;
	ValaCCodeExpression* _tmp11_;
	ValaCCodeWriter* _tmp12_;
	ValaCCodeWriter* _tmp13_;
	self = (ValaCCodeDoStatement*) base;
	g_return_if_fail (writer != NULL);
	_tmp0_ = writer;
	_tmp1_ = vala_ccode_node_get_line ((ValaCCodeNode*) self);
	_tmp2_ = _tmp1_;
	vala_ccode_writer_write_indent (_tmp0_, _tmp2_);
	_tmp3_ = writer;
	vala_ccode_writer_write_string (_tmp3_, "do");
	_tmp4_ = self->priv->_body;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, VALA_TYPE_CCODE_BLOCK)) {
		ValaCCodeStatement* _tmp5_;
		ValaCCodeBlock* _tmp6_;
		ValaCCodeBlock* cblock;
		ValaCCodeBlock* _tmp7_;
		_tmp5_ = self->priv->_body;
		_tmp6_ = _vala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, VALA_TYPE_CCODE_BLOCK, ValaCCodeBlock));
		cblock = _tmp6_;
		_tmp7_ = cblock;
		vala_ccode_block_set_suppress_newline (_tmp7_, TRUE);
		_vala_ccode_node_unref0 (cblock);
	}
	_tmp8_ = self->priv->_body;
	_tmp9_ = writer;
	vala_ccode_node_write ((ValaCCodeNode*) _tmp8_, _tmp9_);
	_tmp10_ = writer;
	vala_ccode_writer_write_string (_tmp10_, " while (");
	_tmp11_ = self->priv->_condition;
	_tmp12_ = writer;
	vala_ccode_node_write ((ValaCCodeNode*) _tmp11_, _tmp12_);
	_tmp13_ = writer;
	vala_ccode_writer_write_string (_tmp13_, ");");
}
Пример #22
0
static void vala_dova_control_flow_module_real_visit_switch_label (ValaCodeVisitor* base, ValaSwitchLabel* label) {
	ValaDovaControlFlowModule * self;
	ValaSwitchLabel* _tmp0_;
	ValaExpression* _tmp1_;
	ValaExpression* _tmp2_;
	self = (ValaDovaControlFlowModule*) base;
	g_return_if_fail (label != NULL);
	_tmp0_ = label;
	_tmp1_ = vala_switch_label_get_expression (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		ValaSwitchLabel* _tmp3_;
		ValaExpression* _tmp4_;
		ValaExpression* _tmp5_;
		ValaSwitchLabel* _tmp6_;
		ValaExpression* _tmp7_;
		ValaExpression* _tmp8_;
		ValaCCodeFunction* _tmp9_;
		ValaCCodeFunction* _tmp10_;
		ValaSwitchLabel* _tmp11_;
		ValaExpression* _tmp12_;
		ValaExpression* _tmp13_;
		ValaCCodeExpression* _tmp14_ = NULL;
		ValaCCodeExpression* _tmp15_;
		_tmp3_ = label;
		_tmp4_ = vala_switch_label_get_expression (_tmp3_);
		_tmp5_ = _tmp4_;
		vala_code_node_emit ((ValaCodeNode*) _tmp5_, (ValaCodeGenerator*) self);
		_tmp6_ = label;
		_tmp7_ = vala_switch_label_get_expression (_tmp6_);
		_tmp8_ = _tmp7_;
		vala_code_visitor_visit_end_full_expression ((ValaCodeVisitor*) self, _tmp8_);
		_tmp9_ = vala_dova_base_module_get_ccode ((ValaDovaBaseModule*) self);
		_tmp10_ = _tmp9_;
		_tmp11_ = label;
		_tmp12_ = vala_switch_label_get_expression (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = vala_dova_base_module_get_cvalue ((ValaDovaBaseModule*) self, _tmp13_);
		_tmp15_ = _tmp14_;
		vala_ccode_function_add_case (_tmp10_, _tmp15_);
		_vala_ccode_node_unref0 (_tmp15_);
	}
}
static void vala_class_register_function_real_get_type_interface_init_statements (ValaTypeRegisterFunction* base, ValaCCodeBlock* block, gboolean plugin) {
	ValaClassRegisterFunction * self;
	ValaCodeContext* _tmp83_;
	ValaCodeContext* _tmp84_;
	ValaCodeGenerator* _tmp85_;
	ValaCodeGenerator* _tmp86_;
	ValaCCodeBlock* _tmp87_;
	ValaClass* _tmp88_;
	self = (ValaClassRegisterFunction*) base;
	g_return_if_fail (block != NULL);
	{
		ValaClass* _tmp0_;
		ValaList* _tmp1_ = NULL;
		ValaList* _base_type_list;
		ValaList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _base_type_size;
		gint _base_type_index;
		_tmp0_ = self->priv->_class_reference;
		_tmp1_ = vala_class_get_base_types (_tmp0_);
		_base_type_list = _tmp1_;
		_tmp2_ = _base_type_list;
		_tmp3_ = vala_collection_get_size ((ValaCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_base_type_size = _tmp4_;
		_base_type_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			ValaList* _tmp8_;
			gint _tmp9_;
			gpointer _tmp10_ = NULL;
			ValaDataType* base_type;
			ValaDataType* _tmp11_;
			ValaTypeSymbol* _tmp12_;
			ValaTypeSymbol* _tmp13_;
			ValaDataType* _tmp14_;
			ValaTypeSymbol* _tmp15_;
			ValaTypeSymbol* _tmp16_;
			ValaInterface* _tmp17_;
			ValaInterface* iface;
			ValaInterface* _tmp18_;
			gchar* _tmp19_ = NULL;
			gchar* _tmp20_;
			gchar* _tmp21_ = NULL;
			gchar* _tmp22_;
			gchar* iface_info_name;
			gboolean _tmp23_;
			_tmp5_ = _base_type_index;
			_base_type_index = _tmp5_ + 1;
			_tmp6_ = _base_type_index;
			_tmp7_ = _base_type_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _base_type_list;
			_tmp9_ = _base_type_index;
			_tmp10_ = vala_list_get (_tmp8_, _tmp9_);
			base_type = (ValaDataType*) _tmp10_;
			_tmp11_ = base_type;
			_tmp12_ = vala_data_type_get_data_type (_tmp11_);
			_tmp13_ = _tmp12_;
			if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp13_, VALA_TYPE_INTERFACE)) {
				_vala_code_node_unref0 (base_type);
				continue;
			}
			_tmp14_ = base_type;
			_tmp15_ = vala_data_type_get_data_type (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, VALA_TYPE_INTERFACE, ValaInterface));
			iface = _tmp17_;
			_tmp18_ = iface;
			_tmp19_ = vala_ccode_base_module_get_ccode_lower_case_name ((ValaCodeNode*) _tmp18_, NULL);
			_tmp20_ = _tmp19_;
			_tmp21_ = g_strdup_printf ("%s_info", _tmp20_);
			_tmp22_ = _tmp21_;
			_g_free0 (_tmp20_);
			iface_info_name = _tmp22_;
			_tmp23_ = plugin;
			if (!_tmp23_) {
				ValaCCodeIdentifier* _tmp24_;
				ValaCCodeIdentifier* _tmp25_;
				ValaCCodeFunctionCall* _tmp26_;
				ValaCCodeFunctionCall* _tmp27_;
				ValaCCodeFunctionCall* reg_call;
				ValaCCodeFunctionCall* _tmp28_;
				ValaClass* _tmp29_;
				gchar* _tmp30_ = NULL;
				gchar* _tmp31_;
				gchar* _tmp32_ = NULL;
				gchar* _tmp33_;
				ValaCCodeIdentifier* _tmp34_;
				ValaCCodeIdentifier* _tmp35_;
				ValaCCodeFunctionCall* _tmp36_;
				ValaInterface* _tmp37_;
				gchar* _tmp38_ = NULL;
				gchar* _tmp39_;
				ValaCCodeIdentifier* _tmp40_;
				ValaCCodeIdentifier* _tmp41_;
				ValaCCodeFunctionCall* _tmp42_;
				const gchar* _tmp43_;
				gchar* _tmp44_ = NULL;
				gchar* _tmp45_;
				ValaCCodeIdentifier* _tmp46_;
				ValaCCodeIdentifier* _tmp47_;
				ValaCCodeBlock* _tmp48_;
				ValaCCodeFunctionCall* _tmp49_;
				ValaCCodeExpressionStatement* _tmp50_;
				ValaCCodeExpressionStatement* _tmp51_;
				_tmp24_ = vala_ccode_identifier_new ("g_type_add_interface_static");
				_tmp25_ = _tmp24_;
				_tmp26_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp25_);
				_tmp27_ = _tmp26_;
				_vala_ccode_node_unref0 (_tmp25_);
				reg_call = _tmp27_;
				_tmp28_ = reg_call;
				_tmp29_ = self->priv->_class_reference;
				_tmp30_ = vala_ccode_base_module_get_ccode_lower_case_name ((ValaCodeNode*) _tmp29_, NULL);
				_tmp31_ = _tmp30_;
				_tmp32_ = g_strdup_printf ("%s_type_id", _tmp31_);
				_tmp33_ = _tmp32_;
				_tmp34_ = vala_ccode_identifier_new (_tmp33_);
				_tmp35_ = _tmp34_;
				vala_ccode_function_call_add_argument (_tmp28_, (ValaCCodeExpression*) _tmp35_);
				_vala_ccode_node_unref0 (_tmp35_);
				_g_free0 (_tmp33_);
				_g_free0 (_tmp31_);
				_tmp36_ = reg_call;
				_tmp37_ = iface;
				_tmp38_ = vala_ccode_base_module_get_ccode_type_id ((ValaCodeNode*) _tmp37_);
				_tmp39_ = _tmp38_;
				_tmp40_ = vala_ccode_identifier_new (_tmp39_);
				_tmp41_ = _tmp40_;
				vala_ccode_function_call_add_argument (_tmp36_, (ValaCCodeExpression*) _tmp41_);
				_vala_ccode_node_unref0 (_tmp41_);
				_g_free0 (_tmp39_);
				_tmp42_ = reg_call;
				_tmp43_ = iface_info_name;
				_tmp44_ = g_strdup_printf ("&%s", _tmp43_);
				_tmp45_ = _tmp44_;
				_tmp46_ = vala_ccode_identifier_new (_tmp45_);
				_tmp47_ = _tmp46_;
				vala_ccode_function_call_add_argument (_tmp42_, (ValaCCodeExpression*) _tmp47_);
				_vala_ccode_node_unref0 (_tmp47_);
				_g_free0 (_tmp45_);
				_tmp48_ = block;
				_tmp49_ = reg_call;
				_tmp50_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) _tmp49_);
				_tmp51_ = _tmp50_;
				vala_ccode_block_add_statement (_tmp48_, (ValaCCodeNode*) _tmp51_);
				_vala_ccode_node_unref0 (_tmp51_);
				_vala_ccode_node_unref0 (reg_call);
			} else {
				ValaCCodeIdentifier* _tmp52_;
				ValaCCodeIdentifier* _tmp53_;
				ValaCCodeFunctionCall* _tmp54_;
				ValaCCodeFunctionCall* _tmp55_;
				ValaCCodeFunctionCall* reg_call;
				ValaCCodeFunctionCall* _tmp56_;
				ValaCCodeIdentifier* _tmp57_;
				ValaCCodeIdentifier* _tmp58_;
				ValaCCodeFunctionCall* _tmp59_;
				ValaClass* _tmp60_;
				gchar* _tmp61_ = NULL;
				gchar* _tmp62_;
				gchar* _tmp63_ = NULL;
				gchar* _tmp64_;
				ValaCCodeIdentifier* _tmp65_;
				ValaCCodeIdentifier* _tmp66_;
				ValaCCodeFunctionCall* _tmp67_;
				ValaInterface* _tmp68_;
				gchar* _tmp69_ = NULL;
				gchar* _tmp70_;
				ValaCCodeIdentifier* _tmp71_;
				ValaCCodeIdentifier* _tmp72_;
				ValaCCodeFunctionCall* _tmp73_;
				const gchar* _tmp74_;
				gchar* _tmp75_ = NULL;
				gchar* _tmp76_;
				ValaCCodeIdentifier* _tmp77_;
				ValaCCodeIdentifier* _tmp78_;
				ValaCCodeBlock* _tmp79_;
				ValaCCodeFunctionCall* _tmp80_;
				ValaCCodeExpressionStatement* _tmp81_;
				ValaCCodeExpressionStatement* _tmp82_;
				_tmp52_ = vala_ccode_identifier_new ("g_type_module_add_interface");
				_tmp53_ = _tmp52_;
				_tmp54_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp53_);
				_tmp55_ = _tmp54_;
				_vala_ccode_node_unref0 (_tmp53_);
				reg_call = _tmp55_;
				_tmp56_ = reg_call;
				_tmp57_ = vala_ccode_identifier_new ("module");
				_tmp58_ = _tmp57_;
				vala_ccode_function_call_add_argument (_tmp56_, (ValaCCodeExpression*) _tmp58_);
				_vala_ccode_node_unref0 (_tmp58_);
				_tmp59_ = reg_call;
				_tmp60_ = self->priv->_class_reference;
				_tmp61_ = vala_ccode_base_module_get_ccode_lower_case_name ((ValaCodeNode*) _tmp60_, NULL);
				_tmp62_ = _tmp61_;
				_tmp63_ = g_strdup_printf ("%s_type_id", _tmp62_);
				_tmp64_ = _tmp63_;
				_tmp65_ = vala_ccode_identifier_new (_tmp64_);
				_tmp66_ = _tmp65_;
				vala_ccode_function_call_add_argument (_tmp59_, (ValaCCodeExpression*) _tmp66_);
				_vala_ccode_node_unref0 (_tmp66_);
				_g_free0 (_tmp64_);
				_g_free0 (_tmp62_);
				_tmp67_ = reg_call;
				_tmp68_ = iface;
				_tmp69_ = vala_ccode_base_module_get_ccode_type_id ((ValaCodeNode*) _tmp68_);
				_tmp70_ = _tmp69_;
				_tmp71_ = vala_ccode_identifier_new (_tmp70_);
				_tmp72_ = _tmp71_;
				vala_ccode_function_call_add_argument (_tmp67_, (ValaCCodeExpression*) _tmp72_);
				_vala_ccode_node_unref0 (_tmp72_);
				_g_free0 (_tmp70_);
				_tmp73_ = reg_call;
				_tmp74_ = iface_info_name;
				_tmp75_ = g_strdup_printf ("&%s", _tmp74_);
				_tmp76_ = _tmp75_;
				_tmp77_ = vala_ccode_identifier_new (_tmp76_);
				_tmp78_ = _tmp77_;
				vala_ccode_function_call_add_argument (_tmp73_, (ValaCCodeExpression*) _tmp78_);
				_vala_ccode_node_unref0 (_tmp78_);
				_g_free0 (_tmp76_);
				_tmp79_ = block;
				_tmp80_ = reg_call;
				_tmp81_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) _tmp80_);
				_tmp82_ = _tmp81_;
				vala_ccode_block_add_statement (_tmp79_, (ValaCCodeNode*) _tmp82_);
				_vala_ccode_node_unref0 (_tmp82_);
				_vala_ccode_node_unref0 (reg_call);
			}
			_g_free0 (iface_info_name);
			_vala_code_node_unref0 (iface);
			_vala_code_node_unref0 (base_type);
		}
		_vala_iterable_unref0 (_base_type_list);
	}
	_tmp83_ = vala_typeregister_function_get_context ((ValaTypeRegisterFunction*) self);
	_tmp84_ = _tmp83_;
	_tmp85_ = vala_code_context_get_codegen (_tmp84_);
	_tmp86_ = _tmp85_;
	_tmp87_ = block;
	_tmp88_ = self->priv->_class_reference;
	vala_ccode_base_module_register_dbus_info (G_TYPE_CHECK_INSTANCE_CAST (_tmp86_, VALA_TYPE_CCODE_BASE_MODULE, ValaCCodeBaseModule), _tmp87_, (ValaObjectTypeSymbol*) _tmp88_);
}
static ValaCCodeFragment* vala_class_register_function_real_get_type_interface_init_declaration (ValaTypeRegisterFunction* base) {
	ValaClassRegisterFunction * self;
	ValaCCodeFragment* result = NULL;
	ValaCCodeFragment* _tmp0_;
	ValaCCodeFragment* frag;
	self = (ValaClassRegisterFunction*) base;
	_tmp0_ = vala_ccode_fragment_new ();
	frag = _tmp0_;
	{
		ValaClass* _tmp1_;
		ValaList* _tmp2_ = NULL;
		ValaList* _base_type_list;
		ValaList* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gint _base_type_size;
		gint _base_type_index;
		_tmp1_ = self->priv->_class_reference;
		_tmp2_ = vala_class_get_base_types (_tmp1_);
		_base_type_list = _tmp2_;
		_tmp3_ = _base_type_list;
		_tmp4_ = vala_collection_get_size ((ValaCollection*) _tmp3_);
		_tmp5_ = _tmp4_;
		_base_type_size = _tmp5_;
		_base_type_index = -1;
		while (TRUE) {
			gint _tmp6_;
			gint _tmp7_;
			gint _tmp8_;
			ValaList* _tmp9_;
			gint _tmp10_;
			gpointer _tmp11_ = NULL;
			ValaDataType* base_type;
			ValaDataType* _tmp12_;
			ValaTypeSymbol* _tmp13_;
			ValaTypeSymbol* _tmp14_;
			ValaDataType* _tmp15_;
			ValaTypeSymbol* _tmp16_;
			ValaTypeSymbol* _tmp17_;
			ValaInterface* _tmp18_;
			ValaInterface* iface;
			ValaInterface* _tmp19_;
			gchar* _tmp20_ = NULL;
			gchar* _tmp21_;
			gchar* _tmp22_ = NULL;
			gchar* _tmp23_;
			gchar* iface_info_name;
			ValaCCodeDeclaration* _tmp24_;
			ValaCCodeDeclaration* ctypedecl;
			ValaCCodeDeclaration* _tmp25_;
			ValaCCodeDeclaration* _tmp26_;
			const gchar* _tmp27_;
			ValaClass* _tmp28_;
			gchar* _tmp29_ = NULL;
			gchar* _tmp30_;
			ValaInterface* _tmp31_;
			gchar* _tmp32_ = NULL;
			gchar* _tmp33_;
			gchar* _tmp34_ = NULL;
			gchar* _tmp35_;
			ValaCCodeConstant* _tmp36_;
			ValaCCodeConstant* _tmp37_;
			ValaCCodeVariableDeclarator* _tmp38_;
			ValaCCodeVariableDeclarator* _tmp39_;
			ValaCCodeFragment* _tmp40_;
			ValaCCodeDeclaration* _tmp41_;
			_tmp6_ = _base_type_index;
			_base_type_index = _tmp6_ + 1;
			_tmp7_ = _base_type_index;
			_tmp8_ = _base_type_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _base_type_list;
			_tmp10_ = _base_type_index;
			_tmp11_ = vala_list_get (_tmp9_, _tmp10_);
			base_type = (ValaDataType*) _tmp11_;
			_tmp12_ = base_type;
			_tmp13_ = vala_data_type_get_data_type (_tmp12_);
			_tmp14_ = _tmp13_;
			if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, VALA_TYPE_INTERFACE)) {
				_vala_code_node_unref0 (base_type);
				continue;
			}
			_tmp15_ = base_type;
			_tmp16_ = vala_data_type_get_data_type (_tmp15_);
			_tmp17_ = _tmp16_;
			_tmp18_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, VALA_TYPE_INTERFACE, ValaInterface));
			iface = _tmp18_;
			_tmp19_ = iface;
			_tmp20_ = vala_ccode_base_module_get_ccode_lower_case_name ((ValaCodeNode*) _tmp19_, NULL);
			_tmp21_ = _tmp20_;
			_tmp22_ = g_strdup_printf ("%s_info", _tmp21_);
			_tmp23_ = _tmp22_;
			_g_free0 (_tmp21_);
			iface_info_name = _tmp23_;
			_tmp24_ = vala_ccode_declaration_new ("const GInterfaceInfo");
			ctypedecl = _tmp24_;
			_tmp25_ = ctypedecl;
			vala_ccode_declaration_set_modifiers (_tmp25_, VALA_CCODE_MODIFIERS_STATIC);
			_tmp26_ = ctypedecl;
			_tmp27_ = iface_info_name;
			_tmp28_ = self->priv->_class_reference;
			_tmp29_ = vala_ccode_base_module_get_ccode_lower_case_name ((ValaCodeNode*) _tmp28_, NULL);
			_tmp30_ = _tmp29_;
			_tmp31_ = iface;
			_tmp32_ = vala_ccode_base_module_get_ccode_lower_case_name ((ValaCodeNode*) _tmp31_, NULL);
			_tmp33_ = _tmp32_;
			_tmp34_ = g_strdup_printf ("{ (GInterfaceInitFunc) %s_%s_interface_init, (GInterfaceFinalizeFunc) " \
"NULL, NULL}", _tmp30_, _tmp33_);
			_tmp35_ = _tmp34_;
			_tmp36_ = vala_ccode_constant_new (_tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = vala_ccode_variable_declarator_new (_tmp27_, (ValaCCodeExpression*) _tmp37_, NULL);
			_tmp39_ = _tmp38_;
			vala_ccode_declaration_add_declarator (_tmp26_, (ValaCCodeDeclarator*) _tmp39_);
			_vala_ccode_node_unref0 (_tmp39_);
			_vala_ccode_node_unref0 (_tmp37_);
			_g_free0 (_tmp35_);
			_g_free0 (_tmp33_);
			_g_free0 (_tmp30_);
			_tmp40_ = frag;
			_tmp41_ = ctypedecl;
			vala_ccode_fragment_append (_tmp40_, (ValaCCodeNode*) _tmp41_);
			_vala_ccode_node_unref0 (ctypedecl);
			_g_free0 (iface_info_name);
			_vala_code_node_unref0 (iface);
			_vala_code_node_unref0 (base_type);
		}
		_vala_iterable_unref0 (_base_type_list);
	}
	result = frag;
	return result;
}
Пример #25
0
static void vala_dova_array_module_real_visit_slice_expression (ValaCodeVisitor* base, ValaSliceExpression* expr) {
	ValaDovaArrayModule * self;
	ValaSliceExpression* _tmp0_;
	ValaExpression* _tmp1_;
	ValaExpression* _tmp2_;
	ValaCCodeExpression* _tmp3_ = NULL;
	ValaCCodeExpression* ccontainer;
	ValaSliceExpression* _tmp4_;
	ValaExpression* _tmp5_;
	ValaExpression* _tmp6_;
	ValaCCodeExpression* _tmp7_ = NULL;
	ValaCCodeExpression* cstart;
	ValaSliceExpression* _tmp8_;
	ValaExpression* _tmp9_;
	ValaExpression* _tmp10_;
	ValaCCodeExpression* _tmp11_ = NULL;
	ValaCCodeExpression* cstop;
	ValaSliceExpression* _tmp12_;
	ValaExpression* _tmp13_;
	ValaExpression* _tmp14_;
	ValaDataType* _tmp15_;
	ValaDataType* _tmp16_;
	ValaArrayType* _tmp17_;
	ValaArrayType* array_type;
	ValaCCodeIdentifier* _tmp18_;
	ValaCCodeIdentifier* _tmp19_;
	ValaCCodeFunctionCall* _tmp20_;
	ValaCCodeFunctionCall* _tmp21_;
	ValaCCodeFunctionCall* array;
	ValaCCodeMemberAccess* _tmp22_;
	ValaCCodeMemberAccess* _tmp23_;
	ValaDataType* _tmp24_;
	ValaDataType* _tmp25_;
	gchar* _tmp26_ = NULL;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	ValaCCodeCastExpression* _tmp30_;
	ValaCCodeCastExpression* _tmp31_;
	ValaCCodeBinaryExpression* _tmp32_;
	ValaCCodeBinaryExpression* _tmp33_;
	ValaCCodeBinaryExpression* _tmp34_;
	ValaCCodeBinaryExpression* _tmp35_;
	ValaSliceExpression* _tmp36_;
	self = (ValaDovaArrayModule*) base;
	g_return_if_fail (expr != NULL);
	_tmp0_ = expr;
	_tmp1_ = vala_slice_expression_get_container (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = vala_dova_base_module_get_cvalue ((ValaDovaBaseModule*) self, _tmp2_);
	ccontainer = _tmp3_;
	_tmp4_ = expr;
	_tmp5_ = vala_slice_expression_get_start (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = vala_dova_base_module_get_cvalue ((ValaDovaBaseModule*) self, _tmp6_);
	cstart = _tmp7_;
	_tmp8_ = expr;
	_tmp9_ = vala_slice_expression_get_stop (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = vala_dova_base_module_get_cvalue ((ValaDovaBaseModule*) self, _tmp10_);
	cstop = _tmp11_;
	_tmp12_ = expr;
	_tmp13_ = vala_slice_expression_get_container (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = vala_expression_get_value_type (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = _vala_code_node_ref0 (VALA_ARRAY_TYPE (_tmp16_));
	array_type = _tmp17_;
	_tmp18_ = vala_ccode_identifier_new ("dova_array");
	_tmp19_ = _tmp18_;
	_tmp20_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp19_);
	_tmp21_ = _tmp20_;
	_vala_ccode_node_unref0 (_tmp19_);
	array = _tmp21_;
	_tmp22_ = vala_ccode_member_access_new (ccontainer, "data", FALSE);
	_tmp23_ = _tmp22_;
	_tmp24_ = vala_array_type_get_element_type (array_type);
	_tmp25_ = _tmp24_;
	_tmp26_ = vala_dova_base_module_get_ccode_name ((ValaDovaBaseModule*) self, (ValaCodeNode*) _tmp25_);
	_tmp27_ = _tmp26_;
	_tmp28_ = g_strconcat (_tmp27_, "*", NULL);
	_tmp29_ = _tmp28_;
	_tmp30_ = vala_ccode_cast_expression_new ((ValaCCodeExpression*) _tmp23_, _tmp29_);
	_tmp31_ = _tmp30_;
	_tmp32_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_PLUS, (ValaCCodeExpression*) _tmp31_, cstart);
	_tmp33_ = _tmp32_;
	vala_ccode_function_call_add_argument (array, (ValaCCodeExpression*) _tmp33_);
	_vala_ccode_node_unref0 (_tmp33_);
	_vala_ccode_node_unref0 (_tmp31_);
	_g_free0 (_tmp29_);
	_g_free0 (_tmp27_);
	_vala_ccode_node_unref0 (_tmp23_);
	_tmp34_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_MINUS, cstop, cstart);
	_tmp35_ = _tmp34_;
	vala_ccode_function_call_add_argument (array, (ValaCCodeExpression*) _tmp35_);
	_vala_ccode_node_unref0 (_tmp35_);
	_tmp36_ = expr;
	vala_dova_base_module_set_cvalue ((ValaDovaBaseModule*) self, (ValaExpression*) _tmp36_, (ValaCCodeExpression*) array);
	_vala_ccode_node_unref0 (array);
	_vala_code_node_unref0 (array_type);
	_vala_ccode_node_unref0 (cstop);
	_vala_ccode_node_unref0 (cstart);
	_vala_ccode_node_unref0 (ccontainer);
}
static void vala_ccode_switch_statement_finalize (ValaCCodeNode* obj) {
	ValaCCodeSwitchStatement * self;
	self = VALA_CCODE_SWITCH_STATEMENT (obj);
	_vala_ccode_node_unref0 (self->priv->_expression);
	VALA_CCODE_NODE_CLASS (vala_ccode_switch_statement_parent_class)->finalize (obj);
}
Пример #27
0
static void vala_ccode_node_finalize (ValaCCodeNode* obj) {
	ValaCCodeNode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_CCODE_NODE, ValaCCodeNode);
	_vala_ccode_node_unref0 (self->priv->_line);
}
Пример #28
0
static void vala_ccode_file_get_symbols_from_fragment (ValaCCodeFile* self, ValaList* symbols, ValaCCodeFragment* fragment) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (symbols != NULL);
	g_return_if_fail (fragment != NULL);
	{
		ValaCCodeFragment* _tmp0_;
		ValaList* _tmp1_ = NULL;
		ValaList* _node_list;
		ValaList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _node_size;
		gint _node_index;
		_tmp0_ = fragment;
		_tmp1_ = vala_ccode_fragment_get_children (_tmp0_);
		_node_list = _tmp1_;
		_tmp2_ = _node_list;
		_tmp3_ = vala_collection_get_size ((ValaCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_node_size = _tmp4_;
		_node_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			ValaList* _tmp8_;
			gint _tmp9_;
			gpointer _tmp10_ = NULL;
			ValaCCodeNode* node;
			ValaCCodeNode* _tmp11_;
			_tmp5_ = _node_index;
			_node_index = _tmp5_ + 1;
			_tmp6_ = _node_index;
			_tmp7_ = _node_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _node_list;
			_tmp9_ = _node_index;
			_tmp10_ = vala_list_get (_tmp8_, _tmp9_);
			node = (ValaCCodeNode*) _tmp10_;
			_tmp11_ = node;
			if (VALA_IS_CCODE_FRAGMENT (_tmp11_)) {
				ValaList* _tmp12_;
				ValaCCodeNode* _tmp13_;
				_tmp12_ = symbols;
				_tmp13_ = node;
				vala_ccode_file_get_symbols_from_fragment (self, _tmp12_, VALA_CCODE_FRAGMENT (_tmp13_));
			} else {
				ValaCCodeNode* _tmp14_;
				ValaCCodeFunction* _tmp15_;
				ValaCCodeFunction* func;
				ValaCCodeFunction* _tmp16_;
				_tmp14_ = node;
				_tmp15_ = _vala_ccode_node_ref0 (VALA_IS_CCODE_FUNCTION (_tmp14_) ? ((ValaCCodeFunction*) _tmp14_) : NULL);
				func = _tmp15_;
				_tmp16_ = func;
				if (_tmp16_ != NULL) {
					ValaList* _tmp17_;
					ValaCCodeFunction* _tmp18_;
					const gchar* _tmp19_;
					const gchar* _tmp20_;
					_tmp17_ = symbols;
					_tmp18_ = func;
					_tmp19_ = vala_ccode_function_get_name (_tmp18_);
					_tmp20_ = _tmp19_;
					vala_collection_add ((ValaCollection*) _tmp17_, _tmp20_);
				}
				_vala_ccode_node_unref0 (func);
			}
			_vala_ccode_node_unref0 (node);
		}
		_vala_iterable_unref0 (_node_list);
	}
}
Пример #29
0
gboolean vala_ccode_file_store (ValaCCodeFile* self, const gchar* filename, const gchar* source_filename, gboolean write_version, gboolean line_directives, const gchar* begin_decls, const gchar* end_decls) {
	gboolean result = FALSE;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	ValaCCodeWriter* _tmp2_;
	ValaCCodeWriter* writer;
	ValaCCodeWriter* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_;
	ValaCCodeWriter* _tmp93_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (filename != NULL, FALSE);
	_tmp0_ = filename;
	_tmp1_ = source_filename;
	_tmp2_ = vala_ccode_writer_new (_tmp0_, _tmp1_);
	writer = _tmp2_;
	_tmp3_ = writer;
	_tmp4_ = write_version;
	_tmp5_ = vala_ccode_writer_open (_tmp3_, _tmp4_);
	if (!_tmp5_) {
		result = FALSE;
		_vala_ccode_writer_unref0 (writer);
		return result;
	}
	_tmp6_ = self->priv->_is_header;
	if (!_tmp6_) {
		ValaCCodeWriter* _tmp7_;
		gboolean _tmp8_;
		ValaCCodeFragment* _tmp9_;
		ValaCCodeWriter* _tmp10_;
		ValaCCodeWriter* _tmp11_;
		ValaCCodeFragment* _tmp12_;
		ValaCCodeWriter* _tmp13_;
		ValaCCodeWriter* _tmp14_;
		ValaCCodeFragment* _tmp15_;
		ValaCCodeWriter* _tmp16_;
		ValaCCodeWriter* _tmp17_;
		ValaCCodeFragment* _tmp18_;
		ValaCCodeWriter* _tmp19_;
		ValaCCodeWriter* _tmp20_;
		ValaCCodeFragment* _tmp21_;
		ValaCCodeWriter* _tmp22_;
		ValaCCodeWriter* _tmp23_;
		ValaCCodeFragment* _tmp24_;
		ValaCCodeWriter* _tmp25_;
		ValaCCodeWriter* _tmp26_;
		ValaCCodeFragment* _tmp27_;
		ValaCCodeWriter* _tmp28_;
		ValaCCodeWriter* _tmp29_;
		ValaCCodeFragment* _tmp30_;
		ValaCCodeWriter* _tmp31_;
		ValaCCodeWriter* _tmp32_;
		_tmp7_ = writer;
		_tmp8_ = line_directives;
		vala_ccode_writer_set_line_directives (_tmp7_, _tmp8_);
		_tmp9_ = self->priv->comments;
		_tmp10_ = writer;
		vala_ccode_node_write ((ValaCCodeNode*) _tmp9_, _tmp10_);
		_tmp11_ = writer;
		vala_ccode_writer_write_newline (_tmp11_);
		_tmp12_ = self->priv->include_directives;
		_tmp13_ = writer;
		vala_ccode_node_write ((ValaCCodeNode*) _tmp12_, _tmp13_);
		_tmp14_ = writer;
		vala_ccode_writer_write_newline (_tmp14_);
		_tmp15_ = self->priv->type_declaration;
		_tmp16_ = writer;
		vala_ccode_node_write_combined ((ValaCCodeNode*) _tmp15_, _tmp16_);
		_tmp17_ = writer;
		vala_ccode_writer_write_newline (_tmp17_);
		_tmp18_ = self->priv->type_definition;
		_tmp19_ = writer;
		vala_ccode_node_write_combined ((ValaCCodeNode*) _tmp18_, _tmp19_);
		_tmp20_ = writer;
		vala_ccode_writer_write_newline (_tmp20_);
		_tmp21_ = self->priv->type_member_declaration;
		_tmp22_ = writer;
		vala_ccode_node_write_declaration ((ValaCCodeNode*) _tmp21_, _tmp22_);
		_tmp23_ = writer;
		vala_ccode_writer_write_newline (_tmp23_);
		_tmp24_ = self->priv->type_member_declaration;
		_tmp25_ = writer;
		vala_ccode_node_write ((ValaCCodeNode*) _tmp24_, _tmp25_);
		_tmp26_ = writer;
		vala_ccode_writer_write_newline (_tmp26_);
		_tmp27_ = self->priv->constant_declaration;
		_tmp28_ = writer;
		vala_ccode_node_write_combined ((ValaCCodeNode*) _tmp27_, _tmp28_);
		_tmp29_ = writer;
		vala_ccode_writer_write_newline (_tmp29_);
		_tmp30_ = self->priv->type_member_definition;
		_tmp31_ = writer;
		vala_ccode_node_write ((ValaCCodeNode*) _tmp30_, _tmp31_);
		_tmp32_ = writer;
		vala_ccode_writer_write_newline (_tmp32_);
	} else {
		ValaCCodeWriter* _tmp33_;
		ValaCCodeWriter* _tmp34_;
		const gchar* _tmp35_;
		const gchar* _tmp36_;
		gchar* _tmp37_ = NULL;
		gchar* _tmp38_;
		ValaCCodeOnceSection* _tmp39_;
		ValaCCodeOnceSection* _tmp40_;
		ValaCCodeOnceSection* once;
		ValaCCodeOnceSection* _tmp41_;
		ValaCCodeNewline* _tmp42_;
		ValaCCodeNewline* _tmp43_;
		ValaCCodeOnceSection* _tmp44_;
		ValaCCodeFragment* _tmp45_;
		ValaCCodeOnceSection* _tmp46_;
		ValaCCodeNewline* _tmp47_;
		ValaCCodeNewline* _tmp48_;
		const gchar* _tmp49_;
		ValaCCodeOnceSection* _tmp57_;
		ValaCCodeNewline* _tmp58_;
		ValaCCodeNewline* _tmp59_;
		ValaCCodeOnceSection* _tmp60_;
		ValaCCodeFragment* _tmp61_;
		ValaCCodeOnceSection* _tmp62_;
		ValaCCodeNewline* _tmp63_;
		ValaCCodeNewline* _tmp64_;
		ValaCCodeOnceSection* _tmp65_;
		ValaCCodeFragment* _tmp66_;
		ValaCCodeOnceSection* _tmp67_;
		ValaCCodeNewline* _tmp68_;
		ValaCCodeNewline* _tmp69_;
		ValaCCodeOnceSection* _tmp70_;
		ValaCCodeFragment* _tmp71_;
		ValaCCodeOnceSection* _tmp72_;
		ValaCCodeNewline* _tmp73_;
		ValaCCodeNewline* _tmp74_;
		ValaCCodeOnceSection* _tmp75_;
		ValaCCodeFragment* _tmp76_;
		ValaCCodeOnceSection* _tmp77_;
		ValaCCodeNewline* _tmp78_;
		ValaCCodeNewline* _tmp79_;
		const gchar* _tmp80_;
		ValaCCodeOnceSection* _tmp88_;
		ValaCCodeNewline* _tmp89_;
		ValaCCodeNewline* _tmp90_;
		ValaCCodeOnceSection* _tmp91_;
		ValaCCodeWriter* _tmp92_;
		_tmp33_ = writer;
		vala_ccode_writer_write_newline (_tmp33_);
		_tmp34_ = writer;
		_tmp35_ = vala_ccode_writer_get_filename (_tmp34_);
		_tmp36_ = _tmp35_;
		_tmp37_ = vala_ccode_file_get_define_for_filename (_tmp36_);
		_tmp38_ = _tmp37_;
		_tmp39_ = vala_ccode_once_section_new (_tmp38_);
		_tmp40_ = _tmp39_;
		_g_free0 (_tmp38_);
		once = _tmp40_;
		_tmp41_ = once;
		_tmp42_ = vala_ccode_newline_new ();
		_tmp43_ = _tmp42_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp41_, (ValaCCodeNode*) _tmp43_);
		_vala_ccode_node_unref0 (_tmp43_);
		_tmp44_ = once;
		_tmp45_ = self->priv->include_directives;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp44_, (ValaCCodeNode*) _tmp45_);
		_tmp46_ = once;
		_tmp47_ = vala_ccode_newline_new ();
		_tmp48_ = _tmp47_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp46_, (ValaCCodeNode*) _tmp48_);
		_vala_ccode_node_unref0 (_tmp48_);
		_tmp49_ = begin_decls;
		if (_tmp49_ != NULL) {
			ValaCCodeOnceSection* _tmp50_;
			const gchar* _tmp51_;
			ValaCCodeIdentifier* _tmp52_;
			ValaCCodeIdentifier* _tmp53_;
			ValaCCodeOnceSection* _tmp54_;
			ValaCCodeNewline* _tmp55_;
			ValaCCodeNewline* _tmp56_;
			_tmp50_ = once;
			_tmp51_ = begin_decls;
			_tmp52_ = vala_ccode_identifier_new (_tmp51_);
			_tmp53_ = _tmp52_;
			vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp50_, (ValaCCodeNode*) _tmp53_);
			_vala_ccode_node_unref0 (_tmp53_);
			_tmp54_ = once;
			_tmp55_ = vala_ccode_newline_new ();
			_tmp56_ = _tmp55_;
			vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp54_, (ValaCCodeNode*) _tmp56_);
			_vala_ccode_node_unref0 (_tmp56_);
		}
		_tmp57_ = once;
		_tmp58_ = vala_ccode_newline_new ();
		_tmp59_ = _tmp58_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp57_, (ValaCCodeNode*) _tmp59_);
		_vala_ccode_node_unref0 (_tmp59_);
		_tmp60_ = once;
		_tmp61_ = self->priv->type_declaration;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp60_, (ValaCCodeNode*) _tmp61_);
		_tmp62_ = once;
		_tmp63_ = vala_ccode_newline_new ();
		_tmp64_ = _tmp63_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp62_, (ValaCCodeNode*) _tmp64_);
		_vala_ccode_node_unref0 (_tmp64_);
		_tmp65_ = once;
		_tmp66_ = self->priv->type_definition;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp65_, (ValaCCodeNode*) _tmp66_);
		_tmp67_ = once;
		_tmp68_ = vala_ccode_newline_new ();
		_tmp69_ = _tmp68_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp67_, (ValaCCodeNode*) _tmp69_);
		_vala_ccode_node_unref0 (_tmp69_);
		_tmp70_ = once;
		_tmp71_ = self->priv->type_member_declaration;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp70_, (ValaCCodeNode*) _tmp71_);
		_tmp72_ = once;
		_tmp73_ = vala_ccode_newline_new ();
		_tmp74_ = _tmp73_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp72_, (ValaCCodeNode*) _tmp74_);
		_vala_ccode_node_unref0 (_tmp74_);
		_tmp75_ = once;
		_tmp76_ = self->priv->constant_declaration;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp75_, (ValaCCodeNode*) _tmp76_);
		_tmp77_ = once;
		_tmp78_ = vala_ccode_newline_new ();
		_tmp79_ = _tmp78_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp77_, (ValaCCodeNode*) _tmp79_);
		_vala_ccode_node_unref0 (_tmp79_);
		_tmp80_ = begin_decls;
		if (_tmp80_ != NULL) {
			ValaCCodeOnceSection* _tmp81_;
			const gchar* _tmp82_;
			ValaCCodeIdentifier* _tmp83_;
			ValaCCodeIdentifier* _tmp84_;
			ValaCCodeOnceSection* _tmp85_;
			ValaCCodeNewline* _tmp86_;
			ValaCCodeNewline* _tmp87_;
			_tmp81_ = once;
			_tmp82_ = end_decls;
			_tmp83_ = vala_ccode_identifier_new (_tmp82_);
			_tmp84_ = _tmp83_;
			vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp81_, (ValaCCodeNode*) _tmp84_);
			_vala_ccode_node_unref0 (_tmp84_);
			_tmp85_ = once;
			_tmp86_ = vala_ccode_newline_new ();
			_tmp87_ = _tmp86_;
			vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp85_, (ValaCCodeNode*) _tmp87_);
			_vala_ccode_node_unref0 (_tmp87_);
		}
		_tmp88_ = once;
		_tmp89_ = vala_ccode_newline_new ();
		_tmp90_ = _tmp89_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp88_, (ValaCCodeNode*) _tmp90_);
		_vala_ccode_node_unref0 (_tmp90_);
		_tmp91_ = once;
		_tmp92_ = writer;
		vala_ccode_node_write ((ValaCCodeNode*) _tmp91_, _tmp92_);
		_vala_ccode_node_unref0 (once);
	}
	_tmp93_ = writer;
	vala_ccode_writer_close (_tmp93_);
	result = TRUE;
	_vala_ccode_writer_unref0 (writer);
	return result;
}
Пример #30
0
static void vala_dova_control_flow_module_real_visit_switch_statement (ValaCodeVisitor* base, ValaSwitchStatement* stmt) {
	ValaDovaControlFlowModule * self;
	ValaCCodeFunction* _tmp0_;
	ValaCCodeFunction* _tmp1_;
	ValaSwitchStatement* _tmp2_;
	ValaExpression* _tmp3_;
	ValaExpression* _tmp4_;
	ValaCCodeExpression* _tmp5_ = NULL;
	ValaCCodeExpression* _tmp6_;
	ValaCCodeFunction* _tmp23_;
	ValaCCodeFunction* _tmp24_;
	self = (ValaDovaControlFlowModule*) base;
	g_return_if_fail (stmt != NULL);
	_tmp0_ = vala_dova_base_module_get_ccode ((ValaDovaBaseModule*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = stmt;
	_tmp3_ = vala_switch_statement_get_expression (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = vala_dova_base_module_get_cvalue ((ValaDovaBaseModule*) self, _tmp4_);
	_tmp6_ = _tmp5_;
	vala_ccode_function_open_switch (_tmp1_, _tmp6_);
	_vala_ccode_node_unref0 (_tmp6_);
	{
		ValaSwitchStatement* _tmp7_;
		ValaList* _tmp8_ = NULL;
		ValaList* _section_list;
		ValaList* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		gint _section_size;
		gint _section_index;
		_tmp7_ = stmt;
		_tmp8_ = vala_switch_statement_get_sections (_tmp7_);
		_section_list = _tmp8_;
		_tmp9_ = _section_list;
		_tmp10_ = vala_collection_get_size ((ValaCollection*) _tmp9_);
		_tmp11_ = _tmp10_;
		_section_size = _tmp11_;
		_section_index = -1;
		while (TRUE) {
			gint _tmp12_;
			gint _tmp13_;
			gint _tmp14_;
			ValaList* _tmp15_;
			gint _tmp16_;
			gpointer _tmp17_ = NULL;
			ValaSwitchSection* section;
			ValaSwitchSection* _tmp18_;
			gboolean _tmp19_ = FALSE;
			ValaSwitchSection* _tmp22_;
			_tmp12_ = _section_index;
			_section_index = _tmp12_ + 1;
			_tmp13_ = _section_index;
			_tmp14_ = _section_size;
			if (!(_tmp13_ < _tmp14_)) {
				break;
			}
			_tmp15_ = _section_list;
			_tmp16_ = _section_index;
			_tmp17_ = vala_list_get (_tmp15_, _tmp16_);
			section = (ValaSwitchSection*) _tmp17_;
			_tmp18_ = section;
			_tmp19_ = vala_switch_section_has_default_label (_tmp18_);
			if (_tmp19_) {
				ValaCCodeFunction* _tmp20_;
				ValaCCodeFunction* _tmp21_;
				_tmp20_ = vala_dova_base_module_get_ccode ((ValaDovaBaseModule*) self);
				_tmp21_ = _tmp20_;
				vala_ccode_function_add_default (_tmp21_);
			}
			_tmp22_ = section;
			vala_code_node_emit ((ValaCodeNode*) _tmp22_, (ValaCodeGenerator*) self);
			_vala_code_node_unref0 (section);
		}
		_vala_iterable_unref0 (_section_list);
	}
	_tmp23_ = vala_dova_base_module_get_ccode ((ValaDovaBaseModule*) self);
	_tmp24_ = _tmp23_;
	vala_ccode_function_close (_tmp24_);
}