Logo Search packages:      
Sourcecode: vala-0.12 version File versions  Download package

valagerrormodule.c

/* valagerrormodule.c generated by valac, the Vala compiler
 * generated from valagerrormodule.vala, do not modify */

/* valagerrormodule.vala
 *
 * Copyright (C) 2008-2010  Jürg Billeter
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 *    Jürg Billeter <j@bitron.ch>
 *    Thijs Vermeir <thijsvermeir@gmail.com>
 */

#include <glib.h>
#include <glib-object.h>
#include <vala.h>
#include <valaccode.h>
#include <valagee.h>
#include <stdlib.h>
#include <string.h>


#define VALA_TYPE_CCODE_BASE_MODULE (vala_ccode_base_module_get_type ())
#define VALA_CCODE_BASE_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_BASE_MODULE, ValaCCodeBaseModule))
#define VALA_CCODE_BASE_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_BASE_MODULE, ValaCCodeBaseModuleClass))
#define VALA_IS_CCODE_BASE_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_BASE_MODULE))
#define VALA_IS_CCODE_BASE_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_BASE_MODULE))
#define VALA_CCODE_BASE_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_BASE_MODULE, ValaCCodeBaseModuleClass))

typedef struct _ValaCCodeBaseModule ValaCCodeBaseModule;
typedef struct _ValaCCodeBaseModuleClass ValaCCodeBaseModuleClass;
typedef struct _ValaCCodeBaseModulePrivate ValaCCodeBaseModulePrivate;

#define VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT (vala_ccode_base_module_emit_context_get_type ())
#define VALA_CCODE_BASE_MODULE_EMIT_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT, ValaCCodeBaseModuleEmitContext))
#define VALA_CCODE_BASE_MODULE_EMIT_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT, ValaCCodeBaseModuleEmitContextClass))
#define VALA_CCODE_BASE_MODULE_IS_EMIT_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT))
#define VALA_CCODE_BASE_MODULE_IS_EMIT_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT))
#define VALA_CCODE_BASE_MODULE_EMIT_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT, ValaCCodeBaseModuleEmitContextClass))

typedef struct _ValaCCodeBaseModuleEmitContext ValaCCodeBaseModuleEmitContext;
typedef struct _ValaCCodeBaseModuleEmitContextClass ValaCCodeBaseModuleEmitContextClass;

#define VALA_TYPE_CCODE_STRUCT_MODULE (vala_ccode_struct_module_get_type ())
#define VALA_CCODE_STRUCT_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_STRUCT_MODULE, ValaCCodeStructModule))
#define VALA_CCODE_STRUCT_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_STRUCT_MODULE, ValaCCodeStructModuleClass))
#define VALA_IS_CCODE_STRUCT_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_STRUCT_MODULE))
#define VALA_IS_CCODE_STRUCT_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_STRUCT_MODULE))
#define VALA_CCODE_STRUCT_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_STRUCT_MODULE, ValaCCodeStructModuleClass))

typedef struct _ValaCCodeStructModule ValaCCodeStructModule;
typedef struct _ValaCCodeStructModuleClass ValaCCodeStructModuleClass;
typedef struct _ValaCCodeStructModulePrivate ValaCCodeStructModulePrivate;

#define VALA_TYPE_CCODE_METHOD_MODULE (vala_ccode_method_module_get_type ())
#define VALA_CCODE_METHOD_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_METHOD_MODULE, ValaCCodeMethodModule))
#define VALA_CCODE_METHOD_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_METHOD_MODULE, ValaCCodeMethodModuleClass))
#define VALA_IS_CCODE_METHOD_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_METHOD_MODULE))
#define VALA_IS_CCODE_METHOD_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_METHOD_MODULE))
#define VALA_CCODE_METHOD_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_METHOD_MODULE, ValaCCodeMethodModuleClass))

typedef struct _ValaCCodeMethodModule ValaCCodeMethodModule;
typedef struct _ValaCCodeMethodModuleClass ValaCCodeMethodModuleClass;
typedef struct _ValaCCodeMethodModulePrivate ValaCCodeMethodModulePrivate;

#define VALA_TYPE_CCODE_CONTROL_FLOW_MODULE (vala_ccode_control_flow_module_get_type ())
#define VALA_CCODE_CONTROL_FLOW_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_CONTROL_FLOW_MODULE, ValaCCodeControlFlowModule))
#define VALA_CCODE_CONTROL_FLOW_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_CONTROL_FLOW_MODULE, ValaCCodeControlFlowModuleClass))
#define VALA_IS_CCODE_CONTROL_FLOW_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_CONTROL_FLOW_MODULE))
#define VALA_IS_CCODE_CONTROL_FLOW_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_CONTROL_FLOW_MODULE))
#define VALA_CCODE_CONTROL_FLOW_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_CONTROL_FLOW_MODULE, ValaCCodeControlFlowModuleClass))

typedef struct _ValaCCodeControlFlowModule ValaCCodeControlFlowModule;
typedef struct _ValaCCodeControlFlowModuleClass ValaCCodeControlFlowModuleClass;
typedef struct _ValaCCodeControlFlowModulePrivate ValaCCodeControlFlowModulePrivate;

#define VALA_TYPE_CCODE_MEMBER_ACCESS_MODULE (vala_ccode_member_access_module_get_type ())
#define VALA_CCODE_MEMBER_ACCESS_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_MEMBER_ACCESS_MODULE, ValaCCodeMemberAccessModule))
#define VALA_CCODE_MEMBER_ACCESS_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_MEMBER_ACCESS_MODULE, ValaCCodeMemberAccessModuleClass))
#define VALA_IS_CCODE_MEMBER_ACCESS_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_MEMBER_ACCESS_MODULE))
#define VALA_IS_CCODE_MEMBER_ACCESS_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_MEMBER_ACCESS_MODULE))
#define VALA_CCODE_MEMBER_ACCESS_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_MEMBER_ACCESS_MODULE, ValaCCodeMemberAccessModuleClass))

typedef struct _ValaCCodeMemberAccessModule ValaCCodeMemberAccessModule;
typedef struct _ValaCCodeMemberAccessModuleClass ValaCCodeMemberAccessModuleClass;
typedef struct _ValaCCodeMemberAccessModulePrivate ValaCCodeMemberAccessModulePrivate;

#define VALA_TYPE_CCODE_ASSIGNMENT_MODULE (vala_ccode_assignment_module_get_type ())
#define VALA_CCODE_ASSIGNMENT_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_ASSIGNMENT_MODULE, ValaCCodeAssignmentModule))
#define VALA_CCODE_ASSIGNMENT_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_ASSIGNMENT_MODULE, ValaCCodeAssignmentModuleClass))
#define VALA_IS_CCODE_ASSIGNMENT_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_ASSIGNMENT_MODULE))
#define VALA_IS_CCODE_ASSIGNMENT_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_ASSIGNMENT_MODULE))
#define VALA_CCODE_ASSIGNMENT_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_ASSIGNMENT_MODULE, ValaCCodeAssignmentModuleClass))

typedef struct _ValaCCodeAssignmentModule ValaCCodeAssignmentModule;
typedef struct _ValaCCodeAssignmentModuleClass ValaCCodeAssignmentModuleClass;
typedef struct _ValaCCodeAssignmentModulePrivate ValaCCodeAssignmentModulePrivate;

#define VALA_TYPE_CCODE_METHOD_CALL_MODULE (vala_ccode_method_call_module_get_type ())
#define VALA_CCODE_METHOD_CALL_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_METHOD_CALL_MODULE, ValaCCodeMethodCallModule))
#define VALA_CCODE_METHOD_CALL_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_METHOD_CALL_MODULE, ValaCCodeMethodCallModuleClass))
#define VALA_IS_CCODE_METHOD_CALL_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_METHOD_CALL_MODULE))
#define VALA_IS_CCODE_METHOD_CALL_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_METHOD_CALL_MODULE))
#define VALA_CCODE_METHOD_CALL_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_METHOD_CALL_MODULE, ValaCCodeMethodCallModuleClass))

typedef struct _ValaCCodeMethodCallModule ValaCCodeMethodCallModule;
typedef struct _ValaCCodeMethodCallModuleClass ValaCCodeMethodCallModuleClass;
typedef struct _ValaCCodeMethodCallModulePrivate ValaCCodeMethodCallModulePrivate;

#define VALA_TYPE_CCODE_ARRAY_MODULE (vala_ccode_array_module_get_type ())
#define VALA_CCODE_ARRAY_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_ARRAY_MODULE, ValaCCodeArrayModule))
#define VALA_CCODE_ARRAY_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_ARRAY_MODULE, ValaCCodeArrayModuleClass))
#define VALA_IS_CCODE_ARRAY_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_ARRAY_MODULE))
#define VALA_IS_CCODE_ARRAY_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_ARRAY_MODULE))
#define VALA_CCODE_ARRAY_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_ARRAY_MODULE, ValaCCodeArrayModuleClass))

typedef struct _ValaCCodeArrayModule ValaCCodeArrayModule;
typedef struct _ValaCCodeArrayModuleClass ValaCCodeArrayModuleClass;
typedef struct _ValaCCodeArrayModulePrivate ValaCCodeArrayModulePrivate;

#define VALA_TYPE_CCODE_DELEGATE_MODULE (vala_ccode_delegate_module_get_type ())
#define VALA_CCODE_DELEGATE_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_DELEGATE_MODULE, ValaCCodeDelegateModule))
#define VALA_CCODE_DELEGATE_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_DELEGATE_MODULE, ValaCCodeDelegateModuleClass))
#define VALA_IS_CCODE_DELEGATE_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_DELEGATE_MODULE))
#define VALA_IS_CCODE_DELEGATE_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_DELEGATE_MODULE))
#define VALA_CCODE_DELEGATE_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_DELEGATE_MODULE, ValaCCodeDelegateModuleClass))

typedef struct _ValaCCodeDelegateModule ValaCCodeDelegateModule;
typedef struct _ValaCCodeDelegateModuleClass ValaCCodeDelegateModuleClass;
typedef struct _ValaCCodeDelegateModulePrivate ValaCCodeDelegateModulePrivate;

#define VALA_TYPE_GERROR_MODULE (vala_gerror_module_get_type ())
#define VALA_GERROR_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_GERROR_MODULE, ValaGErrorModule))
#define VALA_GERROR_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_GERROR_MODULE, ValaGErrorModuleClass))
#define VALA_IS_GERROR_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_GERROR_MODULE))
#define VALA_IS_GERROR_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_GERROR_MODULE))
#define VALA_GERROR_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_GERROR_MODULE, ValaGErrorModuleClass))

typedef struct _ValaGErrorModule ValaGErrorModule;
typedef struct _ValaGErrorModuleClass ValaGErrorModuleClass;
typedef struct _ValaGErrorModulePrivate ValaGErrorModulePrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_ccode_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_ccode_node_unref (var), NULL)))
#define _vala_code_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL)))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))

struct _ValaCCodeBaseModule {
      ValaCodeGenerator parent_instance;
      ValaCCodeBaseModulePrivate * priv;
      ValaSymbol* root_symbol;
      ValaCCodeBaseModuleEmitContext* emit_context;
      ValaCCodeFile* header_file;
      ValaCCodeFile* internal_header_file;
      ValaCCodeFile* cfile;
      ValaCCodeBaseModuleEmitContext* class_init_context;
      ValaCCodeBaseModuleEmitContext* base_init_context;
      ValaCCodeBaseModuleEmitContext* class_finalize_context;
      ValaCCodeBaseModuleEmitContext* base_finalize_context;
      ValaCCodeBaseModuleEmitContext* instance_init_context;
      ValaCCodeBaseModuleEmitContext* instance_finalize_context;
      ValaCCodeStruct* param_spec_struct;
      ValaCCodeStruct* closure_struct;
      ValaCCodeEnum* prop_enum;
      ValaSet* user_marshal_set;
      ValaSet* predefined_marshal_set;
      gint next_regex_id;
      gboolean in_constructor;
      gboolean in_static_or_class_context;
      gint next_coroutine_state;
      ValaDataType* void_type;
      ValaDataType* bool_type;
      ValaDataType* char_type;
      ValaDataType* uchar_type;
      ValaDataType* unichar_type;
      ValaDataType* short_type;
      ValaDataType* ushort_type;
      ValaDataType* int_type;
      ValaDataType* uint_type;
      ValaDataType* long_type;
      ValaDataType* ulong_type;
      ValaDataType* int8_type;
      ValaDataType* uint8_type;
      ValaDataType* int16_type;
      ValaDataType* uint16_type;
      ValaDataType* int32_type;
      ValaDataType* uint32_type;
      ValaDataType* int64_type;
      ValaDataType* uint64_type;
      ValaDataType* string_type;
      ValaDataType* regex_type;
      ValaDataType* float_type;
      ValaDataType* double_type;
      ValaTypeSymbol* gtype_type;
      ValaTypeSymbol* gobject_type;
      ValaErrorType* gerror_type;
      ValaClass* glist_type;
      ValaClass* gslist_type;
      ValaClass* gnode_type;
      ValaClass* gvaluearray_type;
      ValaTypeSymbol* gstringbuilder_type;
      ValaTypeSymbol* garray_type;
      ValaTypeSymbol* gbytearray_type;
      ValaTypeSymbol* gptrarray_type;
      ValaTypeSymbol* gthreadpool_type;
      ValaDataType* gdestroynotify_type;
      ValaDataType* gquark_type;
      ValaStruct* gvalue_type;
      ValaClass* gvariant_type;
      ValaStruct* mutex_type;
      ValaTypeSymbol* type_module_type;
      ValaTypeSymbol* dbus_proxy_type;
      ValaTypeSymbol* dbus_object_type;
      gboolean in_plugin;
      gchar* module_init_param_name;
      gboolean gvaluecollector_h_needed;
      gboolean requires_array_free;
      gboolean requires_array_move;
      gboolean requires_array_length;
      ValaSet* wrappers;
};

struct _ValaCCodeBaseModuleClass {
      ValaCodeGeneratorClass parent_class;
      void (*append_vala_array_free) (ValaCCodeBaseModule* self);
      void (*append_vala_array_move) (ValaCCodeBaseModule* self);
      void (*append_vala_array_length) (ValaCCodeBaseModule* self);
      gboolean (*generate_enum_declaration) (ValaCCodeBaseModule* self, ValaEnum* en, ValaCCodeFile* decl_space);
      void (*generate_class_struct_declaration) (ValaCCodeBaseModule* self, ValaClass* cl, ValaCCodeFile* decl_space);
      void (*generate_struct_declaration) (ValaCCodeBaseModule* self, ValaStruct* st, ValaCCodeFile* decl_space);
      void (*generate_delegate_declaration) (ValaCCodeBaseModule* self, ValaDelegate* d, ValaCCodeFile* decl_space);
      void (*generate_cparameters) (ValaCCodeBaseModule* self, ValaMethod* m, ValaCCodeFile* decl_space, ValaMap* cparam_map, ValaCCodeFunction* func, ValaCCodeFunctionDeclarator* vdeclarator, ValaMap* carg_map, ValaCCodeFunctionCall* vcall, gint direction);
      ValaCCodeExpression* (*get_dup_func_expression) (ValaCCodeBaseModule* self, ValaDataType* type, ValaSourceReference* source_reference, gboolean is_chainup);
      gchar* (*append_struct_array_free) (ValaCCodeBaseModule* self, ValaStruct* st);
      ValaCCodeExpression* (*destroy_variable) (ValaCCodeBaseModule* self, ValaVariable* variable, ValaTargetValue* target_lvalue);
      ValaCCodeExpression* (*destroy_value) (ValaCCodeBaseModule* self, ValaTargetValue* value, gboolean is_macro_definition);
      void (*append_local_free) (ValaCCodeBaseModule* self, ValaSymbol* sym, gboolean stop_at_loop, ValaCodeNode* stop_at);
      ValaTargetValue* (*get_local_cvalue) (ValaCCodeBaseModule* self, ValaLocalVariable* local);
      ValaTargetValue* (*get_parameter_cvalue) (ValaCCodeBaseModule* self, ValaParameter* param);
      ValaTargetValue* (*get_field_cvalue) (ValaCCodeBaseModule* self, ValaField* field, ValaTargetValue* instance);
      ValaTargetValue* (*load_this_parameter) (ValaCCodeBaseModule* self, ValaTypeSymbol* sym);
      gchar* (*get_delegate_target_cname) (ValaCCodeBaseModule* self, const gchar* delegate_cname);
      ValaCCodeExpression* (*get_delegate_target_cexpression) (ValaCCodeBaseModule* self, ValaExpression* delegate_expr, ValaCCodeExpression** delegate_target_destroy_notify);
      ValaCCodeExpression* (*get_delegate_target_cvalue) (ValaCCodeBaseModule* self, ValaTargetValue* value);
      ValaCCodeExpression* (*get_delegate_target_destroy_notify_cvalue) (ValaCCodeBaseModule* self, ValaTargetValue* value);
      gchar* (*get_delegate_target_destroy_notify_cname) (ValaCCodeBaseModule* self, const gchar* delegate_cname);
      ValaCCodeExpression* (*get_ref_cexpression) (ValaCCodeBaseModule* self, ValaDataType* expression_type, ValaCCodeExpression* cexpr, ValaExpression* expr, ValaCodeNode* node);
      void (*generate_class_declaration) (ValaCCodeBaseModule* self, ValaClass* cl, ValaCCodeFile* decl_space);
      void (*generate_interface_declaration) (ValaCCodeBaseModule* self, ValaInterface* iface, ValaCCodeFile* decl_space);
      void (*generate_method_declaration) (ValaCCodeBaseModule* self, ValaMethod* m, ValaCCodeFile* decl_space);
      void (*generate_error_domain_declaration) (ValaCCodeBaseModule* self, ValaErrorDomain* edomain, ValaCCodeFile* decl_space);
      ValaCCodeExpression* (*deserialize_expression) (ValaCCodeBaseModule* self, ValaDataType* type, ValaCCodeExpression* variant_expr, ValaCCodeExpression* expr, ValaCCodeExpression* error_expr, gboolean* may_fail);
      ValaCCodeExpression* (*serialize_expression) (ValaCCodeBaseModule* self, ValaDataType* type, ValaCCodeExpression* expr);
      ValaCCodeExpression* (*get_implicit_cast_expression) (ValaCCodeBaseModule* self, ValaCCodeExpression* source_cexpr, ValaDataType* expression_type, ValaDataType* target_type, ValaExpression* expr);
      gboolean (*is_gobject_property) (ValaCCodeBaseModule* self, ValaProperty* prop);
      gchar* (*get_custom_creturn_type) (ValaCCodeBaseModule* self, ValaMethod* m);
      void (*generate_dynamic_method_wrapper) (ValaCCodeBaseModule* self, ValaDynamicMethod* method);
      gboolean (*method_has_wrapper) (ValaCCodeBaseModule* self, ValaMethod* method);
      ValaCCodeFunctionCall* (*get_param_spec) (ValaCCodeBaseModule* self, ValaProperty* prop);
      ValaCCodeFunctionCall* (*get_signal_creation) (ValaCCodeBaseModule* self, ValaSignal* sig, ValaTypeSymbol* type);
      void (*register_dbus_info) (ValaCCodeBaseModule* self, ValaCCodeBlock* block, ValaObjectTypeSymbol* bindable);
      gchar* (*get_dynamic_property_getter_cname) (ValaCCodeBaseModule* self, ValaDynamicProperty* node);
      gchar* (*get_dynamic_property_setter_cname) (ValaCCodeBaseModule* self, ValaDynamicProperty* node);
      gchar* (*get_dynamic_signal_cname) (ValaCCodeBaseModule* self, ValaDynamicSignal* node);
      gchar* (*get_dynamic_signal_connect_wrapper_name) (ValaCCodeBaseModule* self, ValaDynamicSignal* node);
      gchar* (*get_dynamic_signal_connect_after_wrapper_name) (ValaCCodeBaseModule* self, ValaDynamicSignal* node);
      gchar* (*get_dynamic_signal_disconnect_wrapper_name) (ValaCCodeBaseModule* self, ValaDynamicSignal* node);
      void (*generate_marshaller) (ValaCCodeBaseModule* self, ValaList* params, ValaDataType* return_type, gboolean dbus);
      gchar* (*get_marshaller_function) (ValaCCodeBaseModule* self, ValaList* params, ValaDataType* return_type, const gchar* prefix, gboolean dbus);
      gchar* (*get_array_length_cname) (ValaCCodeBaseModule* self, const gchar* array_cname, gint dim);
      gchar* (*get_parameter_array_length_cname) (ValaCCodeBaseModule* self, ValaParameter* param, gint dim);
      ValaCCodeExpression* (*get_array_length_cexpression) (ValaCCodeBaseModule* self, ValaExpression* array_expr, gint dim);
      ValaCCodeExpression* (*get_array_length_cvalue) (ValaCCodeBaseModule* self, ValaTargetValue* value, gint dim);
      gchar* (*get_array_size_cname) (ValaCCodeBaseModule* self, const gchar* array_cname);
      void (*add_simple_check) (ValaCCodeBaseModule* self, ValaCodeNode* node, gboolean always_fails);
      gchar* (*generate_ready_function) (ValaCCodeBaseModule* self, ValaMethod* m);
};

struct _ValaCCodeStructModule {
      ValaCCodeBaseModule parent_instance;
      ValaCCodeStructModulePrivate * priv;
};

struct _ValaCCodeStructModuleClass {
      ValaCCodeBaseModuleClass parent_class;
};

struct _ValaCCodeMethodModule {
      ValaCCodeStructModule parent_instance;
      ValaCCodeMethodModulePrivate * priv;
};

struct _ValaCCodeMethodModuleClass {
      ValaCCodeStructModuleClass parent_class;
      void (*generate_method_result_declaration) (ValaCCodeMethodModule* self, ValaMethod* m, ValaCCodeFile* decl_space, ValaCCodeFunction* cfunc, ValaMap* cparam_map, ValaMap* carg_map);
      ValaCCodeParameter* (*generate_parameter) (ValaCCodeMethodModule* self, ValaParameter* param, ValaCCodeFile* decl_space, ValaMap* cparam_map, ValaMap* carg_map);
};

struct _ValaCCodeControlFlowModule {
      ValaCCodeMethodModule parent_instance;
      ValaCCodeControlFlowModulePrivate * priv;
};

struct _ValaCCodeControlFlowModuleClass {
      ValaCCodeMethodModuleClass parent_class;
};

struct _ValaCCodeMemberAccessModule {
      ValaCCodeControlFlowModule parent_instance;
      ValaCCodeMemberAccessModulePrivate * priv;
};

struct _ValaCCodeMemberAccessModuleClass {
      ValaCCodeControlFlowModuleClass parent_class;
};

struct _ValaCCodeAssignmentModule {
      ValaCCodeMemberAccessModule parent_instance;
      ValaCCodeAssignmentModulePrivate * priv;
};

struct _ValaCCodeAssignmentModuleClass {
      ValaCCodeMemberAccessModuleClass parent_class;
};

struct _ValaCCodeMethodCallModule {
      ValaCCodeAssignmentModule parent_instance;
      ValaCCodeMethodCallModulePrivate * priv;
};

struct _ValaCCodeMethodCallModuleClass {
      ValaCCodeAssignmentModuleClass parent_class;
};

struct _ValaCCodeArrayModule {
      ValaCCodeMethodCallModule parent_instance;
      ValaCCodeArrayModulePrivate * priv;
};

struct _ValaCCodeArrayModuleClass {
      ValaCCodeMethodCallModuleClass parent_class;
};

struct _ValaCCodeDelegateModule {
      ValaCCodeArrayModule parent_instance;
      ValaCCodeDelegateModulePrivate * priv;
};

struct _ValaCCodeDelegateModuleClass {
      ValaCCodeArrayModuleClass parent_class;
};

struct _ValaGErrorModule {
      ValaCCodeDelegateModule parent_instance;
      ValaGErrorModulePrivate * priv;
};

struct _ValaGErrorModuleClass {
      ValaCCodeDelegateModuleClass parent_class;
      void (*return_with_exception) (ValaGErrorModule* self, ValaCCodeExpression* error_expr);
};

00375 struct _ValaGErrorModulePrivate {
      gint current_try_id;
      gint next_try_id;
      gboolean is_in_catch;
};


static gpointer vala_gerror_module_parent_class = NULL;

GType vala_ccode_base_module_get_type (void) G_GNUC_CONST;
gpointer vala_ccode_base_module_emit_context_ref (gpointer instance);
void vala_ccode_base_module_emit_context_unref (gpointer instance);
GParamSpec* vala_ccode_base_module_param_spec_emit_context (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void vala_ccode_base_module_value_set_emit_context (GValue* value, gpointer v_object);
void vala_ccode_base_module_value_take_emit_context (GValue* value, gpointer v_object);
gpointer vala_ccode_base_module_value_get_emit_context (const GValue* value);
GType vala_ccode_base_module_emit_context_get_type (void) G_GNUC_CONST;
GType vala_ccode_struct_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_method_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_control_flow_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_member_access_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_assignment_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_method_call_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_array_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_delegate_module_get_type (void) G_GNUC_CONST;
GType vala_gerror_module_get_type (void) G_GNUC_CONST;
#define VALA_GERROR_MODULE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALA_TYPE_GERROR_MODULE, ValaGErrorModulePrivate))
enum  {
      VALA_GERROR_MODULE_DUMMY_PROPERTY
};
static void vala_gerror_module_real_generate_error_domain_declaration (ValaCCodeBaseModule* base, ValaErrorDomain* edomain, ValaCCodeFile* decl_space);
gboolean vala_ccode_base_module_add_symbol_declaration (ValaCCodeBaseModule* self, ValaCCodeFile* decl_space, ValaSymbol* sym, const gchar* name);
ValaCCodeExpression* vala_ccode_base_module_get_cvalue (ValaCCodeBaseModule* self, ValaExpression* expr);
static void vala_gerror_module_real_visit_error_domain (ValaCodeVisitor* base, ValaErrorDomain* edomain);
void vala_ccode_base_module_generate_error_domain_declaration (ValaCCodeBaseModule* self, ValaErrorDomain* edomain, ValaCCodeFile* decl_space);
static void vala_gerror_module_real_visit_throw_statement (ValaCodeVisitor* base, ValaThrowStatement* stmt);
void vala_ccode_base_module_set_current_method_inner_error (ValaCCodeBaseModule* self, gboolean value);
ValaCCodeFunction* vala_ccode_base_module_get_ccode (ValaCCodeBaseModule* self);
ValaCCodeExpression* vala_ccode_base_module_get_variable_cexpression (ValaCCodeBaseModule* self, const gchar* name);
void vala_ccode_base_module_add_simple_check (ValaCCodeBaseModule* self, ValaCodeNode* node, gboolean always_fails);
void vala_gerror_module_return_with_exception (ValaGErrorModule* self, ValaCCodeExpression* error_expr);
static void vala_gerror_module_real_return_with_exception (ValaGErrorModule* self, ValaCCodeExpression* error_expr);
void vala_ccode_base_module_append_local_free (ValaCCodeBaseModule* self, ValaSymbol* sym, gboolean stop_at_loop, ValaCodeNode* stop_at);
ValaSymbol* vala_ccode_base_module_get_current_symbol (ValaCCodeBaseModule* self);
ValaMethod* vala_ccode_base_module_get_current_method (ValaCCodeBaseModule* self);
ValaCCodeExpression* vala_ccode_base_module_get_unref_expression (ValaCCodeBaseModule* self, ValaCCodeExpression* cvar, ValaDataType* type, ValaExpression* expr, gboolean is_macro_definition);
gboolean vala_ccode_base_module_is_in_coroutine (ValaCCodeBaseModule* self);
void vala_ccode_base_module_return_default_value (ValaCCodeBaseModule* self, ValaDataType* return_type);
ValaDataType* vala_ccode_base_module_get_current_return_type (ValaCCodeBaseModule* self);
static void vala_gerror_module_uncaught_error_statement (ValaGErrorModule* self, ValaCCodeExpression* inner_error, gboolean unexpected);
gboolean vala_ccode_base_module_is_in_constructor (ValaCCodeBaseModule* self);
gboolean vala_ccode_base_module_is_in_destructor (ValaCCodeBaseModule* self);
static gboolean vala_gerror_module_in_finally_block (ValaGErrorModule* self, ValaCodeNode* node);
static void vala_gerror_module_real_add_simple_check (ValaCCodeBaseModule* base, ValaCodeNode* node, gboolean always_fails);
ValaTryStatement* vala_ccode_base_module_get_current_try (ValaCCodeBaseModule* self);
ValaCatchClause* vala_ccode_base_module_get_current_catch (ValaCCodeBaseModule* self);
static void vala_gerror_module_real_visit_try_statement (ValaCodeVisitor* base, ValaTryStatement* stmt);
void vala_ccode_base_module_set_current_try (ValaCCodeBaseModule* self, ValaTryStatement* value);
void vala_ccode_base_module_set_current_catch (ValaCCodeBaseModule* self, ValaCatchClause* value);
static void vala_gerror_module_real_visit_catch_clause (ValaCodeVisitor* base, ValaCatchClause* clause);
gchar* vala_ccode_base_module_get_variable_cname (ValaCCodeBaseModule* self, const gchar* name);
static void vala_gerror_module_real_append_local_free (ValaCCodeBaseModule* base, ValaSymbol* sym, gboolean stop_at_loop, ValaCodeNode* stop_at);
ValaGErrorModule* vala_gerror_module_new (void);
ValaGErrorModule* vala_gerror_module_construct (GType object_type);
ValaCCodeDelegateModule* vala_ccode_delegate_module_new (void);
ValaCCodeDelegateModule* vala_ccode_delegate_module_construct (GType object_type);
static void vala_gerror_module_finalize (ValaCodeVisitor* obj);


static void vala_gerror_module_real_generate_error_domain_declaration (ValaCCodeBaseModule* base, ValaErrorDomain* edomain, ValaCCodeFile* decl_space) {
      ValaGErrorModule * self;
      gchar* _tmp0_ = NULL;
      gchar* _tmp1_;
      gboolean _tmp2_;
      gboolean _tmp3_;
      gchar* _tmp4_ = NULL;
      gchar* _tmp5_;
      ValaCCodeEnum* _tmp6_ = NULL;
      ValaCCodeEnum* _tmp7_;
      ValaCCodeEnum* cenum;
      gchar* _tmp24_ = NULL;
      gchar* _tmp25_;
      gchar* _tmp26_;
      gchar* _tmp27_;
      gchar* quark_fun_name;
      gchar* _tmp28_ = NULL;
      gchar* _tmp29_;
      gchar* _tmp30_;
      gchar* _tmp31_;
      ValaCCodeMacroReplacement* _tmp32_ = NULL;
      ValaCCodeMacroReplacement* _tmp33_;
      ValaCCodeMacroReplacement* error_domain_define;
      ValaTypeSymbol* _tmp34_ = NULL;
      gchar* _tmp35_ = NULL;
      gchar* _tmp36_;
      ValaCCodeFunction* _tmp37_ = NULL;
      ValaCCodeFunction* _tmp38_;
      ValaCCodeFunction* cquark_fun;
      self = (ValaGErrorModule*) base;
      g_return_if_fail (edomain != NULL);
      g_return_if_fail (decl_space != NULL);
      _tmp0_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) edomain, FALSE);
      _tmp1_ = _tmp0_;
      _tmp2_ = vala_ccode_base_module_add_symbol_declaration ((ValaCCodeBaseModule*) self, decl_space, (ValaSymbol*) edomain, _tmp1_);
      _tmp3_ = _tmp2_;
      _g_free0 (_tmp1_);
      if (_tmp3_) {
            return;
      }
      _tmp4_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) edomain, FALSE);
      _tmp5_ = _tmp4_;
      _tmp6_ = vala_ccode_enum_new (_tmp5_);
      _tmp7_ = _tmp6_;
      _g_free0 (_tmp5_);
      cenum = _tmp7_;
      {
            ValaList* _tmp8_ = NULL;
            ValaList* _ecode_list;
            gint _tmp9_;
            gint _ecode_size;
            gint _ecode_index;
            _tmp8_ = vala_error_domain_get_codes (edomain);
            _ecode_list = _tmp8_;
            _tmp9_ = vala_collection_get_size ((ValaCollection*) _ecode_list);
            _ecode_size = _tmp9_;
            _ecode_index = -1;
            while (TRUE) {
                  gpointer _tmp10_ = NULL;
                  ValaErrorCode* ecode;
                  ValaExpression* _tmp11_ = NULL;
                  _ecode_index = _ecode_index + 1;
                  if (!(_ecode_index < _ecode_size)) {
                        break;
                  }
                  _tmp10_ = vala_list_get (_ecode_list, _ecode_index);
                  ecode = (ValaErrorCode*) _tmp10_;
                  _tmp11_ = vala_error_code_get_value (ecode);
                  if (_tmp11_ == NULL) {
                        gchar* _tmp12_ = NULL;
                        gchar* _tmp13_;
                        ValaCCodeEnumValue* _tmp14_ = NULL;
                        ValaCCodeEnumValue* _tmp15_;
                        _tmp12_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) ecode, FALSE);
                        _tmp13_ = _tmp12_;
                        _tmp14_ = vala_ccode_enum_value_new (_tmp13_, NULL);
                        _tmp15_ = _tmp14_;
                        vala_ccode_enum_add_value (cenum, _tmp15_);
                        _vala_ccode_node_unref0 (_tmp15_);
                        _g_free0 (_tmp13_);
                  } else {
                        ValaExpression* _tmp16_ = NULL;
                        gchar* _tmp17_ = NULL;
                        gchar* _tmp18_;
                        ValaExpression* _tmp19_ = NULL;
                        ValaCCodeExpression* _tmp20_ = NULL;
                        ValaCCodeExpression* _tmp21_;
                        ValaCCodeEnumValue* _tmp22_ = NULL;
                        ValaCCodeEnumValue* _tmp23_;
                        _tmp16_ = vala_error_code_get_value (ecode);
                        vala_code_node_emit ((ValaCodeNode*) _tmp16_, (ValaCodeGenerator*) self);
                        _tmp17_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) ecode, FALSE);
                        _tmp18_ = _tmp17_;
                        _tmp19_ = vala_error_code_get_value (ecode);
                        _tmp20_ = vala_ccode_base_module_get_cvalue ((ValaCCodeBaseModule*) self, _tmp19_);
                        _tmp21_ = _tmp20_;
                        _tmp22_ = vala_ccode_enum_value_new (_tmp18_, _tmp21_);
                        _tmp23_ = _tmp22_;
                        vala_ccode_enum_add_value (cenum, _tmp23_);
                        _vala_ccode_node_unref0 (_tmp23_);
                        _vala_ccode_node_unref0 (_tmp21_);
                        _g_free0 (_tmp18_);
                  }
                  _vala_code_node_unref0 (ecode);
            }
            _vala_iterable_unref0 (_ecode_list);
      }
      vala_ccode_file_add_type_definition (decl_space, (ValaCCodeNode*) cenum);
      _tmp24_ = vala_symbol_get_lower_case_cprefix ((ValaSymbol*) edomain);
      _tmp25_ = _tmp24_;
      _tmp26_ = g_strconcat (_tmp25_, "quark", NULL);
      _tmp27_ = _tmp26_;
      _g_free0 (_tmp25_);
      quark_fun_name = _tmp27_;
      _tmp28_ = vala_typesymbol_get_upper_case_cname ((ValaTypeSymbol*) edomain, NULL);
      _tmp29_ = _tmp28_;
      _tmp30_ = g_strconcat (quark_fun_name, " ()", NULL);
      _tmp31_ = _tmp30_;
      _tmp32_ = vala_ccode_macro_replacement_new (_tmp29_, _tmp31_);
      _tmp33_ = _tmp32_;
      _g_free0 (_tmp31_);
      _g_free0 (_tmp29_);
      error_domain_define = _tmp33_;
      vala_ccode_file_add_type_definition (decl_space, (ValaCCodeNode*) error_domain_define);
      _tmp34_ = vala_data_type_get_data_type (((ValaCCodeBaseModule*) self)->gquark_type);
      _tmp35_ = vala_typesymbol_get_cname (_tmp34_, FALSE);
      _tmp36_ = _tmp35_;
      _tmp37_ = vala_ccode_function_new (quark_fun_name, _tmp36_);
      _tmp38_ = _tmp37_;
      _g_free0 (_tmp36_);
      cquark_fun = _tmp38_;
      vala_ccode_file_add_function_declaration (decl_space, cquark_fun);
      _vala_ccode_node_unref0 (cquark_fun);
      _vala_ccode_node_unref0 (error_domain_define);
      _g_free0 (quark_fun_name);
      _vala_ccode_node_unref0 (cenum);
}


static void vala_gerror_module_real_visit_error_domain (ValaCodeVisitor* base, ValaErrorDomain* edomain) {
      ValaGErrorModule * self;
      ValaComment* _tmp0_ = NULL;
      gboolean _tmp5_;
      gboolean _tmp6_;
      gchar* _tmp7_ = NULL;
      gchar* _tmp8_;
      gchar* _tmp9_;
      gchar* _tmp10_;
      gchar* quark_fun_name;
      ValaTypeSymbol* _tmp11_ = NULL;
      gchar* _tmp12_ = NULL;
      gchar* _tmp13_;
      ValaCCodeFunction* _tmp14_ = NULL;
      ValaCCodeFunction* _tmp15_;
      ValaCCodeFunction* cquark_fun;
      ValaCCodeBlock* _tmp16_ = NULL;
      ValaCCodeBlock* cquark_block;
      ValaCCodeIdentifier* _tmp17_ = NULL;
      ValaCCodeIdentifier* _tmp18_;
      ValaCCodeFunctionCall* _tmp19_ = NULL;
      ValaCCodeFunctionCall* _tmp20_;
      ValaCCodeFunctionCall* cquark_call;
      gchar* _tmp21_ = NULL;
      gchar* _tmp22_;
      gchar* _tmp23_;
      gchar* _tmp24_;
      gchar* _tmp25_;
      gchar* _tmp26_;
      ValaCCodeConstant* _tmp27_ = NULL;
      ValaCCodeConstant* _tmp28_;
      ValaCCodeReturnStatement* _tmp29_ = NULL;
      ValaCCodeReturnStatement* _tmp30_;
      self = (ValaGErrorModule*) base;
      g_return_if_fail (edomain != NULL);
      _tmp0_ = vala_symbol_get_comment ((ValaSymbol*) edomain);
      if (_tmp0_ != NULL) {
            ValaComment* _tmp1_ = NULL;
            const gchar* _tmp2_ = NULL;
            ValaCCodeComment* _tmp3_ = NULL;
            ValaCCodeComment* _tmp4_;
            _tmp1_ = vala_symbol_get_comment ((ValaSymbol*) edomain);
            _tmp2_ = vala_comment_get_content (_tmp1_);
            _tmp3_ = vala_ccode_comment_new (_tmp2_);
            _tmp4_ = _tmp3_;
            vala_ccode_file_add_type_definition (((ValaCCodeBaseModule*) self)->cfile, (ValaCCodeNode*) _tmp4_);
            _vala_ccode_node_unref0 (_tmp4_);
      }
      vala_ccode_base_module_generate_error_domain_declaration ((ValaCCodeBaseModule*) self, edomain, ((ValaCCodeBaseModule*) self)->cfile);
      _tmp5_ = vala_symbol_is_internal_symbol ((ValaSymbol*) edomain);
      if (!_tmp5_) {
            vala_ccode_base_module_generate_error_domain_declaration ((ValaCCodeBaseModule*) self, edomain, ((ValaCCodeBaseModule*) self)->header_file);
      }
      _tmp6_ = vala_symbol_is_private_symbol ((ValaSymbol*) edomain);
      if (!_tmp6_) {
            vala_ccode_base_module_generate_error_domain_declaration ((ValaCCodeBaseModule*) self, edomain, ((ValaCCodeBaseModule*) self)->internal_header_file);
      }
      _tmp7_ = vala_symbol_get_lower_case_cprefix ((ValaSymbol*) edomain);
      _tmp8_ = _tmp7_;
      _tmp9_ = g_strconcat (_tmp8_, "quark", NULL);
      _tmp10_ = _tmp9_;
      _g_free0 (_tmp8_);
      quark_fun_name = _tmp10_;
      _tmp11_ = vala_data_type_get_data_type (((ValaCCodeBaseModule*) self)->gquark_type);
      _tmp12_ = vala_typesymbol_get_cname (_tmp11_, FALSE);
      _tmp13_ = _tmp12_;
      _tmp14_ = vala_ccode_function_new (quark_fun_name, _tmp13_);
      _tmp15_ = _tmp14_;
      _g_free0 (_tmp13_);
      cquark_fun = _tmp15_;
      _tmp16_ = vala_ccode_block_new ();
      cquark_block = _tmp16_;
      _tmp17_ = vala_ccode_identifier_new ("g_quark_from_static_string");
      _tmp18_ = _tmp17_;
      _tmp19_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp18_);
      _tmp20_ = _tmp19_;
      _vala_ccode_node_unref0 (_tmp18_);
      cquark_call = _tmp20_;
      _tmp21_ = vala_symbol_get_lower_case_cname ((ValaSymbol*) edomain, NULL);
      _tmp22_ = _tmp21_;
      _tmp23_ = g_strconcat ("\"", _tmp22_, NULL);
      _tmp24_ = _tmp23_;
      _tmp25_ = g_strconcat (_tmp24_, "-quark\"", NULL);
      _tmp26_ = _tmp25_;
      _tmp27_ = vala_ccode_constant_new (_tmp26_);
      _tmp28_ = _tmp27_;
      vala_ccode_function_call_add_argument (cquark_call, (ValaCCodeExpression*) _tmp28_);
      _vala_ccode_node_unref0 (_tmp28_);
      _g_free0 (_tmp26_);
      _g_free0 (_tmp24_);
      _g_free0 (_tmp22_);
      _tmp29_ = vala_ccode_return_statement_new ((ValaCCodeExpression*) cquark_call);
      _tmp30_ = _tmp29_;
      vala_ccode_block_add_statement (cquark_block, (ValaCCodeNode*) _tmp30_);
      _vala_ccode_node_unref0 (_tmp30_);
      vala_ccode_function_set_block (cquark_fun, cquark_block);
      vala_ccode_file_add_function (((ValaCCodeBaseModule*) self)->cfile, cquark_fun);
      _vala_ccode_node_unref0 (cquark_call);
      _vala_ccode_node_unref0 (cquark_block);
      _vala_ccode_node_unref0 (cquark_fun);
      _g_free0 (quark_fun_name);
}


static void vala_gerror_module_real_visit_throw_statement (ValaCodeVisitor* base, ValaThrowStatement* stmt) {
      ValaGErrorModule * self;
      ValaCCodeFunction* _tmp0_ = NULL;
      ValaCCodeExpression* _tmp1_ = NULL;
      ValaCCodeExpression* _tmp2_;
      ValaExpression* _tmp3_ = NULL;
      ValaCCodeExpression* _tmp4_ = NULL;
      ValaCCodeExpression* _tmp5_;
      self = (ValaGErrorModule*) base;
      g_return_if_fail (stmt != NULL);
      vala_ccode_base_module_set_current_method_inner_error ((ValaCCodeBaseModule*) self, TRUE);
      _tmp0_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      _tmp1_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, "_inner_error_");
      _tmp2_ = _tmp1_;
      _tmp3_ = vala_throw_statement_get_error_expression (stmt);
      _tmp4_ = vala_ccode_base_module_get_cvalue ((ValaCCodeBaseModule*) self, _tmp3_);
      _tmp5_ = _tmp4_;
      vala_ccode_function_add_assignment (_tmp0_, _tmp2_, _tmp5_);
      _vala_ccode_node_unref0 (_tmp5_);
      _vala_ccode_node_unref0 (_tmp2_);
      vala_ccode_base_module_add_simple_check ((ValaCCodeBaseModule*) self, (ValaCodeNode*) stmt, TRUE);
}


static gpointer _vala_code_node_ref0 (gpointer self) {
      return self ? vala_code_node_ref (self) : NULL;
}


static void vala_gerror_module_real_return_with_exception (ValaGErrorModule* self, ValaCCodeExpression* error_expr) {
      ValaCCodeIdentifier* _tmp0_ = NULL;
      ValaCCodeIdentifier* _tmp1_;
      ValaCCodeFunctionCall* _tmp2_ = NULL;
      ValaCCodeFunctionCall* _tmp3_;
      ValaCCodeFunctionCall* cpropagate;
      ValaCCodeIdentifier* _tmp4_ = NULL;
      ValaCCodeIdentifier* _tmp5_;
      ValaCCodeFunction* _tmp6_ = NULL;
      ValaSymbol* _tmp7_ = NULL;
      gboolean _tmp8_ = FALSE;
      ValaMethod* _tmp9_ = NULL;
      g_return_if_fail (self != NULL);
      g_return_if_fail (error_expr != NULL);
      _tmp0_ = vala_ccode_identifier_new ("g_propagate_error");
      _tmp1_ = _tmp0_;
      _tmp2_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp1_);
      _tmp3_ = _tmp2_;
      _vala_ccode_node_unref0 (_tmp1_);
      cpropagate = _tmp3_;
      _tmp4_ = vala_ccode_identifier_new ("error");
      _tmp5_ = _tmp4_;
      vala_ccode_function_call_add_argument (cpropagate, (ValaCCodeExpression*) _tmp5_);
      _vala_ccode_node_unref0 (_tmp5_);
      vala_ccode_function_call_add_argument (cpropagate, error_expr);
      _tmp6_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      vala_ccode_function_add_expression (_tmp6_, (ValaCCodeExpression*) cpropagate);
      _tmp7_ = vala_ccode_base_module_get_current_symbol ((ValaCCodeBaseModule*) self);
      vala_ccode_base_module_append_local_free ((ValaCCodeBaseModule*) self, _tmp7_, FALSE, NULL);
      _tmp9_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
      if (VALA_IS_CREATION_METHOD (_tmp9_)) {
            ValaMethod* _tmp10_ = NULL;
            ValaSymbol* _tmp11_ = NULL;
            _tmp10_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
            _tmp11_ = vala_symbol_get_parent_symbol ((ValaSymbol*) _tmp10_);
            _tmp8_ = VALA_IS_CLASS (_tmp11_);
      } else {
            _tmp8_ = FALSE;
      }
      if (_tmp8_) {
            ValaMethod* _tmp12_ = NULL;
            ValaSymbol* _tmp13_ = NULL;
            ValaClass* _tmp14_;
            ValaClass* cl;
            ValaCCodeIdentifier* _tmp15_ = NULL;
            ValaCCodeIdentifier* _tmp16_;
            ValaObjectType* _tmp17_ = NULL;
            ValaObjectType* _tmp18_;
            ValaCCodeExpression* _tmp19_ = NULL;
            ValaCCodeExpression* _tmp20_;
            ValaCCodeExpression* unref_call;
            ValaCCodeFunction* _tmp21_ = NULL;
            ValaCCodeFunction* _tmp22_ = NULL;
            ValaCCodeConstant* _tmp23_ = NULL;
            ValaCCodeConstant* _tmp24_;
            _tmp12_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
            _tmp13_ = vala_symbol_get_parent_symbol ((ValaSymbol*) _tmp12_);
            _tmp14_ = _vala_code_node_ref0 (VALA_CLASS (_tmp13_));
            cl = _tmp14_;
            _tmp15_ = vala_ccode_identifier_new ("self");
            _tmp16_ = _tmp15_;
            _tmp17_ = vala_object_type_new ((ValaObjectTypeSymbol*) cl);
            _tmp18_ = _tmp17_;
            _tmp19_ = vala_ccode_base_module_get_unref_expression ((ValaCCodeBaseModule*) self, (ValaCCodeExpression*) _tmp16_, (ValaDataType*) _tmp18_, NULL, FALSE);
            _tmp20_ = _tmp19_;
            _vala_code_node_unref0 (_tmp18_);
            _vala_ccode_node_unref0 (_tmp16_);
            unref_call = _tmp20_;
            _tmp21_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            vala_ccode_function_add_expression (_tmp21_, unref_call);
            _tmp22_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            _tmp23_ = vala_ccode_constant_new ("NULL");
            _tmp24_ = _tmp23_;
            vala_ccode_function_add_return (_tmp22_, (ValaCCodeExpression*) _tmp24_);
            _vala_ccode_node_unref0 (_tmp24_);
            _vala_ccode_node_unref0 (unref_call);
            _vala_code_node_unref0 (cl);
      } else {
            gboolean _tmp25_;
            _tmp25_ = vala_ccode_base_module_is_in_coroutine ((ValaCCodeBaseModule*) self);
            if (_tmp25_) {
                  ValaCCodeFunction* _tmp26_ = NULL;
                  ValaCCodeConstant* _tmp27_ = NULL;
                  ValaCCodeConstant* _tmp28_;
                  _tmp26_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                  _tmp27_ = vala_ccode_constant_new ("FALSE");
                  _tmp28_ = _tmp27_;
                  vala_ccode_function_add_return (_tmp26_, (ValaCCodeExpression*) _tmp28_);
                  _vala_ccode_node_unref0 (_tmp28_);
            } else {
                  ValaDataType* _tmp29_ = NULL;
                  _tmp29_ = vala_ccode_base_module_get_current_return_type ((ValaCCodeBaseModule*) self);
                  vala_ccode_base_module_return_default_value ((ValaCCodeBaseModule*) self, _tmp29_);
            }
      }
      _vala_ccode_node_unref0 (cpropagate);
}


void vala_gerror_module_return_with_exception (ValaGErrorModule* self, ValaCCodeExpression* error_expr) {
      VALA_GERROR_MODULE_GET_CLASS (self)->return_with_exception (self, error_expr);
}


static void vala_gerror_module_uncaught_error_statement (ValaGErrorModule* self, ValaCCodeExpression* inner_error, gboolean unexpected) {
      ValaSymbol* _tmp0_ = NULL;
      ValaCCodeIdentifier* _tmp1_ = NULL;
      ValaCCodeIdentifier* _tmp2_;
      ValaCCodeFunctionCall* _tmp3_ = NULL;
      ValaCCodeFunctionCall* _tmp4_;
      ValaCCodeFunctionCall* ccritical;
      const gchar* _tmp5_ = NULL;
      ValaCCodeConstant* _tmp6_ = NULL;
      ValaCCodeConstant* _tmp7_;
      ValaCCodeConstant* _tmp8_ = NULL;
      ValaCCodeConstant* _tmp9_;
      ValaCCodeConstant* _tmp10_ = NULL;
      ValaCCodeConstant* _tmp11_;
      ValaCCodeMemberAccess* _tmp12_ = NULL;
      ValaCCodeMemberAccess* _tmp13_;
      ValaCCodeIdentifier* _tmp14_ = NULL;
      ValaCCodeIdentifier* _tmp15_;
      ValaCCodeFunctionCall* _tmp16_ = NULL;
      ValaCCodeFunctionCall* _tmp17_;
      ValaCCodeFunctionCall* domain_name;
      ValaCCodeMemberAccess* _tmp18_ = NULL;
      ValaCCodeMemberAccess* _tmp19_;
      ValaCCodeMemberAccess* _tmp20_ = NULL;
      ValaCCodeMemberAccess* _tmp21_;
      ValaCCodeIdentifier* _tmp22_ = NULL;
      ValaCCodeIdentifier* _tmp23_;
      ValaCCodeFunctionCall* _tmp24_ = NULL;
      ValaCCodeFunctionCall* _tmp25_;
      ValaCCodeFunctionCall* cclear;
      ValaCCodeUnaryExpression* _tmp26_ = NULL;
      ValaCCodeUnaryExpression* _tmp27_;
      ValaCCodeFunction* _tmp28_ = NULL;
      ValaCCodeFunction* _tmp29_ = NULL;
      gboolean _tmp30_ = FALSE;
      gboolean _tmp31_;
      g_return_if_fail (self != NULL);
      g_return_if_fail (inner_error != NULL);
      _tmp0_ = vala_ccode_base_module_get_current_symbol ((ValaCCodeBaseModule*) self);
      vala_ccode_base_module_append_local_free ((ValaCCodeBaseModule*) self, _tmp0_, FALSE, NULL);
      _tmp1_ = vala_ccode_identifier_new ("g_critical");
      _tmp2_ = _tmp1_;
      _tmp3_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp2_);
      _tmp4_ = _tmp3_;
      _vala_ccode_node_unref0 (_tmp2_);
      ccritical = _tmp4_;
      if (unexpected) {
            _tmp5_ = "\"file %s: line %d: unexpected error: %s (%s, %d)\"";
      } else {
            _tmp5_ = "\"file %s: line %d: uncaught error: %s (%s, %d)\"";
      }
      _tmp6_ = vala_ccode_constant_new (_tmp5_);
      _tmp7_ = _tmp6_;
      vala_ccode_function_call_add_argument (ccritical, (ValaCCodeExpression*) _tmp7_);
      _vala_ccode_node_unref0 (_tmp7_);
      _tmp8_ = vala_ccode_constant_new ("__FILE__");
      _tmp9_ = _tmp8_;
      vala_ccode_function_call_add_argument (ccritical, (ValaCCodeExpression*) _tmp9_);
      _vala_ccode_node_unref0 (_tmp9_);
      _tmp10_ = vala_ccode_constant_new ("__LINE__");
      _tmp11_ = _tmp10_;
      vala_ccode_function_call_add_argument (ccritical, (ValaCCodeExpression*) _tmp11_);
      _vala_ccode_node_unref0 (_tmp11_);
      _tmp12_ = vala_ccode_member_access_new_pointer (inner_error, "message");
      _tmp13_ = _tmp12_;
      vala_ccode_function_call_add_argument (ccritical, (ValaCCodeExpression*) _tmp13_);
      _vala_ccode_node_unref0 (_tmp13_);
      _tmp14_ = vala_ccode_identifier_new ("g_quark_to_string");
      _tmp15_ = _tmp14_;
      _tmp16_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp15_);
      _tmp17_ = _tmp16_;
      _vala_ccode_node_unref0 (_tmp15_);
      domain_name = _tmp17_;
      _tmp18_ = vala_ccode_member_access_new_pointer (inner_error, "domain");
      _tmp19_ = _tmp18_;
      vala_ccode_function_call_add_argument (domain_name, (ValaCCodeExpression*) _tmp19_);
      _vala_ccode_node_unref0 (_tmp19_);
      vala_ccode_function_call_add_argument (ccritical, (ValaCCodeExpression*) domain_name);
      _tmp20_ = vala_ccode_member_access_new_pointer (inner_error, "code");
      _tmp21_ = _tmp20_;
      vala_ccode_function_call_add_argument (ccritical, (ValaCCodeExpression*) _tmp21_);
      _vala_ccode_node_unref0 (_tmp21_);
      _tmp22_ = vala_ccode_identifier_new ("g_clear_error");
      _tmp23_ = _tmp22_;
      _tmp24_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp23_);
      _tmp25_ = _tmp24_;
      _vala_ccode_node_unref0 (_tmp23_);
      cclear = _tmp25_;
      _tmp26_ = vala_ccode_unary_expression_new (VALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, inner_error);
      _tmp27_ = _tmp26_;
      vala_ccode_function_call_add_argument (cclear, (ValaCCodeExpression*) _tmp27_);
      _vala_ccode_node_unref0 (_tmp27_);
      _tmp28_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      vala_ccode_function_add_expression (_tmp28_, (ValaCCodeExpression*) ccritical);
      _tmp29_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      vala_ccode_function_add_expression (_tmp29_, (ValaCCodeExpression*) cclear);
      _tmp31_ = vala_ccode_base_module_is_in_constructor ((ValaCCodeBaseModule*) self);
      if (_tmp31_) {
            _tmp30_ = TRUE;
      } else {
            gboolean _tmp32_;
            _tmp32_ = vala_ccode_base_module_is_in_destructor ((ValaCCodeBaseModule*) self);
            _tmp30_ = _tmp32_;
      }
      if (_tmp30_) {
      } else {
            ValaMethod* _tmp33_ = NULL;
            _tmp33_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
            if (VALA_IS_CREATION_METHOD (_tmp33_)) {
                  ValaMethod* _tmp34_ = NULL;
                  ValaSymbol* _tmp35_ = NULL;
                  _tmp34_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
                  _tmp35_ = vala_symbol_get_parent_symbol ((ValaSymbol*) _tmp34_);
                  if (VALA_IS_STRUCT (_tmp35_)) {
                        ValaCCodeFunction* _tmp36_ = NULL;
                        _tmp36_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        vala_ccode_function_add_return (_tmp36_, NULL);
                  } else {
                        ValaCCodeFunction* _tmp37_ = NULL;
                        ValaCCodeConstant* _tmp38_ = NULL;
                        ValaCCodeConstant* _tmp39_;
                        _tmp37_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        _tmp38_ = vala_ccode_constant_new ("NULL");
                        _tmp39_ = _tmp38_;
                        vala_ccode_function_add_return (_tmp37_, (ValaCCodeExpression*) _tmp39_);
                        _vala_ccode_node_unref0 (_tmp39_);
                  }
            } else {
                  gboolean _tmp40_;
                  _tmp40_ = vala_ccode_base_module_is_in_coroutine ((ValaCCodeBaseModule*) self);
                  if (_tmp40_) {
                        ValaCCodeFunction* _tmp41_ = NULL;
                        ValaCCodeConstant* _tmp42_ = NULL;
                        ValaCCodeConstant* _tmp43_;
                        _tmp41_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        _tmp42_ = vala_ccode_constant_new ("FALSE");
                        _tmp43_ = _tmp42_;
                        vala_ccode_function_add_return (_tmp41_, (ValaCCodeExpression*) _tmp43_);
                        _vala_ccode_node_unref0 (_tmp43_);
                  } else {
                        ValaDataType* _tmp44_ = NULL;
                        _tmp44_ = vala_ccode_base_module_get_current_return_type ((ValaCCodeBaseModule*) self);
                        if (_tmp44_ != NULL) {
                              ValaDataType* _tmp45_ = NULL;
                              _tmp45_ = vala_ccode_base_module_get_current_return_type ((ValaCCodeBaseModule*) self);
                              vala_ccode_base_module_return_default_value ((ValaCCodeBaseModule*) self, _tmp45_);
                        }
                  }
            }
      }
      _vala_ccode_node_unref0 (cclear);
      _vala_ccode_node_unref0 (domain_name);
      _vala_ccode_node_unref0 (ccritical);
}


static gboolean vala_gerror_module_in_finally_block (ValaGErrorModule* self, ValaCodeNode* node) {
      gboolean result = FALSE;
      ValaCodeNode* _tmp0_;
      ValaCodeNode* current_node;
      g_return_val_if_fail (self != NULL, FALSE);
      g_return_val_if_fail (node != NULL, FALSE);
      _tmp0_ = _vala_code_node_ref0 (node);
      current_node = _tmp0_;
      while (TRUE) {
            ValaCodeNode* _tmp1_ = NULL;
            ValaCodeNode* _tmp2_;
            ValaTryStatement* _tmp3_;
            ValaTryStatement* try_stmt;
            gboolean _tmp4_ = FALSE;
            ValaCodeNode* _tmp6_ = NULL;
            ValaCodeNode* _tmp7_;
            if (!(current_node != NULL)) {
                  break;
            }
            _tmp1_ = vala_code_node_get_parent_node (current_node);
            _tmp2_ = _tmp1_;
            _tmp3_ = _vala_code_node_ref0 (VALA_IS_TRY_STATEMENT (_tmp2_) ? ((ValaTryStatement*) _tmp2_) : NULL);
            try_stmt = _tmp3_;
            if (try_stmt != NULL) {
                  ValaBlock* _tmp5_ = NULL;
                  _tmp5_ = vala_try_statement_get_finally_body (try_stmt);
                  _tmp4_ = VALA_CODE_NODE (_tmp5_) == current_node;
            } else {
                  _tmp4_ = FALSE;
            }
            if (_tmp4_) {
                  result = TRUE;
                  _vala_code_node_unref0 (try_stmt);
                  _vala_code_node_unref0 (current_node);
                  return result;
            }
            _tmp6_ = vala_code_node_get_parent_node (current_node);
            _tmp7_ = _vala_code_node_ref0 (_tmp6_);
            _vala_code_node_unref0 (current_node);
            current_node = _tmp7_;
            _vala_code_node_unref0 (try_stmt);
      }
      result = FALSE;
      _vala_code_node_unref0 (current_node);
      return result;
}


static gpointer _vala_iterable_ref0 (gpointer self) {
      return self ? vala_iterable_ref (self) : NULL;
}


static gpointer _vala_ccode_node_ref0 (gpointer self) {
      return self ? vala_ccode_node_ref (self) : NULL;
}


static void vala_gerror_module_real_add_simple_check (ValaCCodeBaseModule* base, ValaCodeNode* node, gboolean always_fails) {
      ValaGErrorModule * self;
      ValaCCodeExpression* _tmp0_ = NULL;
      ValaCCodeExpression* inner_error;
      ValaTryStatement* _tmp6_ = NULL;
      self = (ValaGErrorModule*) base;
      g_return_if_fail (node != NULL);
      vala_ccode_base_module_set_current_method_inner_error ((ValaCCodeBaseModule*) self, TRUE);
      _tmp0_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, "_inner_error_");
      inner_error = _tmp0_;
      if (always_fails) {
      } else {
            ValaCCodeConstant* _tmp1_ = NULL;
            ValaCCodeConstant* _tmp2_;
            ValaCCodeBinaryExpression* _tmp3_ = NULL;
            ValaCCodeBinaryExpression* _tmp4_;
            ValaCCodeBinaryExpression* ccond;
            ValaCCodeFunction* _tmp5_ = NULL;
            _tmp1_ = vala_ccode_constant_new ("NULL");
            _tmp2_ = _tmp1_;
            _tmp3_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_INEQUALITY, inner_error, (ValaCCodeExpression*) _tmp2_);
            _tmp4_ = _tmp3_;
            _vala_ccode_node_unref0 (_tmp2_);
            ccond = _tmp4_;
            _tmp5_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            vala_ccode_function_open_if (_tmp5_, (ValaCCodeExpression*) ccond);
            _vala_ccode_node_unref0 (ccond);
      }
      _tmp6_ = vala_ccode_base_module_get_current_try ((ValaCCodeBaseModule*) self);
      if (_tmp6_ != NULL) {
            ValaArrayList* _tmp11_ = NULL;
            ValaArrayList* error_types;
            gboolean has_general_catch_clause;
            if (self->priv->is_in_catch) {
                  ValaSymbol* _tmp7_ = NULL;
                  ValaCatchClause* _tmp8_ = NULL;
                  _tmp7_ = vala_ccode_base_module_get_current_symbol ((ValaCCodeBaseModule*) self);
                  _tmp8_ = vala_ccode_base_module_get_current_catch ((ValaCCodeBaseModule*) self);
                  vala_ccode_base_module_append_local_free ((ValaCCodeBaseModule*) self, _tmp7_, FALSE, (ValaCodeNode*) _tmp8_);
            } else {
                  ValaSymbol* _tmp9_ = NULL;
                  ValaTryStatement* _tmp10_ = NULL;
                  _tmp9_ = vala_ccode_base_module_get_current_symbol ((ValaCCodeBaseModule*) self);
                  _tmp10_ = vala_ccode_base_module_get_current_try ((ValaCCodeBaseModule*) self);
                  vala_ccode_base_module_append_local_free ((ValaCCodeBaseModule*) self, _tmp9_, FALSE, (ValaCodeNode*) _tmp10_);
            }
            _tmp11_ = vala_array_list_new (VALA_TYPE_DATA_TYPE, (GBoxedCopyFunc) vala_code_node_ref, vala_code_node_unref, g_direct_equal);
            error_types = _tmp11_;
            {
                  ValaList* _tmp12_ = NULL;
                  ValaList* _node_error_type_list;
                  gint _tmp13_;
                  gint _node_error_type_size;
                  gint _node_error_type_index;
                  _tmp12_ = vala_code_node_get_error_types (node);
                  _node_error_type_list = _tmp12_;
                  _tmp13_ = vala_collection_get_size ((ValaCollection*) _node_error_type_list);
                  _node_error_type_size = _tmp13_;
                  _node_error_type_index = -1;
                  while (TRUE) {
                        gpointer _tmp14_ = NULL;
                        ValaDataType* node_error_type;
                        _node_error_type_index = _node_error_type_index + 1;
                        if (!(_node_error_type_index < _node_error_type_size)) {
                              break;
                        }
                        _tmp14_ = vala_list_get (_node_error_type_list, _node_error_type_index);
                        node_error_type = (ValaDataType*) _tmp14_;
                        vala_collection_add ((ValaCollection*) error_types, node_error_type);
                        _vala_code_node_unref0 (node_error_type);
                  }
                  _vala_iterable_unref0 (_node_error_type_list);
            }
            has_general_catch_clause = FALSE;
            if (!self->priv->is_in_catch) {
                  ValaArrayList* _tmp15_ = NULL;
                  ValaArrayList* handled_error_types;
                  _tmp15_ = vala_array_list_new (VALA_TYPE_DATA_TYPE, (GBoxedCopyFunc) vala_code_node_ref, vala_code_node_unref, g_direct_equal);
                  handled_error_types = _tmp15_;
                  {
                        ValaTryStatement* _tmp16_ = NULL;
                        ValaList* _tmp17_ = NULL;
                        ValaList* _clause_list;
                        gint _tmp18_;
                        gint _clause_size;
                        gint _clause_index;
                        _tmp16_ = vala_ccode_base_module_get_current_try ((ValaCCodeBaseModule*) self);
                        _tmp17_ = vala_try_statement_get_catch_clauses (_tmp16_);
                        _clause_list = _tmp17_;
                        _tmp18_ = vala_collection_get_size ((ValaCollection*) _clause_list);
                        _clause_size = _tmp18_;
                        _clause_index = -1;
                        while (TRUE) {
                              gpointer _tmp19_ = NULL;
                              ValaCatchClause* clause;
                              ValaDataType* _tmp30_ = NULL;
                              gboolean _tmp31_;
                              _clause_index = _clause_index + 1;
                              if (!(_clause_index < _clause_size)) {
                                    break;
                              }
                              _tmp19_ = vala_list_get (_clause_list, _clause_index);
                              clause = (ValaCatchClause*) _tmp19_;
                              {
                                    ValaArrayList* _tmp20_;
                                    ValaArrayList* _node_error_type_list;
                                    gint _tmp21_;
                                    gint _node_error_type_size;
                                    gint _node_error_type_index;
                                    _tmp20_ = _vala_iterable_ref0 (error_types);
                                    _node_error_type_list = _tmp20_;
                                    _tmp21_ = vala_collection_get_size ((ValaCollection*) _node_error_type_list);
                                    _node_error_type_size = _tmp21_;
                                    _node_error_type_index = -1;
                                    while (TRUE) {
                                          gpointer _tmp22_ = NULL;
                                          ValaDataType* node_error_type;
                                          gboolean _tmp23_ = FALSE;
                                          ValaDataType* _tmp24_ = NULL;
                                          _node_error_type_index = _node_error_type_index + 1;
                                          if (!(_node_error_type_index < _node_error_type_size)) {
                                                break;
                                          }
                                          _tmp22_ = vala_list_get ((ValaList*) _node_error_type_list, _node_error_type_index);
                                          node_error_type = (ValaDataType*) _tmp22_;
                                          _tmp24_ = vala_catch_clause_get_error_type (clause);
                                          if (_tmp24_ == NULL) {
                                                _tmp23_ = TRUE;
                                          } else {
                                                ValaDataType* _tmp25_ = NULL;
                                                gboolean _tmp26_;
                                                _tmp25_ = vala_catch_clause_get_error_type (clause);
                                                _tmp26_ = vala_data_type_compatible (node_error_type, _tmp25_);
                                                _tmp23_ = _tmp26_;
                                          }
                                          if (_tmp23_) {
                                                vala_collection_add ((ValaCollection*) handled_error_types, node_error_type);
                                          }
                                          _vala_code_node_unref0 (node_error_type);
                                    }
                                    _vala_iterable_unref0 (_node_error_type_list);
                              }
                              {
                                    ValaArrayList* _tmp27_;
                                    ValaArrayList* _handled_error_type_list;
                                    gint _tmp28_;
                                    gint _handled_error_type_size;
                                    gint _handled_error_type_index;
                                    _tmp27_ = _vala_iterable_ref0 (handled_error_types);
                                    _handled_error_type_list = _tmp27_;
                                    _tmp28_ = vala_collection_get_size ((ValaCollection*) _handled_error_type_list);
                                    _handled_error_type_size = _tmp28_;
                                    _handled_error_type_index = -1;
                                    while (TRUE) {
                                          gpointer _tmp29_ = NULL;
                                          ValaDataType* handled_error_type;
                                          _handled_error_type_index = _handled_error_type_index + 1;
                                          if (!(_handled_error_type_index < _handled_error_type_size)) {
                                                break;
                                          }
                                          _tmp29_ = vala_list_get ((ValaList*) _handled_error_type_list, _handled_error_type_index);
                                          handled_error_type = (ValaDataType*) _tmp29_;
                                          vala_collection_remove ((ValaCollection*) error_types, handled_error_type);
                                          _vala_code_node_unref0 (handled_error_type);
                                    }
                                    _vala_iterable_unref0 (_handled_error_type_list);
                              }
                              vala_collection_clear ((ValaCollection*) handled_error_types);
                              _tmp30_ = vala_catch_clause_get_error_type (clause);
                              _tmp31_ = vala_data_type_equals (_tmp30_, (ValaDataType*) ((ValaCCodeBaseModule*) self)->gerror_type);
                              if (_tmp31_) {
                                    ValaCCodeFunction* _tmp32_ = NULL;
                                    const gchar* _tmp33_ = NULL;
                                    has_general_catch_clause = TRUE;
                                    _tmp32_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                                    _tmp33_ = vala_catch_clause_get_clabel_name (clause);
                                    vala_ccode_function_add_goto (_tmp32_, _tmp33_);
                                    _vala_code_node_unref0 (clause);
                                    break;
                              } else {
                                    ValaDataType* _tmp34_ = NULL;
                                    ValaDataType* _tmp35_;
                                    ValaErrorType* _tmp36_;
                                    ValaErrorType* catch_type;
                                    ValaErrorCode* _tmp37_ = NULL;
                                    ValaCCodeFunction* _tmp64_ = NULL;
                                    const gchar* _tmp65_ = NULL;
                                    ValaCCodeFunction* _tmp66_ = NULL;
                                    _tmp34_ = vala_catch_clause_get_error_type (clause);
                                    _tmp35_ = _tmp34_;
                                    _tmp36_ = _vala_code_node_ref0 (VALA_IS_ERROR_TYPE (_tmp35_) ? ((ValaErrorType*) _tmp35_) : NULL);
                                    catch_type = _tmp36_;
                                    _tmp37_ = vala_error_type_get_error_code (catch_type);
                                    if (_tmp37_ != NULL) {
                                          ValaCCodeIdentifier* _tmp38_ = NULL;
                                          ValaCCodeIdentifier* _tmp39_;
                                          ValaCCodeFunctionCall* _tmp40_ = NULL;
                                          ValaCCodeFunctionCall* _tmp41_;
                                          ValaCCodeFunctionCall* error_match;
                                          ValaTypeSymbol* _tmp42_ = NULL;
                                          gchar* _tmp43_ = NULL;
                                          gchar* _tmp44_;
                                          ValaCCodeIdentifier* _tmp45_ = NULL;
                                          ValaCCodeIdentifier* _tmp46_;
                                          ValaErrorCode* _tmp47_ = NULL;
                                          gchar* _tmp48_ = NULL;
                                          gchar* _tmp49_;
                                          ValaCCodeIdentifier* _tmp50_ = NULL;
                                          ValaCCodeIdentifier* _tmp51_;
                                          ValaCCodeFunction* _tmp52_ = NULL;
                                          _tmp38_ = vala_ccode_identifier_new ("g_error_matches");
                                          _tmp39_ = _tmp38_;
                                          _tmp40_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp39_);
                                          _tmp41_ = _tmp40_;
                                          _vala_ccode_node_unref0 (_tmp39_);
                                          error_match = _tmp41_;
                                          vala_ccode_function_call_add_argument (error_match, inner_error);
                                          _tmp42_ = vala_data_type_get_data_type ((ValaDataType*) catch_type);
                                          _tmp43_ = vala_typesymbol_get_upper_case_cname (_tmp42_, NULL);
                                          _tmp44_ = _tmp43_;
                                          _tmp45_ = vala_ccode_identifier_new (_tmp44_);
                                          _tmp46_ = _tmp45_;
                                          vala_ccode_function_call_add_argument (error_match, (ValaCCodeExpression*) _tmp46_);
                                          _vala_ccode_node_unref0 (_tmp46_);
                                          _g_free0 (_tmp44_);
                                          _tmp47_ = vala_error_type_get_error_code (catch_type);
                                          _tmp48_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) _tmp47_, FALSE);
                                          _tmp49_ = _tmp48_;
                                          _tmp50_ = vala_ccode_identifier_new (_tmp49_);
                                          _tmp51_ = _tmp50_;
                                          vala_ccode_function_call_add_argument (error_match, (ValaCCodeExpression*) _tmp51_);
                                          _vala_ccode_node_unref0 (_tmp51_);
                                          _g_free0 (_tmp49_);
                                          _tmp52_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                                          vala_ccode_function_open_if (_tmp52_, (ValaCCodeExpression*) error_match);
                                          _vala_ccode_node_unref0 (error_match);
                                    } else {
                                          ValaCCodeMemberAccess* _tmp53_ = NULL;
                                          ValaCCodeMemberAccess* _tmp54_;
                                          ValaDataType* _tmp55_ = NULL;
                                          ValaTypeSymbol* _tmp56_ = NULL;
                                          gchar* _tmp57_ = NULL;
                                          gchar* _tmp58_;
                                          ValaCCodeIdentifier* _tmp59_ = NULL;
                                          ValaCCodeIdentifier* _tmp60_;
                                          ValaCCodeBinaryExpression* _tmp61_ = NULL;
                                          ValaCCodeBinaryExpression* _tmp62_;
                                          ValaCCodeBinaryExpression* ccond;
                                          ValaCCodeFunction* _tmp63_ = NULL;
                                          _tmp53_ = vala_ccode_member_access_new_pointer (inner_error, "domain");
                                          _tmp54_ = _tmp53_;
                                          _tmp55_ = vala_catch_clause_get_error_type (clause);
                                          _tmp56_ = vala_data_type_get_data_type (_tmp55_);
                                          _tmp57_ = vala_typesymbol_get_upper_case_cname (_tmp56_, NULL);
                                          _tmp58_ = _tmp57_;
                                          _tmp59_ = vala_ccode_identifier_new (_tmp58_);
                                          _tmp60_ = _tmp59_;
                                          _tmp61_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_EQUALITY, (ValaCCodeExpression*) _tmp54_, (ValaCCodeExpression*) _tmp60_);
                                          _tmp62_ = _tmp61_;
                                          _vala_ccode_node_unref0 (_tmp60_);
                                          _g_free0 (_tmp58_);
                                          _vala_ccode_node_unref0 (_tmp54_);
                                          ccond = _tmp62_;
                                          _tmp63_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                                          vala_ccode_function_open_if (_tmp63_, (ValaCCodeExpression*) ccond);
                                          _vala_ccode_node_unref0 (ccond);
                                    }
                                    _tmp64_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                                    _tmp65_ = vala_catch_clause_get_clabel_name (clause);
                                    vala_ccode_function_add_goto (_tmp64_, _tmp65_);
                                    _tmp66_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                                    vala_ccode_function_close (_tmp66_);
                                    _vala_code_node_unref0 (catch_type);
                              }
                              _vala_code_node_unref0 (clause);
                        }
                        _vala_iterable_unref0 (_clause_list);
                  }
                  _vala_iterable_unref0 (handled_error_types);
            }
            if (has_general_catch_clause) {
            } else {
                  gint _tmp67_;
                  _tmp67_ = vala_collection_get_size ((ValaCollection*) error_types);
                  if (_tmp67_ > 0) {
                        ValaCCodeFunction* _tmp68_ = NULL;
                        gchar* _tmp69_ = NULL;
                        gchar* _tmp70_;
                        _tmp68_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        _tmp69_ = g_strdup_printf ("__finally%d", self->priv->current_try_id);
                        _tmp70_ = _tmp69_;
                        vala_ccode_function_add_goto (_tmp68_, _tmp70_);
                        _g_free0 (_tmp70_);
                  } else {
                        gboolean _tmp71_;
                        _tmp71_ = vala_gerror_module_in_finally_block (self, node);
                        if (_tmp71_) {
                        } else {
                              vala_gerror_module_uncaught_error_statement (self, inner_error, TRUE);
                        }
                  }
            }
            _vala_iterable_unref0 (error_types);
      } else {
            gboolean _tmp72_ = FALSE;
            ValaMethod* _tmp73_ = NULL;
            _tmp73_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
            if (_tmp73_ != NULL) {
                  ValaMethod* _tmp74_ = NULL;
                  ValaList* _tmp75_ = NULL;
                  ValaList* _tmp76_;
                  gint _tmp77_;
                  _tmp74_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
                  _tmp75_ = vala_code_node_get_error_types ((ValaCodeNode*) _tmp74_);
                  _tmp76_ = _tmp75_;
                  _tmp77_ = vala_collection_get_size ((ValaCollection*) _tmp76_);
                  _tmp72_ = _tmp77_ > 0;
                  _vala_iterable_unref0 (_tmp76_);
            } else {
                  _tmp72_ = FALSE;
            }
            if (_tmp72_) {
                  ValaCCodeBinaryExpression* ccond;
                  ccond = NULL;
                  {
                        ValaMethod* _tmp78_ = NULL;
                        ValaList* _tmp79_ = NULL;
                        ValaList* _error_type_list;
                        gint _tmp80_;
                        gint _error_type_size;
                        gint _error_type_index;
                        _tmp78_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
                        _tmp79_ = vala_code_node_get_error_types ((ValaCodeNode*) _tmp78_);
                        _error_type_list = _tmp79_;
                        _tmp80_ = vala_collection_get_size ((ValaCollection*) _error_type_list);
                        _error_type_size = _tmp80_;
                        _error_type_index = -1;
                        while (TRUE) {
                              gpointer _tmp81_ = NULL;
                              ValaDataType* error_type;
                              gboolean _tmp82_;
                              ValaCCodeMemberAccess* _tmp83_ = NULL;
                              ValaCCodeMemberAccess* _tmp84_;
                              ValaTypeSymbol* _tmp85_ = NULL;
                              gchar* _tmp86_ = NULL;
                              gchar* _tmp87_;
                              ValaCCodeIdentifier* _tmp88_ = NULL;
                              ValaCCodeIdentifier* _tmp89_;
                              ValaCCodeBinaryExpression* _tmp90_ = NULL;
                              ValaCCodeBinaryExpression* _tmp91_;
                              ValaCCodeBinaryExpression* domain_check;
                              _error_type_index = _error_type_index + 1;
                              if (!(_error_type_index < _error_type_size)) {
                                    break;
                              }
                              _tmp81_ = vala_list_get (_error_type_list, _error_type_index);
                              error_type = (ValaDataType*) _tmp81_;
                              _tmp82_ = vala_data_type_equals (error_type, (ValaDataType*) ((ValaCCodeBaseModule*) self)->gerror_type);
                              if (_tmp82_) {
                                    _vala_ccode_node_unref0 (ccond);
                                    ccond = NULL;
                                    _vala_code_node_unref0 (error_type);
                                    break;
                              }
                              _tmp83_ = vala_ccode_member_access_new_pointer (inner_error, "domain");
                              _tmp84_ = _tmp83_;
                              _tmp85_ = vala_data_type_get_data_type (error_type);
                              _tmp86_ = vala_typesymbol_get_upper_case_cname (_tmp85_, NULL);
                              _tmp87_ = _tmp86_;
                              _tmp88_ = vala_ccode_identifier_new (_tmp87_);
                              _tmp89_ = _tmp88_;
                              _tmp90_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_EQUALITY, (ValaCCodeExpression*) _tmp84_, (ValaCCodeExpression*) _tmp89_);
                              _tmp91_ = _tmp90_;
                              _vala_ccode_node_unref0 (_tmp89_);
                              _g_free0 (_tmp87_);
                              _vala_ccode_node_unref0 (_tmp84_);
                              domain_check = _tmp91_;
                              if (ccond == NULL) {
                                    ValaCCodeBinaryExpression* _tmp92_;
                                    _tmp92_ = _vala_ccode_node_ref0 (domain_check);
                                    _vala_ccode_node_unref0 (ccond);
                                    ccond = _tmp92_;
                              } else {
                                    ValaCCodeBinaryExpression* _tmp93_ = NULL;
                                    _tmp93_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_OR, (ValaCCodeExpression*) ccond, (ValaCCodeExpression*) domain_check);
                                    _vala_ccode_node_unref0 (ccond);
                                    ccond = _tmp93_;
                              }
                              _vala_ccode_node_unref0 (domain_check);
                              _vala_code_node_unref0 (error_type);
                        }
                        _vala_iterable_unref0 (_error_type_list);
                  }
                  if (ccond != NULL) {
                        ValaCCodeFunction* _tmp94_ = NULL;
                        ValaCCodeFunction* _tmp95_ = NULL;
                        ValaCCodeFunction* _tmp96_ = NULL;
                        _tmp94_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        vala_ccode_function_open_if (_tmp94_, (ValaCCodeExpression*) ccond);
                        vala_gerror_module_return_with_exception (self, inner_error);
                        _tmp95_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        vala_ccode_function_add_else (_tmp95_);
                        vala_gerror_module_uncaught_error_statement (self, inner_error, FALSE);
                        _tmp96_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        vala_ccode_function_close (_tmp96_);
                  } else {
                        vala_gerror_module_return_with_exception (self, inner_error);
                  }
                  _vala_ccode_node_unref0 (ccond);
            } else {
                  vala_gerror_module_uncaught_error_statement (self, inner_error, FALSE);
            }
      }
      if (!always_fails) {
            ValaCCodeFunction* _tmp97_ = NULL;
            _tmp97_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            vala_ccode_function_close (_tmp97_);
      }
      _vala_ccode_node_unref0 (inner_error);
}


static void vala_gerror_module_real_visit_try_statement (ValaCodeVisitor* base, ValaTryStatement* stmt) {
      ValaGErrorModule * self;
      gint _tmp0_;
      gint this_try_id;
      ValaTryStatement* _tmp1_ = NULL;
      ValaTryStatement* _tmp2_;
      ValaTryStatement* old_try;
      gint old_try_id;
      gboolean old_is_in_catch;
      ValaCatchClause* _tmp3_ = NULL;
      ValaCatchClause* _tmp4_;
      ValaCatchClause* old_catch;
      ValaBlock* _tmp13_ = NULL;
      ValaCCodeFunction* _tmp20_ = NULL;
      gchar* _tmp21_ = NULL;
      gchar* _tmp22_;
      ValaBlock* _tmp23_ = NULL;
      gboolean _tmp25_;
      self = (ValaGErrorModule*) base;
      g_return_if_fail (stmt != NULL);
      _tmp0_ = self->priv->next_try_id;
      self->priv->next_try_id = _tmp0_ + 1;
      this_try_id = _tmp0_;
      _tmp1_ = vala_ccode_base_module_get_current_try ((ValaCCodeBaseModule*) self);
      _tmp2_ = _vala_code_node_ref0 (_tmp1_);
      old_try = _tmp2_;
      old_try_id = self->priv->current_try_id;
      old_is_in_catch = self->priv->is_in_catch;
      _tmp3_ = vala_ccode_base_module_get_current_catch ((ValaCCodeBaseModule*) self);
      _tmp4_ = _vala_code_node_ref0 (_tmp3_);
      old_catch = _tmp4_;
      vala_ccode_base_module_set_current_try ((ValaCCodeBaseModule*) self, stmt);
      self->priv->current_try_id = this_try_id;
      self->priv->is_in_catch = TRUE;
      {
            ValaList* _tmp5_ = NULL;
            ValaList* _clause_list;
            gint _tmp6_;
            gint _clause_size;
            gint _clause_index;
            _tmp5_ = vala_try_statement_get_catch_clauses (stmt);
            _clause_list = _tmp5_;
            _tmp6_ = vala_collection_get_size ((ValaCollection*) _clause_list);
            _clause_size = _tmp6_;
            _clause_index = -1;
            while (TRUE) {
                  gpointer _tmp7_ = NULL;
                  ValaCatchClause* clause;
                  ValaDataType* _tmp8_ = NULL;
                  gchar* _tmp9_ = NULL;
                  gchar* _tmp10_;
                  gchar* _tmp11_ = NULL;
                  gchar* _tmp12_;
                  _clause_index = _clause_index + 1;
                  if (!(_clause_index < _clause_size)) {
                        break;
                  }
                  _tmp7_ = vala_list_get (_clause_list, _clause_index);
                  clause = (ValaCatchClause*) _tmp7_;
                  _tmp8_ = vala_catch_clause_get_error_type (clause);
                  _tmp9_ = vala_data_type_get_lower_case_cname (_tmp8_, NULL);
                  _tmp10_ = _tmp9_;
                  _tmp11_ = g_strdup_printf ("__catch%d_%s", this_try_id, _tmp10_);
                  _tmp12_ = _tmp11_;
                  vala_catch_clause_set_clabel_name (clause, _tmp12_);
                  _g_free0 (_tmp12_);
                  _g_free0 (_tmp10_);
                  _vala_code_node_unref0 (clause);
            }
            _vala_iterable_unref0 (_clause_list);
      }
      self->priv->is_in_catch = FALSE;
      _tmp13_ = vala_try_statement_get_body (stmt);
      vala_code_node_emit ((ValaCodeNode*) _tmp13_, (ValaCodeGenerator*) self);
      self->priv->is_in_catch = TRUE;
      {
            ValaList* _tmp14_ = NULL;
            ValaList* _clause_list;
            gint _tmp15_;
            gint _clause_size;
            gint _clause_index;
            _tmp14_ = vala_try_statement_get_catch_clauses (stmt);
            _clause_list = _tmp14_;
            _tmp15_ = vala_collection_get_size ((ValaCollection*) _clause_list);
            _clause_size = _tmp15_;
            _clause_index = -1;
            while (TRUE) {
                  gpointer _tmp16_ = NULL;
                  ValaCatchClause* clause;
                  ValaCCodeFunction* _tmp17_ = NULL;
                  gchar* _tmp18_ = NULL;
                  gchar* _tmp19_;
                  _clause_index = _clause_index + 1;
                  if (!(_clause_index < _clause_size)) {
                        break;
                  }
                  _tmp16_ = vala_list_get (_clause_list, _clause_index);
                  clause = (ValaCatchClause*) _tmp16_;
                  vala_ccode_base_module_set_current_catch ((ValaCCodeBaseModule*) self, clause);
                  _tmp17_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                  _tmp18_ = g_strdup_printf ("__finally%d", this_try_id);
                  _tmp19_ = _tmp18_;
                  vala_ccode_function_add_goto (_tmp17_, _tmp19_);
                  _g_free0 (_tmp19_);
                  vala_code_node_emit ((ValaCodeNode*) clause, (ValaCodeGenerator*) self);
                  _vala_code_node_unref0 (clause);
            }
            _vala_iterable_unref0 (_clause_list);
      }
      vala_ccode_base_module_set_current_try ((ValaCCodeBaseModule*) self, old_try);
      self->priv->current_try_id = old_try_id;
      self->priv->is_in_catch = old_is_in_catch;
      vala_ccode_base_module_set_current_catch ((ValaCCodeBaseModule*) self, old_catch);
      _tmp20_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      _tmp21_ = g_strdup_printf ("__finally%d", this_try_id);
      _tmp22_ = _tmp21_;
      vala_ccode_function_add_label (_tmp20_, _tmp22_);
      _g_free0 (_tmp22_);
      _tmp23_ = vala_try_statement_get_finally_body (stmt);
      if (_tmp23_ != NULL) {
            ValaBlock* _tmp24_ = NULL;
            _tmp24_ = vala_try_statement_get_finally_body (stmt);
            vala_code_node_emit ((ValaCodeNode*) _tmp24_, (ValaCodeGenerator*) self);
      }
      _tmp25_ = vala_try_statement_get_after_try_block_reachable (stmt);
      vala_ccode_base_module_add_simple_check ((ValaCCodeBaseModule*) self, (ValaCodeNode*) stmt, !_tmp25_);
      _vala_code_node_unref0 (old_catch);
      _vala_code_node_unref0 (old_try);
}


static void vala_gerror_module_real_visit_catch_clause (ValaCodeVisitor* base, ValaCatchClause* clause) {
      ValaGErrorModule * self;
      ValaDataType* _tmp0_ = NULL;
      ValaErrorType* _tmp1_;
      ValaErrorType* error_type;
      ValaErrorDomain* _tmp2_ = NULL;
      ValaCCodeFunction* _tmp4_ = NULL;
      const gchar* _tmp5_ = NULL;
      ValaCCodeFunction* _tmp6_ = NULL;
      gchar* variable_name = NULL;
      const gchar* _tmp7_ = NULL;
      const gchar* _tmp11_ = NULL;
      ValaCCodeFunction* _tmp30_ = NULL;
      ValaCCodeExpression* _tmp31_ = NULL;
      ValaCCodeExpression* _tmp32_;
      ValaCCodeConstant* _tmp33_ = NULL;
      ValaCCodeConstant* _tmp34_;
      ValaBlock* _tmp35_ = NULL;
      ValaCCodeFunction* _tmp36_ = NULL;
      self = (ValaGErrorModule*) base;
      g_return_if_fail (clause != NULL);
      vala_ccode_base_module_set_current_method_inner_error ((ValaCCodeBaseModule*) self, TRUE);
      _tmp0_ = vala_catch_clause_get_error_type (clause);
      _tmp1_ = _vala_code_node_ref0 (VALA_ERROR_TYPE (_tmp0_));
      error_type = _tmp1_;
      _tmp2_ = vala_error_type_get_error_domain (error_type);
      if (_tmp2_ != NULL) {
            ValaErrorDomain* _tmp3_ = NULL;
            _tmp3_ = vala_error_type_get_error_domain (error_type);
            vala_ccode_base_module_generate_error_domain_declaration ((ValaCCodeBaseModule*) self, _tmp3_, ((ValaCCodeBaseModule*) self)->cfile);
      }
      _tmp4_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      _tmp5_ = vala_catch_clause_get_clabel_name (clause);
      vala_ccode_function_add_label (_tmp4_, _tmp5_);
      _tmp6_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      vala_ccode_function_open_block (_tmp6_);
      _tmp7_ = vala_catch_clause_get_variable_name (clause);
      if (_tmp7_ != NULL) {
            const gchar* _tmp8_ = NULL;
            gchar* _tmp9_ = NULL;
            _tmp8_ = vala_catch_clause_get_variable_name (clause);
            _tmp9_ = vala_ccode_base_module_get_variable_cname ((ValaCCodeBaseModule*) self, _tmp8_);
            _g_free0 (variable_name);
            variable_name = _tmp9_;
      } else {
            gchar* _tmp10_;
            _tmp10_ = g_strdup ("__err");
            _g_free0 (variable_name);
            variable_name = _tmp10_;
      }
      _tmp11_ = vala_catch_clause_get_variable_name (clause);
      if (_tmp11_ != NULL) {
            gboolean _tmp12_;
            ValaCCodeFunction* _tmp16_ = NULL;
            ValaCCodeExpression* _tmp17_ = NULL;
            ValaCCodeExpression* _tmp18_;
            ValaCCodeExpression* _tmp19_ = NULL;
            ValaCCodeExpression* _tmp20_;
            _tmp12_ = vala_ccode_base_module_is_in_coroutine ((ValaCCodeBaseModule*) self);
            if (_tmp12_) {
                  vala_ccode_struct_add_field (((ValaCCodeBaseModule*) self)->closure_struct, "GError *", variable_name, NULL);
            } else {
                  ValaCCodeFunction* _tmp13_ = NULL;
                  ValaCCodeVariableDeclarator* _tmp14_ = NULL;
                  ValaCCodeVariableDeclarator* _tmp15_;
                  _tmp13_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                  _tmp14_ = vala_ccode_variable_declarator_new (variable_name, NULL, NULL);
                  _tmp15_ = _tmp14_;
                  vala_ccode_function_add_declaration (_tmp13_, "GError *", (ValaCCodeDeclarator*) _tmp15_, 0);
                  _vala_ccode_node_unref0 (_tmp15_);
            }
            _tmp16_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            _tmp17_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, variable_name);
            _tmp18_ = _tmp17_;
            _tmp19_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, "_inner_error_");
            _tmp20_ = _tmp19_;
            vala_ccode_function_add_assignment (_tmp16_, _tmp18_, _tmp20_);
            _vala_ccode_node_unref0 (_tmp20_);
            _vala_ccode_node_unref0 (_tmp18_);
      } else {
            ValaCCodeIdentifier* _tmp21_ = NULL;
            ValaCCodeIdentifier* _tmp22_;
            ValaCCodeFunctionCall* _tmp23_ = NULL;
            ValaCCodeFunctionCall* _tmp24_;
            ValaCCodeFunctionCall* cclear;
            ValaCCodeExpression* _tmp25_ = NULL;
            ValaCCodeExpression* _tmp26_;
            ValaCCodeUnaryExpression* _tmp27_ = NULL;
            ValaCCodeUnaryExpression* _tmp28_;
            ValaCCodeFunction* _tmp29_ = NULL;
            _tmp21_ = vala_ccode_identifier_new ("g_clear_error");
            _tmp22_ = _tmp21_;
            _tmp23_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp22_);
            _tmp24_ = _tmp23_;
            _vala_ccode_node_unref0 (_tmp22_);
            cclear = _tmp24_;
            _tmp25_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, "_inner_error_");
            _tmp26_ = _tmp25_;
            _tmp27_ = vala_ccode_unary_expression_new (VALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp26_);
            _tmp28_ = _tmp27_;
            vala_ccode_function_call_add_argument (cclear, (ValaCCodeExpression*) _tmp28_);
            _vala_ccode_node_unref0 (_tmp28_);
            _vala_ccode_node_unref0 (_tmp26_);
            _tmp29_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            vala_ccode_function_add_expression (_tmp29_, (ValaCCodeExpression*) cclear);
            _vala_ccode_node_unref0 (cclear);
      }
      _tmp30_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      _tmp31_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, "_inner_error_");
      _tmp32_ = _tmp31_;
      _tmp33_ = vala_ccode_constant_new ("NULL");
      _tmp34_ = _tmp33_;
      vala_ccode_function_add_assignment (_tmp30_, _tmp32_, (ValaCCodeExpression*) _tmp34_);
      _vala_ccode_node_unref0 (_tmp34_);
      _vala_ccode_node_unref0 (_tmp32_);
      _tmp35_ = vala_catch_clause_get_body (clause);
      vala_code_node_emit ((ValaCodeNode*) _tmp35_, (ValaCodeGenerator*) self);
      _tmp36_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      vala_ccode_function_close (_tmp36_);
      _g_free0 (variable_name);
      _vala_code_node_unref0 (error_type);
}


static void vala_gerror_module_real_append_local_free (ValaCCodeBaseModule* base, ValaSymbol* sym, gboolean stop_at_loop, ValaCodeNode* stop_at) {
      ValaGErrorModule * self;
      gboolean _tmp0_ = FALSE;
      self = (ValaGErrorModule*) base;
      g_return_if_fail (sym != NULL);
      if (VALA_IS_TRY_STATEMENT (stop_at)) {
            _tmp0_ = TRUE;
      } else {
            _tmp0_ = VALA_IS_CATCH_CLAUSE (stop_at);
      }
      if (!_tmp0_) {
            ValaBlock* _tmp1_;
            ValaBlock* finally_block;
            ValaCodeNode* _tmp2_ = NULL;
            gboolean _tmp13_ = FALSE;
            _tmp1_ = _vala_code_node_ref0 (VALA_BLOCK (NULL));
            finally_block = _tmp1_;
            _tmp2_ = vala_code_node_get_parent_node ((ValaCodeNode*) sym);
            if (VALA_IS_TRY_STATEMENT (_tmp2_)) {
                  ValaCodeNode* _tmp3_ = NULL;
                  ValaCodeNode* _tmp4_;
                  ValaBlock* _tmp5_ = NULL;
                  ValaBlock* _tmp6_;
                  _tmp3_ = vala_code_node_get_parent_node ((ValaCodeNode*) sym);
                  _tmp4_ = _tmp3_;
                  _tmp5_ = vala_try_statement_get_finally_body (VALA_IS_TRY_STATEMENT (_tmp4_) ? ((ValaTryStatement*) _tmp4_) : NULL);
                  _tmp6_ = _vala_code_node_ref0 (_tmp5_);
                  _vala_code_node_unref0 (finally_block);
                  finally_block = _tmp6_;
            } else {
                  ValaCodeNode* _tmp7_ = NULL;
                  _tmp7_ = vala_code_node_get_parent_node ((ValaCodeNode*) sym);
                  if (VALA_IS_CATCH_CLAUSE (_tmp7_)) {
                        ValaCodeNode* _tmp8_ = NULL;
                        ValaCodeNode* _tmp9_ = NULL;
                        ValaCodeNode* _tmp10_;
                        ValaBlock* _tmp11_ = NULL;
                        ValaBlock* _tmp12_;
                        _tmp8_ = vala_code_node_get_parent_node ((ValaCodeNode*) sym);
                        _tmp9_ = vala_code_node_get_parent_node (_tmp8_);
                        _tmp10_ = _tmp9_;
                        _tmp11_ = vala_try_statement_get_finally_body (VALA_IS_TRY_STATEMENT (_tmp10_) ? ((ValaTryStatement*) _tmp10_) : NULL);
                        _tmp12_ = _vala_code_node_ref0 (_tmp11_);
                        _vala_code_node_unref0 (finally_block);
                        finally_block = _tmp12_;
                  }
            }
            if (finally_block != NULL) {
                  _tmp13_ = VALA_SYMBOL (finally_block) != sym;
            } else {
                  _tmp13_ = FALSE;
            }
            if (_tmp13_) {
                  vala_code_node_emit ((ValaCodeNode*) finally_block, (ValaCodeGenerator*) self);
            }
            _vala_code_node_unref0 (finally_block);
      }
      VALA_CCODE_BASE_MODULE_CLASS (vala_gerror_module_parent_class)->append_local_free ((ValaCCodeBaseModule*) VALA_CCODE_DELEGATE_MODULE (self), sym, stop_at_loop, stop_at);
}


ValaGErrorModule* vala_gerror_module_construct (GType object_type) {
      ValaGErrorModule* self = NULL;
      self = (ValaGErrorModule*) vala_ccode_delegate_module_construct (object_type);
      return self;
}


ValaGErrorModule* vala_gerror_module_new (void) {
      return vala_gerror_module_construct (VALA_TYPE_GERROR_MODULE);
}


static void vala_gerror_module_class_init (ValaGErrorModuleClass * klass) {
      vala_gerror_module_parent_class = g_type_class_peek_parent (klass);
      VALA_CODE_VISITOR_CLASS (klass)->finalize = vala_gerror_module_finalize;
      g_type_class_add_private (klass, sizeof (ValaGErrorModulePrivate));
      VALA_CCODE_BASE_MODULE_CLASS (klass)->generate_error_domain_declaration = vala_gerror_module_real_generate_error_domain_declaration;
      VALA_CODE_VISITOR_CLASS (klass)->visit_error_domain = vala_gerror_module_real_visit_error_domain;
      VALA_CODE_VISITOR_CLASS (klass)->visit_throw_statement = vala_gerror_module_real_visit_throw_statement;
      VALA_GERROR_MODULE_CLASS (klass)->return_with_exception = vala_gerror_module_real_return_with_exception;
      VALA_CCODE_BASE_MODULE_CLASS (klass)->add_simple_check = vala_gerror_module_real_add_simple_check;
      VALA_CODE_VISITOR_CLASS (klass)->visit_try_statement = vala_gerror_module_real_visit_try_statement;
      VALA_CODE_VISITOR_CLASS (klass)->visit_catch_clause = vala_gerror_module_real_visit_catch_clause;
      VALA_CCODE_BASE_MODULE_CLASS (klass)->append_local_free = vala_gerror_module_real_append_local_free;
}


static void vala_gerror_module_instance_init (ValaGErrorModule * self) {
      self->priv = VALA_GERROR_MODULE_GET_PRIVATE (self);
      self->priv->current_try_id = 0;
      self->priv->next_try_id = 0;
      self->priv->is_in_catch = FALSE;
}


static void vala_gerror_module_finalize (ValaCodeVisitor* obj) {
      ValaGErrorModule * self;
      self = VALA_GERROR_MODULE (obj);
      VALA_CODE_VISITOR_CLASS (vala_gerror_module_parent_class)->finalize (obj);
}


GType vala_gerror_module_get_type (void) {
      static volatile gsize vala_gerror_module_type_id__volatile = 0;
      if (g_once_init_enter (&vala_gerror_module_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (ValaGErrorModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_gerror_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaGErrorModule), 0, (GInstanceInitFunc) vala_gerror_module_instance_init, NULL };
            GType vala_gerror_module_type_id;
            vala_gerror_module_type_id = g_type_register_static (VALA_TYPE_CCODE_DELEGATE_MODULE, "ValaGErrorModule", &g_define_type_info, 0);
            g_once_init_leave (&vala_gerror_module_type_id__volatile, vala_gerror_module_type_id);
      }
      return vala_gerror_module_type_id__volatile;
}




Generated by  Doxygen 1.6.0   Back to index