/* gcp-c-document.c generated by valac 0.17.4.20-387e, the Vala compiler
 * generated from gcp-c-document.vala, do not modify */

/*
 * This file is part of gedit-code-assistant.
 *
 * Copyright (C) 2011 - Jesse van den Kieboom
 *
 * gedit-code-assistant is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * gedit-code-assistant 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gedit-code-assistant.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gcp.h>
#include <gedit/gedit-document.h>
#include <gtk/gtk.h>
#include <clang-c/Index.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <gee.h>
#include <gobject/gvaluecollector.h>


#define GCP_C_TYPE_DOCUMENT (gcp_c_document_get_type ())
#define GCP_C_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_C_TYPE_DOCUMENT, GcpCDocument))
#define GCP_C_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCP_C_TYPE_DOCUMENT, GcpCDocumentClass))
#define GCP_C_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_C_TYPE_DOCUMENT))
#define GCP_C_IS_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCP_C_TYPE_DOCUMENT))
#define GCP_C_DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCP_C_TYPE_DOCUMENT, GcpCDocumentClass))

typedef struct _GcpCDocument GcpCDocument;
typedef struct _GcpCDocumentClass GcpCDocumentClass;
typedef struct _GcpCDocumentPrivate GcpCDocumentPrivate;

#define GCP_C_TYPE_TRANSLATION_UNIT (gcp_c_translation_unit_get_type ())
#define GCP_C_TRANSLATION_UNIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_C_TYPE_TRANSLATION_UNIT, GcpCTranslationUnit))
#define GCP_C_TRANSLATION_UNIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCP_C_TYPE_TRANSLATION_UNIT, GcpCTranslationUnitClass))
#define GCP_C_IS_TRANSLATION_UNIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_C_TYPE_TRANSLATION_UNIT))
#define GCP_C_IS_TRANSLATION_UNIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCP_C_TYPE_TRANSLATION_UNIT))
#define GCP_C_TRANSLATION_UNIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCP_C_TYPE_TRANSLATION_UNIT, GcpCTranslationUnitClass))

typedef struct _GcpCTranslationUnit GcpCTranslationUnit;
typedef struct _GcpCTranslationUnitClass GcpCTranslationUnitClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _gcp_c_translation_unit_unref0(var) ((var == NULL) ? NULL : (var = (gcp_c_translation_unit_unref (var), NULL)))
#define _g_mutex_free0(var) ((var == NULL) ? NULL : (var = (g_mutex_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _clang_disposeDiagnostic0(var) ((var == NULL) ? NULL : (var = (clang_disposeDiagnostic (var), NULL)))

#define GCP_C_DOCUMENT_TYPE_CURSOR_WRAPPER (gcp_c_document_cursor_wrapper_get_type ())
#define GCP_C_DOCUMENT_CURSOR_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_C_DOCUMENT_TYPE_CURSOR_WRAPPER, GcpCDocumentCursorWrapper))
#define GCP_C_DOCUMENT_CURSOR_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCP_C_DOCUMENT_TYPE_CURSOR_WRAPPER, GcpCDocumentCursorWrapperClass))
#define GCP_C_DOCUMENT_IS_CURSOR_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_C_DOCUMENT_TYPE_CURSOR_WRAPPER))
#define GCP_C_DOCUMENT_IS_CURSOR_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCP_C_DOCUMENT_TYPE_CURSOR_WRAPPER))
#define GCP_C_DOCUMENT_CURSOR_WRAPPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCP_C_DOCUMENT_TYPE_CURSOR_WRAPPER, GcpCDocumentCursorWrapperClass))

typedef struct _GcpCDocumentCursorWrapper GcpCDocumentCursorWrapper;
typedef struct _GcpCDocumentCursorWrapperClass GcpCDocumentCursorWrapperClass;

#define GCP_C_TYPE_SEMANTIC_VALUE (gcp_c_semantic_value_get_type ())
#define GCP_C_SEMANTIC_VALUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_C_TYPE_SEMANTIC_VALUE, GcpCSemanticValue))
#define GCP_C_SEMANTIC_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCP_C_TYPE_SEMANTIC_VALUE, GcpCSemanticValueClass))
#define GCP_C_IS_SEMANTIC_VALUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_C_TYPE_SEMANTIC_VALUE))
#define GCP_C_IS_SEMANTIC_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCP_C_TYPE_SEMANTIC_VALUE))
#define GCP_C_SEMANTIC_VALUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCP_C_TYPE_SEMANTIC_VALUE, GcpCSemanticValueClass))

typedef struct _GcpCSemanticValue GcpCSemanticValue;
typedef struct _GcpCSemanticValueClass GcpCSemanticValueClass;
typedef struct _Block1Data Block1Data;
#define _gcp_c_document_cursor_wrapper_unref0(var) ((var == NULL) ? NULL : (var = (gcp_c_document_cursor_wrapper_unref (var), NULL)))
typedef struct _GcpCDocumentCursorWrapperPrivate GcpCDocumentCursorWrapperPrivate;
typedef struct _GcpCDocumentParamSpecCursorWrapper GcpCDocumentParamSpecCursorWrapper;

struct _GcpCDocument {
	GcpDocument parent_instance;
	GcpCDocumentPrivate * priv;
};

struct _GcpCDocumentClass {
	GcpDocumentClass parent_class;
};

struct _GcpCDocumentPrivate {
	GcpDiagnosticTags* d_tags;
	GcpCTranslationUnit* d_tu;
	GcpSymbolBrowser* d_symbols;
	GcpSourceIndex* d_diagnostics;
	GMutex* d_diagnosticsLock;
	GcpSourceIndex* d_semantics;
	GMutex* d_semanticsLock;
};

struct _Block1Data {
	int _ref_count_;
	GcpCDocument * self;
	GcpSourceIndex* sems;
	GeeHashMap* semmap;
};

typedef void (*GcpCSemanticValueCursorMappedFunc) (CXCursor cursor, GcpCSemanticValue* val, void* user_data);
typedef void (*GcpCTranslationUnitWithTranslationUnitCallback) (void* tu, void* user_data);
struct _GcpCDocumentCursorWrapper {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GcpCDocumentCursorWrapperPrivate * priv;
	CXCursor cursor;
};

struct _GcpCDocumentCursorWrapperClass {
	GTypeClass parent_class;
	void (*finalize) (GcpCDocumentCursorWrapper *self);
};

struct _GcpCDocumentParamSpecCursorWrapper {
	GParamSpec parent_instance;
};


static gpointer gcp_c_document_parent_class = NULL;
static gpointer gcp_c_document_cursor_wrapper_parent_class = NULL;
static GType gcp_c_document_cursor_wrapper_type_id = 0;
static GcpSymbolBrowserSupportIface* gcp_c_document_gcp_symbol_browser_support_parent_iface = NULL;
static GcpDiagnosticSupportIface* gcp_c_document_gcp_diagnostic_support_parent_iface = NULL;
static GcpSemanticValueSupportIface* gcp_c_document_gcp_semantic_value_support_parent_iface = NULL;
static GType gcp_c_document_type_id = 0;

GType gcp_c_document_get_type (void) G_GNUC_CONST;
GType gcp_c_document_register_type (GTypeModule * module);
gpointer gcp_c_translation_unit_ref (gpointer instance);
void gcp_c_translation_unit_unref (gpointer instance);
GParamSpec* gcp_c_param_spec_translation_unit (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void gcp_c_value_set_translation_unit (GValue* value, gpointer v_object);
void gcp_c_value_take_translation_unit (GValue* value, gpointer v_object);
gpointer gcp_c_value_get_translation_unit (const GValue* value);
GType gcp_c_translation_unit_get_type (void) G_GNUC_CONST;
GType gcp_c_translation_unit_register_type (GTypeModule * module);
#define GCP_C_DOCUMENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GCP_C_TYPE_DOCUMENT, GcpCDocumentPrivate))
enum  {
	GCP_C_DOCUMENT_DUMMY_PROPERTY,
	GCP_C_DOCUMENT_SYMBOL_BROWSER,
	GCP_C_DOCUMENT_TRANSLATION_UNIT
};
GcpCDocument* gcp_c_document_new (GeditDocument* document);
GcpCDocument* gcp_c_document_construct (GType object_type, GeditDocument* document);
static void gcp_c_document_real_set_diagnostic_tags (GcpDiagnosticSupport* base, GcpDiagnosticTags* tags);
static GcpDiagnosticTags* gcp_c_document_real_get_diagnostic_tags (GcpDiagnosticSupport* base);
static GcpSourceIndex* gcp_c_document_real_begin_diagnostics (GcpDiagnosticSupport* base);
static void gcp_c_document_real_end_diagnostics (GcpDiagnosticSupport* base);
static GcpSourceIndex* gcp_c_document_real_begin_semantics (GcpSemanticValueSupport* base);
static void gcp_c_document_real_end_semantics (GcpSemanticValueSupport* base);
static void gcp_c_document_clip_location (GcpCDocument* self, GcpSourceLocation* location);
static void gcp_c_document_update_diagnostics (GcpCDocument* self, void* tu);
GcpDiagnosticSeverity gcp_c_translator_severity (enum CXDiagnosticSeverity severity);
GcpSourceLocation* gcp_c_translator_source_location (CXSourceLocation location);
GcpSourceRange* gcp_c_translator_source_range (CXSourceRange range);
static void _vala_GcpDiagnosticFixit_array_free (GcpDiagnosticFixit* array, gint array_length);
static void gcp_c_document_update_semantics (GcpCDocument* self, void* tu);
static gpointer gcp_c_document_cursor_wrapper_ref (gpointer instance);
static void gcp_c_document_cursor_wrapper_unref (gpointer instance);
static GParamSpec* gcp_c_document_param_spec_cursor_wrapper (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED;
static void gcp_c_document_value_set_cursor_wrapper (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static void gcp_c_document_value_take_cursor_wrapper (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static gpointer gcp_c_document_value_get_cursor_wrapper (const GValue* value) G_GNUC_UNUSED;
GType gcp_c_document_cursor_wrapper_get_type (void) G_GNUC_CONST;
GType gcp_c_document_cursor_wrapper_register_type (GTypeModule * module);
GType gcp_c_semantic_value_get_type (void) G_GNUC_CONST;
GType gcp_c_semantic_value_register_type (GTypeModule * module);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static guint gcp_c_document_cursor_wrapper_hash (GcpCDocumentCursorWrapper* self);
static guint _gcp_c_document_cursor_wrapper_hash_ghash_func (gconstpointer key);
static gboolean gcp_c_document_cursor_wrapper_equal (GcpCDocumentCursorWrapper* self, GcpCDocumentCursorWrapper* other);
GcpCSemanticValue* gcp_c_semantic_value_translate (CXCursor cursor, GFile* source, GcpCSemanticValueCursorMappedFunc mapped, void* mapped_target, GDestroyNotify mapped_target_destroy_notify);
static void __lambda8_ (Block1Data* _data1_, CXCursor cursor, GcpCSemanticValue* val);
static GcpCDocumentCursorWrapper* gcp_c_document_cursor_wrapper_new (CXCursor c);
static GcpCDocumentCursorWrapper* gcp_c_document_cursor_wrapper_construct (GType object_type, CXCursor c);
gboolean gcp_c_translator_is_reference (CXCursor cursor);
GcpCSemanticValue* gcp_c_semantic_value_new (CXCursor cursor);
GcpCSemanticValue* gcp_c_semantic_value_construct (GType object_type, CXCursor cursor);
void gcp_c_semantic_value_add_reference (GcpCSemanticValue* self, GcpCSemanticValue* val);
static void ___lambda8__gcp_csemantic_value_cursor_mapped_func (CXCursor cursor, GcpCSemanticValue* val, gpointer self);
static void gcp_c_document_on_tu_update (GcpCDocument* self);
void gcp_c_translation_unit_with_translation_unit (GcpCTranslationUnit* self, GcpCTranslationUnitWithTranslationUnitCallback callback, void* callback_target, GAsyncReadyCallback _callback_, gpointer _user_data_);
void gcp_c_translation_unit_with_translation_unit_finish (GcpCTranslationUnit* self, GAsyncResult* _res_);
static void __lambda9_ (GcpCDocument* self, void* tu);
static void ___lambda9__gcp_ctranslation_unit_with_translation_unit_callback (void* tu, gpointer self);
static void __lambda10_ (GcpCDocument* self, GObject* obj, GAsyncResult* res);
static void ___lambda10__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
GcpCTranslationUnit* gcp_c_document_get_translation_unit (GcpCDocument* self);
static GObject * gcp_c_document_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
GcpCTranslationUnit* gcp_c_translation_unit_new (void);
GcpCTranslationUnit* gcp_c_translation_unit_construct (GType object_type);
static void _gcp_c_document_on_tu_update_gcp_c_translation_unit_update (GcpCTranslationUnit* _sender, gpointer self);
enum  {
	GCP_C_DOCUMENT_CURSOR_WRAPPER_DUMMY_PROPERTY
};
static void gcp_c_document_cursor_wrapper_finalize (GcpCDocumentCursorWrapper* obj);
static void gcp_c_document_finalize (GObject* obj);
static void _vala_gcp_c_document_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


GcpCDocument* gcp_c_document_construct (GType object_type, GeditDocument* document) {
	GcpCDocument * self = NULL;
	GeditDocument* _tmp0_;
	g_return_val_if_fail (document != NULL, NULL);
	_tmp0_ = document;
	self = (GcpCDocument*) g_object_new (object_type, "document", _tmp0_, NULL);
	return self;
}


GcpCDocument* gcp_c_document_new (GeditDocument* document) {
	return gcp_c_document_construct (GCP_C_TYPE_DOCUMENT, document);
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static void gcp_c_document_real_set_diagnostic_tags (GcpDiagnosticSupport* base, GcpDiagnosticTags* tags) {
	GcpCDocument * self;
	GcpDiagnosticTags* _tmp0_;
	GcpDiagnosticTags* _tmp1_;
	self = (GcpCDocument*) base;
	g_return_if_fail (tags != NULL);
	_tmp0_ = tags;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->d_tags);
	self->priv->d_tags = _tmp1_;
}


static GcpDiagnosticTags* gcp_c_document_real_get_diagnostic_tags (GcpDiagnosticSupport* base) {
	GcpCDocument * self;
	GcpDiagnosticTags* result = NULL;
	GcpDiagnosticTags* _tmp0_;
	GcpDiagnosticTags* _tmp1_;
	self = (GcpCDocument*) base;
	_tmp0_ = self->priv->d_tags;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}


static GcpSourceIndex* gcp_c_document_real_begin_diagnostics (GcpDiagnosticSupport* base) {
	GcpCDocument * self;
	GcpSourceIndex* result = NULL;
	GMutex* _tmp0_;
	GcpSourceIndex* _tmp1_;
	GcpSourceIndex* _tmp2_;
	self = (GcpCDocument*) base;
	_tmp0_ = self->priv->d_diagnosticsLock;
	g_mutex_lock (_tmp0_);
	_tmp1_ = self->priv->d_diagnostics;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	result = _tmp2_;
	return result;
}


static void gcp_c_document_real_end_diagnostics (GcpDiagnosticSupport* base) {
	GcpCDocument * self;
	GMutex* _tmp0_;
	self = (GcpCDocument*) base;
	_tmp0_ = self->priv->d_diagnosticsLock;
	g_mutex_unlock (_tmp0_);
}


static GcpSourceIndex* gcp_c_document_real_begin_semantics (GcpSemanticValueSupport* base) {
	GcpCDocument * self;
	GcpSourceIndex* result = NULL;
	GMutex* _tmp0_;
	GcpSourceIndex* _tmp1_;
	GcpSourceIndex* _tmp2_;
	self = (GcpCDocument*) base;
	_tmp0_ = self->priv->d_semanticsLock;
	g_mutex_lock (_tmp0_);
	_tmp1_ = self->priv->d_semantics;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	result = _tmp2_;
	return result;
}


static void gcp_c_document_real_end_semantics (GcpSemanticValueSupport* base) {
	GcpCDocument * self;
	GMutex* _tmp0_;
	self = (GcpCDocument*) base;
	_tmp0_ = self->priv->d_semanticsLock;
	g_mutex_unlock (_tmp0_);
}


static void gcp_c_document_clip_location (GcpCDocument* self, GcpSourceLocation* location) {
	GcpSourceLocation* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	GeditDocument* _tmp3_;
	GeditDocument* _tmp4_;
	gint _tmp5_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (location != NULL);
	_tmp0_ = location;
	_tmp1_ = gcp_source_location_get_line (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gcp_document_get_document ((GcpDocument*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = gtk_text_buffer_get_line_count ((GtkTextBuffer*) _tmp4_);
	if (_tmp2_ > _tmp5_) {
		GcpSourceLocation* _tmp6_;
		GeditDocument* _tmp7_;
		GeditDocument* _tmp8_;
		gint _tmp9_ = 0;
		_tmp6_ = location;
		_tmp7_ = gcp_document_get_document ((GcpDocument*) self);
		_tmp8_ = _tmp7_;
		_tmp9_ = gtk_text_buffer_get_line_count ((GtkTextBuffer*) _tmp8_);
		gcp_source_location_set_line (_tmp6_, _tmp9_);
	}
}


static void _vala_GcpDiagnosticFixit_array_free (GcpDiagnosticFixit* array, gint array_length) {
	if (array != NULL) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			gcp_diagnostic_fixit_destroy (&array[i]);
		}
	}
	g_free (array);
}


static void gcp_c_document_update_diagnostics (GcpCDocument* self, void* tu) {
	GcpSourceIndex* _tmp0_;
	GcpSourceIndex* ndiag;
	void* _tmp1_;
	guint _tmp2_;
	guint _tmp3_;
	GMutex* _tmp181_;
	GcpSourceIndex* _tmp182_;
	GcpSourceIndex* _tmp183_;
	GMutex* _tmp184_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tu != NULL);
	_tmp0_ = gcp_source_index_new ();
	ndiag = _tmp0_;
	_tmp1_ = tu;
	_tmp2_ = clang_getNumDiagnostics (_tmp1_);
	_tmp3_ = _tmp2_;
	gcp_log_debug ("gcp-c-document.vala:153: New diagnostics: %u", _tmp3_);
	{
		guint i;
		i = (guint) 0;
		{
			gboolean _tmp4_;
			_tmp4_ = TRUE;
			while (TRUE) {
				gboolean _tmp5_;
				guint _tmp7_;
				void* _tmp8_;
				guint _tmp9_;
				guint _tmp10_;
				void* _tmp11_;
				guint _tmp12_;
				CXDiagnostic* _tmp13_ = NULL;
				CXDiagnostic* d;
				CXDiagnostic* _tmp14_;
				enum CXDiagnosticSeverity _tmp15_;
				enum CXDiagnosticSeverity _tmp16_;
				GcpDiagnosticSeverity _tmp17_ = 0;
				GcpDiagnosticSeverity severity;
				CXDiagnostic* _tmp18_;
				CXSourceLocation _tmp19_;
				CXSourceLocation _tmp20_;
				GcpSourceLocation* _tmp21_ = NULL;
				GcpSourceLocation* loc;
				gchar* _tmp22_ = NULL;
				GcpSourceLocation* _tmp23_;
				GFile* _tmp24_;
				GFile* _tmp25_;
				guint _tmp30_;
				const gchar* _tmp31_;
				gboolean _tmp32_ = FALSE;
				GcpSourceLocation* _tmp33_;
				GFile* _tmp34_;
				GFile* _tmp35_;
				gboolean _tmp42_;
				GcpSourceLocation* _tmp47_;
				GeeLinkedList* _tmp48_;
				GeeLinkedList* ranges;
				CXDiagnostic* _tmp100_;
				guint _tmp101_;
				guint _tmp102_;
				GcpDiagnosticFixit* _tmp103_ = NULL;
				GcpDiagnosticFixit* fixits;
				gint fixits_length1;
				gint _fixits_size_;
				GcpSourceIndex* _tmp167_;
				GcpDiagnosticSeverity _tmp168_;
				GcpSourceLocation* _tmp169_;
				GeeLinkedList* _tmp170_;
				gint _tmp171_ = 0;
				gpointer* _tmp172_ = NULL;
				GcpSourceRange** _tmp173_;
				gint _tmp173__length1;
				GcpDiagnosticFixit* _tmp174_;
				gint _tmp174__length1;
				CXDiagnostic* _tmp175_;
				CXString _tmp176_;
				CXString _tmp177_;
				const gchar* _tmp178_ = NULL;
				GcpDiagnostic* _tmp179_;
				GcpDiagnostic* _tmp180_;
				_tmp5_ = _tmp4_;
				if (!_tmp5_) {
					guint _tmp6_;
					_tmp6_ = i;
					i = _tmp6_ + 1;
				}
				_tmp4_ = FALSE;
				_tmp7_ = i;
				_tmp8_ = tu;
				_tmp9_ = clang_getNumDiagnostics (_tmp8_);
				_tmp10_ = _tmp9_;
				if (!(_tmp7_ < _tmp10_)) {
					break;
				}
				_tmp11_ = tu;
				_tmp12_ = i;
				_tmp13_ = clang_getDiagnostic (_tmp11_, _tmp12_);
				d = _tmp13_;
				_tmp14_ = d;
				_tmp15_ = clang_getDiagnosticSeverity (_tmp14_);
				_tmp16_ = _tmp15_;
				_tmp17_ = gcp_c_translator_severity (_tmp16_);
				severity = _tmp17_;
				_tmp18_ = d;
				_tmp19_ = clang_getDiagnosticLocation (_tmp18_);
				_tmp20_ = _tmp19_;
				_tmp21_ = gcp_c_translator_source_location (_tmp20_);
				loc = _tmp21_;
				_tmp23_ = loc;
				_tmp24_ = gcp_source_location_get_file (_tmp23_);
				_tmp25_ = _tmp24_;
				if (_tmp25_ == NULL) {
					_g_free0 (_tmp22_);
					_tmp22_ = NULL;
				} else {
					GcpSourceLocation* _tmp26_;
					GFile* _tmp27_;
					GFile* _tmp28_;
					gchar* _tmp29_ = NULL;
					_tmp26_ = loc;
					_tmp27_ = gcp_source_location_get_file (_tmp26_);
					_tmp28_ = _tmp27_;
					_tmp29_ = g_file_get_path (_tmp28_);
					_g_free0 (_tmp22_);
					_tmp22_ = _tmp29_;
				}
				_tmp30_ = i;
				_tmp31_ = _tmp22_;
				gcp_log_debug ("gcp-c-document.vala:163: Diagnostic location [%u]: %s", _tmp30_, _tmp31_);
				_tmp33_ = loc;
				_tmp34_ = gcp_source_location_get_file (_tmp33_);
				_tmp35_ = _tmp34_;
				if (_tmp35_ == NULL) {
					_tmp32_ = TRUE;
				} else {
					GcpSourceLocation* _tmp36_;
					GFile* _tmp37_;
					GFile* _tmp38_;
					GFile* _tmp39_;
					GFile* _tmp40_;
					gboolean _tmp41_ = FALSE;
					_tmp36_ = loc;
					_tmp37_ = gcp_source_location_get_file (_tmp36_);
					_tmp38_ = _tmp37_;
					_tmp39_ = gcp_document_get_location ((GcpDocument*) self);
					_tmp40_ = _tmp39_;
					_tmp41_ = g_file_equal (_tmp38_, _tmp40_);
					_tmp32_ = !_tmp41_;
				}
				_tmp42_ = _tmp32_;
				if (_tmp42_) {
					CXDiagnostic* _tmp43_;
					CXString _tmp44_;
					CXString _tmp45_;
					const gchar* _tmp46_ = NULL;
					_tmp43_ = d;
					_tmp44_ = clang_getDiagnosticSpelling (_tmp43_);
					_tmp45_ = _tmp44_;
					_tmp46_ = clang_getCString (_tmp45_);
					gcp_log_debug ("gcp-c-document.vala:167: Diagnostic not for this file: %s", _tmp46_);
					_g_free0 (_tmp22_);
					_g_object_unref0 (loc);
					_clang_disposeDiagnostic0 (d);
					continue;
				}
				_tmp47_ = loc;
				gcp_c_document_clip_location (self, _tmp47_);
				_tmp48_ = gee_linked_list_new (GCP_TYPE_SOURCE_RANGE, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
				ranges = _tmp48_;
				{
					guint j;
					j = (guint) 0;
					{
						gboolean _tmp49_;
						_tmp49_ = TRUE;
						while (TRUE) {
							gboolean _tmp50_;
							guint _tmp52_;
							CXDiagnostic* _tmp53_;
							guint _tmp54_;
							guint _tmp55_;
							CXDiagnostic* _tmp56_;
							guint _tmp57_;
							CXSourceRange _tmp58_ = {0};
							GcpSourceRange* _tmp59_ = NULL;
							GcpSourceRange* range;
							gboolean _tmp60_ = FALSE;
							gboolean _tmp61_ = FALSE;
							gboolean _tmp62_ = FALSE;
							GcpSourceRange* _tmp63_;
							GcpSourceLocation* _tmp64_;
							GcpSourceLocation* _tmp65_;
							GFile* _tmp66_;
							GFile* _tmp67_;
							gboolean _tmp73_;
							gboolean _tmp82_;
							gboolean _tmp91_;
							_tmp50_ = _tmp49_;
							if (!_tmp50_) {
								guint _tmp51_;
								_tmp51_ = j;
								j = _tmp51_ + 1;
							}
							_tmp49_ = FALSE;
							_tmp52_ = j;
							_tmp53_ = d;
							_tmp54_ = clang_getDiagnosticNumRanges (_tmp53_);
							_tmp55_ = _tmp54_;
							if (!(_tmp52_ < _tmp55_)) {
								break;
							}
							_tmp56_ = d;
							_tmp57_ = j;
							_tmp58_ = clang_getDiagnosticRange (_tmp56_, _tmp57_);
							_tmp59_ = gcp_c_translator_source_range (_tmp58_);
							range = _tmp59_;
							_tmp63_ = range;
							_tmp64_ = gcp_source_range_get_start (_tmp63_);
							_tmp65_ = _tmp64_;
							_tmp66_ = gcp_source_location_get_file (_tmp65_);
							_tmp67_ = _tmp66_;
							if (_tmp67_ != NULL) {
								GcpSourceRange* _tmp68_;
								GcpSourceLocation* _tmp69_;
								GcpSourceLocation* _tmp70_;
								GFile* _tmp71_;
								GFile* _tmp72_;
								_tmp68_ = range;
								_tmp69_ = gcp_source_range_get_end (_tmp68_);
								_tmp70_ = _tmp69_;
								_tmp71_ = gcp_source_location_get_file (_tmp70_);
								_tmp72_ = _tmp71_;
								_tmp62_ = _tmp72_ != NULL;
							} else {
								_tmp62_ = FALSE;
							}
							_tmp73_ = _tmp62_;
							if (_tmp73_) {
								GcpSourceRange* _tmp74_;
								GcpSourceLocation* _tmp75_;
								GcpSourceLocation* _tmp76_;
								GFile* _tmp77_;
								GFile* _tmp78_;
								GFile* _tmp79_;
								GFile* _tmp80_;
								gboolean _tmp81_ = FALSE;
								_tmp74_ = range;
								_tmp75_ = gcp_source_range_get_start (_tmp74_);
								_tmp76_ = _tmp75_;
								_tmp77_ = gcp_source_location_get_file (_tmp76_);
								_tmp78_ = _tmp77_;
								_tmp79_ = gcp_document_get_location ((GcpDocument*) self);
								_tmp80_ = _tmp79_;
								_tmp81_ = g_file_equal (_tmp78_, _tmp80_);
								_tmp61_ = _tmp81_;
							} else {
								_tmp61_ = FALSE;
							}
							_tmp82_ = _tmp61_;
							if (_tmp82_) {
								GcpSourceRange* _tmp83_;
								GcpSourceLocation* _tmp84_;
								GcpSourceLocation* _tmp85_;
								GFile* _tmp86_;
								GFile* _tmp87_;
								GFile* _tmp88_;
								GFile* _tmp89_;
								gboolean _tmp90_ = FALSE;
								_tmp83_ = range;
								_tmp84_ = gcp_source_range_get_end (_tmp83_);
								_tmp85_ = _tmp84_;
								_tmp86_ = gcp_source_location_get_file (_tmp85_);
								_tmp87_ = _tmp86_;
								_tmp88_ = gcp_document_get_location ((GcpDocument*) self);
								_tmp89_ = _tmp88_;
								_tmp90_ = g_file_equal (_tmp87_, _tmp89_);
								_tmp60_ = _tmp90_;
							} else {
								_tmp60_ = FALSE;
							}
							_tmp91_ = _tmp60_;
							if (_tmp91_) {
								GcpSourceRange* _tmp92_;
								GcpSourceLocation* _tmp93_;
								GcpSourceLocation* _tmp94_;
								GcpSourceRange* _tmp95_;
								GcpSourceLocation* _tmp96_;
								GcpSourceLocation* _tmp97_;
								GeeLinkedList* _tmp98_;
								GcpSourceRange* _tmp99_;
								_tmp92_ = range;
								_tmp93_ = gcp_source_range_get_start (_tmp92_);
								_tmp94_ = _tmp93_;
								gcp_c_document_clip_location (self, _tmp94_);
								_tmp95_ = range;
								_tmp96_ = gcp_source_range_get_end (_tmp95_);
								_tmp97_ = _tmp96_;
								gcp_c_document_clip_location (self, _tmp97_);
								_tmp98_ = ranges;
								_tmp99_ = range;
								gee_abstract_collection_add ((GeeAbstractCollection*) _tmp98_, _tmp99_);
							}
							_g_object_unref0 (range);
						}
					}
				}
				_tmp100_ = d;
				_tmp101_ = clang_getDiagnosticNumFixIts (_tmp100_);
				_tmp102_ = _tmp101_;
				_tmp103_ = g_new0 (GcpDiagnosticFixit, _tmp102_);
				fixits = _tmp103_;
				fixits_length1 = _tmp102_;
				_fixits_size_ = fixits_length1;
				{
					guint j;
					j = (guint) 0;
					{
						gboolean _tmp104_;
						_tmp104_ = TRUE;
						while (TRUE) {
							gboolean _tmp105_;
							guint _tmp107_;
							CXDiagnostic* _tmp108_;
							guint _tmp109_;
							guint _tmp110_;
							CXSourceRange range = {0};
							CXDiagnostic* _tmp111_;
							guint _tmp112_;
							CXSourceRange _tmp113_ = {0};
							CXString _tmp114_ = {0};
							CXString _tmp115_;
							const gchar* _tmp116_ = NULL;
							gchar* _tmp117_;
							gchar* _tmp118_;
							gchar* repl;
							CXSourceRange _tmp119_;
							GcpSourceRange* _tmp120_ = NULL;
							GcpSourceRange* r;
							gboolean _tmp121_ = FALSE;
							gboolean _tmp122_ = FALSE;
							gboolean _tmp123_ = FALSE;
							GcpSourceRange* _tmp124_;
							GcpSourceLocation* _tmp125_;
							GcpSourceLocation* _tmp126_;
							GFile* _tmp127_;
							GFile* _tmp128_;
							gboolean _tmp134_;
							gboolean _tmp143_;
							gboolean _tmp152_;
							_tmp105_ = _tmp104_;
							if (!_tmp105_) {
								guint _tmp106_;
								_tmp106_ = j;
								j = _tmp106_ + 1;
							}
							_tmp104_ = FALSE;
							_tmp107_ = j;
							_tmp108_ = d;
							_tmp109_ = clang_getDiagnosticNumFixIts (_tmp108_);
							_tmp110_ = _tmp109_;
							if (!(_tmp107_ < _tmp110_)) {
								break;
							}
							_tmp111_ = d;
							_tmp112_ = j;
							_tmp114_ = clang_getDiagnosticFixIt (_tmp111_, _tmp112_, &_tmp113_);
							range = _tmp113_;
							_tmp115_ = _tmp114_;
							_tmp116_ = clang_getCString (_tmp115_);
							_tmp117_ = g_strdup (_tmp116_);
							_tmp118_ = _tmp117_;
							clang_disposeString (_tmp115_);
							repl = _tmp118_;
							_tmp119_ = range;
							_tmp120_ = gcp_c_translator_source_range (_tmp119_);
							r = _tmp120_;
							_tmp124_ = r;
							_tmp125_ = gcp_source_range_get_start (_tmp124_);
							_tmp126_ = _tmp125_;
							_tmp127_ = gcp_source_location_get_file (_tmp126_);
							_tmp128_ = _tmp127_;
							if (_tmp128_ != NULL) {
								GcpSourceRange* _tmp129_;
								GcpSourceLocation* _tmp130_;
								GcpSourceLocation* _tmp131_;
								GFile* _tmp132_;
								GFile* _tmp133_;
								_tmp129_ = r;
								_tmp130_ = gcp_source_range_get_end (_tmp129_);
								_tmp131_ = _tmp130_;
								_tmp132_ = gcp_source_location_get_file (_tmp131_);
								_tmp133_ = _tmp132_;
								_tmp123_ = _tmp133_ != NULL;
							} else {
								_tmp123_ = FALSE;
							}
							_tmp134_ = _tmp123_;
							if (_tmp134_) {
								GcpSourceRange* _tmp135_;
								GcpSourceLocation* _tmp136_;
								GcpSourceLocation* _tmp137_;
								GFile* _tmp138_;
								GFile* _tmp139_;
								GFile* _tmp140_;
								GFile* _tmp141_;
								gboolean _tmp142_ = FALSE;
								_tmp135_ = r;
								_tmp136_ = gcp_source_range_get_start (_tmp135_);
								_tmp137_ = _tmp136_;
								_tmp138_ = gcp_source_location_get_file (_tmp137_);
								_tmp139_ = _tmp138_;
								_tmp140_ = gcp_document_get_location ((GcpDocument*) self);
								_tmp141_ = _tmp140_;
								_tmp142_ = g_file_equal (_tmp139_, _tmp141_);
								_tmp122_ = _tmp142_;
							} else {
								_tmp122_ = FALSE;
							}
							_tmp143_ = _tmp122_;
							if (_tmp143_) {
								GcpSourceRange* _tmp144_;
								GcpSourceLocation* _tmp145_;
								GcpSourceLocation* _tmp146_;
								GFile* _tmp147_;
								GFile* _tmp148_;
								GFile* _tmp149_;
								GFile* _tmp150_;
								gboolean _tmp151_ = FALSE;
								_tmp144_ = r;
								_tmp145_ = gcp_source_range_get_end (_tmp144_);
								_tmp146_ = _tmp145_;
								_tmp147_ = gcp_source_location_get_file (_tmp146_);
								_tmp148_ = _tmp147_;
								_tmp149_ = gcp_document_get_location ((GcpDocument*) self);
								_tmp150_ = _tmp149_;
								_tmp151_ = g_file_equal (_tmp148_, _tmp150_);
								_tmp121_ = _tmp151_;
							} else {
								_tmp121_ = FALSE;
							}
							_tmp152_ = _tmp121_;
							if (_tmp152_) {
								GcpSourceRange* _tmp153_;
								GcpSourceLocation* _tmp154_;
								GcpSourceLocation* _tmp155_;
								GcpSourceRange* _tmp156_;
								GcpSourceLocation* _tmp157_;
								GcpSourceLocation* _tmp158_;
								GcpDiagnosticFixit* _tmp159_;
								gint _tmp159__length1;
								guint _tmp160_;
								GcpSourceRange* _tmp161_;
								GcpSourceRange* _tmp162_;
								const gchar* _tmp163_;
								gchar* _tmp164_;
								GcpDiagnosticFixit _tmp165_ = {0};
								GcpDiagnosticFixit _tmp166_;
								_tmp153_ = r;
								_tmp154_ = gcp_source_range_get_start (_tmp153_);
								_tmp155_ = _tmp154_;
								gcp_c_document_clip_location (self, _tmp155_);
								_tmp156_ = r;
								_tmp157_ = gcp_source_range_get_end (_tmp156_);
								_tmp158_ = _tmp157_;
								gcp_c_document_clip_location (self, _tmp158_);
								_tmp159_ = fixits;
								_tmp159__length1 = fixits_length1;
								_tmp160_ = j;
								_tmp161_ = r;
								_tmp162_ = _g_object_ref0 (_tmp161_);
								_tmp163_ = repl;
								_tmp164_ = g_strdup (_tmp163_);
								_g_object_unref0 (_tmp165_.range);
								_tmp165_.range = _tmp162_;
								_g_free0 (_tmp165_.replacement);
								_tmp165_.replacement = _tmp164_;
								gcp_diagnostic_fixit_destroy (&_tmp159_[_tmp160_]);
								_tmp159_[_tmp160_] = _tmp165_;
								_tmp166_ = _tmp159_[_tmp160_];
							}
							_g_object_unref0 (r);
							_g_free0 (repl);
						}
					}
				}
				_tmp167_ = ndiag;
				_tmp168_ = severity;
				_tmp169_ = loc;
				_tmp170_ = ranges;
				_tmp172_ = gee_abstract_collection_to_array ((GeeAbstractCollection*) _tmp170_, &_tmp171_);
				_tmp173_ = _tmp172_;
				_tmp173__length1 = _tmp171_;
				_tmp174_ = fixits;
				_tmp174__length1 = fixits_length1;
				_tmp175_ = d;
				_tmp176_ = clang_getDiagnosticSpelling (_tmp175_);
				_tmp177_ = _tmp176_;
				_tmp178_ = clang_getCString (_tmp177_);
				_tmp179_ = gcp_diagnostic_new (_tmp168_, _tmp169_, _tmp173_, _tmp171_, _tmp174_, _tmp174__length1, _tmp178_);
				_tmp180_ = _tmp179_;
				gcp_source_index_add (_tmp167_, (GcpSourceRangeSupport*) _tmp180_);
				_g_object_unref0 (_tmp180_);
				_tmp173_ = (_vala_array_free (_tmp173_, _tmp173__length1, (GDestroyNotify) g_object_unref), NULL);
				fixits = (_vala_GcpDiagnosticFixit_array_free (fixits, fixits_length1), NULL);
				_g_object_unref0 (ranges);
				_g_free0 (_tmp22_);
				_g_object_unref0 (loc);
				_clang_disposeDiagnostic0 (d);
			}
		}
	}
	_tmp181_ = self->priv->d_diagnosticsLock;
	g_mutex_lock (_tmp181_);
	_tmp182_ = ndiag;
	_tmp183_ = _g_object_ref0 (_tmp182_);
	_g_object_unref0 (self->priv->d_diagnostics);
	self->priv->d_diagnostics = _tmp183_;
	_tmp184_ = self->priv->d_diagnosticsLock;
	g_mutex_unlock (_tmp184_);
	_g_object_unref0 (ndiag);
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}


static void block1_data_unref (void * _userdata_) {
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		GcpCDocument * self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->semmap);
		_g_object_unref0 (_data1_->sems);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}


static guint _gcp_c_document_cursor_wrapper_hash_ghash_func (gconstpointer key) {
	guint result;
	result = gcp_c_document_cursor_wrapper_hash (key);
	return result;
}


static void __lambda8_ (Block1Data* _data1_, CXCursor cursor, GcpCSemanticValue* val) {
	GcpCDocument * self;
	GcpCSemanticValue* _tmp0_;
	CXCursor _tmp1_;
	GcpCDocumentCursorWrapper* _tmp2_;
	GcpCDocumentCursorWrapper* _tmp3_;
	GcpCSemanticValue* _tmp4_;
	CXCursor _tmp5_;
	gboolean _tmp6_ = FALSE;
	self = _data1_->self;
	g_return_if_fail (val != NULL);
	_tmp0_ = val;
	gcp_source_index_add (_data1_->sems, (GcpSourceRangeSupport*) _tmp0_);
	_tmp1_ = cursor;
	_tmp2_ = gcp_c_document_cursor_wrapper_new (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = val;
	gee_abstract_map_set ((GeeAbstractMap*) _data1_->semmap, _tmp3_, _tmp4_);
	_gcp_c_document_cursor_wrapper_unref0 (_tmp3_);
	_tmp5_ = cursor;
	_tmp6_ = gcp_c_translator_is_reference (_tmp5_);
	if (_tmp6_) {
		CXCursor _tmp7_ = {0};
		GcpCDocumentCursorWrapper* _tmp8_;
		GcpCDocumentCursorWrapper* wrapper;
		GcpCDocumentCursorWrapper* _tmp9_;
		gboolean _tmp10_ = FALSE;
		GcpCDocumentCursorWrapper* _tmp16_;
		gpointer _tmp17_ = NULL;
		GcpCSemanticValue* rr;
		GcpCSemanticValue* _tmp32_;
		GcpCSemanticValue* _tmp33_;
		GcpCSemanticValue* _tmp34_;
		GcpCSemanticValue* _tmp35_;
		_tmp7_ = clang_getCursorReferenced (cursor);
		_tmp8_ = gcp_c_document_cursor_wrapper_new (_tmp7_);
		wrapper = _tmp8_;
		_tmp9_ = wrapper;
		_tmp10_ = gee_abstract_map_has_key ((GeeAbstractMap*) _data1_->semmap, _tmp9_);
		if (!_tmp10_) {
			CXCursor _tmp11_ = {0};
			GcpCSemanticValue* _tmp12_;
			GcpCSemanticValue* refval;
			GcpCDocumentCursorWrapper* _tmp13_;
			GcpCSemanticValue* _tmp14_;
			GcpCSemanticValue* _tmp15_;
			_tmp11_ = clang_getCursorReferenced (cursor);
			_tmp12_ = gcp_c_semantic_value_new (_tmp11_);
			refval = _tmp12_;
			_tmp13_ = wrapper;
			_tmp14_ = refval;
			gee_abstract_map_set ((GeeAbstractMap*) _data1_->semmap, _tmp13_, _tmp14_);
			_tmp15_ = refval;
			gcp_source_index_add (_data1_->sems, (GcpSourceRangeSupport*) _tmp15_);
			_g_object_unref0 (refval);
		}
		_tmp16_ = wrapper;
		_tmp17_ = gee_abstract_map_get ((GeeAbstractMap*) _data1_->semmap, _tmp16_);
		rr = (GcpCSemanticValue*) _tmp17_;
		{
			gint i;
			i = 0;
			{
				gboolean _tmp18_;
				_tmp18_ = TRUE;
				while (TRUE) {
					gboolean _tmp19_;
					gint _tmp21_;
					GcpCSemanticValue* _tmp22_;
					gint _tmp23_;
					gint _tmp24_;
					GcpCSemanticValue* _tmp25_;
					gint _tmp26_;
					GcpSemanticValue* _tmp27_ = NULL;
					GcpCSemanticValue* mr;
					GcpCSemanticValue* _tmp28_;
					GcpCSemanticValue* _tmp29_;
					GcpCSemanticValue* _tmp30_;
					GcpCSemanticValue* _tmp31_;
					_tmp19_ = _tmp18_;
					if (!_tmp19_) {
						gint _tmp20_;
						_tmp20_ = i;
						i = _tmp20_ + 1;
					}
					_tmp18_ = FALSE;
					_tmp21_ = i;
					_tmp22_ = rr;
					_tmp23_ = gcp_semantic_value_get_num_references ((GcpSemanticValue*) _tmp22_);
					_tmp24_ = _tmp23_;
					if (!(_tmp21_ < _tmp24_)) {
						break;
					}
					_tmp25_ = rr;
					_tmp26_ = i;
					_tmp27_ = gcp_semantic_value_reference ((GcpSemanticValue*) _tmp25_, _tmp26_);
					mr = G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, GCP_C_TYPE_SEMANTIC_VALUE, GcpCSemanticValue);
					_tmp28_ = val;
					_tmp29_ = mr;
					gcp_c_semantic_value_add_reference (_tmp28_, _tmp29_);
					_tmp30_ = mr;
					_tmp31_ = val;
					gcp_c_semantic_value_add_reference (_tmp30_, _tmp31_);
					_g_object_unref0 (mr);
				}
			}
		}
		_tmp32_ = rr;
		_tmp33_ = val;
		gcp_c_semantic_value_add_reference (_tmp32_, _tmp33_);
		_tmp34_ = val;
		_tmp35_ = rr;
		gcp_c_semantic_value_add_reference (_tmp34_, _tmp35_);
		_g_object_unref0 (rr);
		_gcp_c_document_cursor_wrapper_unref0 (wrapper);
	}
}


static void ___lambda8__gcp_csemantic_value_cursor_mapped_func (CXCursor cursor, GcpCSemanticValue* val, gpointer self) {
	__lambda8_ (self, cursor, val);
}


static void gcp_c_document_update_semantics (GcpCDocument* self, void* tu) {
	Block1Data* _data1_;
	GcpSourceIndex* _tmp0_;
	GeeHashMap* _tmp1_;
	void* _tmp2_;
	CXCursor _tmp3_;
	CXCursor _tmp4_;
	GFile* _tmp5_;
	GFile* _tmp6_;
	GcpCSemanticValue* _tmp7_ = NULL;
	GcpCSemanticValue* _tmp8_;
	GMutex* _tmp9_;
	GcpSourceIndex* _tmp10_;
	GMutex* _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tu != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = gcp_source_index_new ();
	_data1_->sems = _tmp0_;
	_tmp1_ = gee_hash_map_new (GCP_C_DOCUMENT_TYPE_CURSOR_WRAPPER, (GBoxedCopyFunc) gcp_c_document_cursor_wrapper_ref, gcp_c_document_cursor_wrapper_unref, GCP_C_TYPE_SEMANTIC_VALUE, (GBoxedCopyFunc) g_object_ref, g_object_unref, _gcp_c_document_cursor_wrapper_hash_ghash_func, (GEqualFunc) gcp_c_document_cursor_wrapper_equal, NULL);
	_g_object_unref0 (_data1_->semmap);
	_data1_->semmap = _tmp1_;
	_tmp2_ = tu;
	_tmp3_ = clang_getTranslationUnitCursor (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = gcp_document_get_location ((GcpDocument*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = gcp_c_semantic_value_translate (_tmp4_, _tmp6_, ___lambda8__gcp_csemantic_value_cursor_mapped_func, block1_data_ref (_data1_), block1_data_unref);
	_tmp8_ = _tmp7_;
	_g_object_unref0 (_tmp8_);
	_tmp9_ = self->priv->d_semanticsLock;
	g_mutex_lock (_tmp9_);
	_tmp10_ = _g_object_ref0 (_data1_->sems);
	_g_object_unref0 (self->priv->d_semantics);
	self->priv->d_semantics = _tmp10_;
	_tmp11_ = self->priv->d_semanticsLock;
	g_mutex_unlock (_tmp11_);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}


static void __lambda9_ (GcpCDocument* self, void* tu) {
	void* _tmp0_;
	void* _tmp1_;
	g_return_if_fail (tu != NULL);
	_tmp0_ = tu;
	gcp_c_document_update_diagnostics (self, _tmp0_);
	_tmp1_ = tu;
	gcp_c_document_update_semantics (self, _tmp1_);
}


static void ___lambda9__gcp_ctranslation_unit_with_translation_unit_callback (void* tu, gpointer self) {
	__lambda9_ (self, tu);
}


static void __lambda10_ (GcpCDocument* self, GObject* obj, GAsyncResult* res) {
	GcpCTranslationUnit* _tmp0_;
	GAsyncResult* _tmp1_;
	g_return_if_fail (res != NULL);
	_tmp0_ = self->priv->d_tu;
	_tmp1_ = res;
	gcp_c_translation_unit_with_translation_unit_finish (_tmp0_, _tmp1_);
	g_signal_emit_by_name ((GcpDiagnosticSupport*) self, "diagnostics-updated");
	g_signal_emit_by_name ((GcpSemanticValueSupport*) self, "semantic-values-updated");
}


static void ___lambda10__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	__lambda10_ (self, source_object, res);
	g_object_unref (self);
}


static void gcp_c_document_on_tu_update (GcpCDocument* self) {
	GcpCTranslationUnit* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_tu;
	gcp_c_translation_unit_with_translation_unit (_tmp0_, ___lambda9__gcp_ctranslation_unit_with_translation_unit_callback, self, ___lambda10__gasync_ready_callback, g_object_ref (self));
}


static GcpSymbolBrowser* gcp_c_document_real_get_symbol_browser (GcpSymbolBrowserSupport* base) {
	GcpSymbolBrowser* result;
	GcpCDocument* self;
	GcpSymbolBrowser* _tmp0_;
	self = (GcpCDocument*) base;
	_tmp0_ = self->priv->d_symbols;
	result = _tmp0_;
	return result;
}


GcpCTranslationUnit* gcp_c_document_get_translation_unit (GcpCDocument* self) {
	GcpCTranslationUnit* result;
	GcpCTranslationUnit* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_tu;
	result = _tmp0_;
	return result;
}


static void _gcp_c_document_on_tu_update_gcp_c_translation_unit_update (GcpCTranslationUnit* _sender, gpointer self) {
	gcp_c_document_on_tu_update (self);
}


static GObject * gcp_c_document_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	GcpCDocument * self;
	GcpCTranslationUnit* _tmp0_;
	GcpSymbolBrowser* _tmp1_;
	GcpSourceIndex* _tmp2_;
	GMutex* _tmp3_;
	GcpSourceIndex* _tmp4_;
	GMutex* _tmp5_;
	GcpCTranslationUnit* _tmp6_;
	parent_class = G_OBJECT_CLASS (gcp_c_document_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GCP_C_TYPE_DOCUMENT, GcpCDocument);
	_tmp0_ = gcp_c_translation_unit_new ();
	_gcp_c_translation_unit_unref0 (self->priv->d_tu);
	self->priv->d_tu = _tmp0_;
	_tmp1_ = gcp_symbol_browser_new ();
	_g_object_unref0 (self->priv->d_symbols);
	self->priv->d_symbols = _tmp1_;
	_tmp2_ = gcp_source_index_new ();
	_g_object_unref0 (self->priv->d_diagnostics);
	self->priv->d_diagnostics = _tmp2_;
	_tmp3_ = g_mutex_new ();
	_g_mutex_free0 (self->priv->d_diagnosticsLock);
	self->priv->d_diagnosticsLock = _tmp3_;
	_tmp4_ = gcp_source_index_new ();
	_g_object_unref0 (self->priv->d_semantics);
	self->priv->d_semantics = _tmp4_;
	_tmp5_ = g_mutex_new ();
	_g_mutex_free0 (self->priv->d_semanticsLock);
	self->priv->d_semanticsLock = _tmp5_;
	_tmp6_ = self->priv->d_tu;
	g_signal_connect_object (_tmp6_, "update", (GCallback) _gcp_c_document_on_tu_update_gcp_c_translation_unit_update, self, 0);
	return obj;
}


static GcpCDocumentCursorWrapper* gcp_c_document_cursor_wrapper_construct (GType object_type, CXCursor c) {
	GcpCDocumentCursorWrapper* self = NULL;
	CXCursor _tmp0_;
	self = (GcpCDocumentCursorWrapper*) g_type_create_instance (object_type);
	_tmp0_ = c;
	self->cursor = _tmp0_;
	return self;
}


static GcpCDocumentCursorWrapper* gcp_c_document_cursor_wrapper_new (CXCursor c) {
	return gcp_c_document_cursor_wrapper_construct (GCP_C_DOCUMENT_TYPE_CURSOR_WRAPPER, c);
}


static gboolean gcp_c_document_cursor_wrapper_equal (GcpCDocumentCursorWrapper* self, GcpCDocumentCursorWrapper* other) {
	gboolean result = FALSE;
	GcpCDocumentCursorWrapper* _tmp0_;
	CXCursor _tmp1_;
	gboolean _tmp2_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (other != NULL, FALSE);
	_tmp0_ = other;
	_tmp1_ = _tmp0_->cursor;
	_tmp2_ = clang_equalCursors (self->cursor, _tmp1_);
	result = _tmp2_;
	return result;
}


static guint gcp_c_document_cursor_wrapper_hash (GcpCDocumentCursorWrapper* self) {
	guint result = 0U;
	guint sline = 0U;
	guint scolumn = 0U;
	CXSourceRange _tmp0_ = {0};
	CXSourceLocation _tmp1_ = {0};
	guint _tmp2_ = 0U;
	guint _tmp3_ = 0U;
	guint eline = 0U;
	guint ecolumn = 0U;
	CXSourceRange _tmp4_ = {0};
	CXSourceLocation _tmp5_ = {0};
	guint _tmp6_ = 0U;
	guint _tmp7_ = 0U;
	guint cmp1;
	guint cmp2;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = clang_getCursorExtent (self->cursor);
	_tmp1_ = clang_getRangeStart (_tmp0_);
	clang_getInstantiationLocation (_tmp1_, NULL, &_tmp2_, &_tmp3_, NULL);
	sline = _tmp2_;
	scolumn = _tmp3_;
	_tmp4_ = clang_getCursorExtent (self->cursor);
	_tmp5_ = clang_getRangeEnd (_tmp4_);
	clang_getInstantiationLocation (_tmp5_, NULL, &_tmp6_, &_tmp7_, NULL);
	eline = _tmp6_;
	ecolumn = _tmp7_;
	cmp1 = (guint) (((0.5 * (sline + scolumn)) * ((sline + scolumn) + 1)) + scolumn);
	cmp2 = (guint) (((0.5 * (eline + ecolumn)) * ((eline + ecolumn) + 1)) + ecolumn);
	result = (guint) (((0.5 * (cmp1 + cmp2)) * ((cmp1 + cmp2) + 1)) + cmp2);
	return result;
}


static void gcp_c_document_value_cursor_wrapper_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void gcp_c_document_value_cursor_wrapper_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		gcp_c_document_cursor_wrapper_unref (value->data[0].v_pointer);
	}
}


static void gcp_c_document_value_cursor_wrapper_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = gcp_c_document_cursor_wrapper_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer gcp_c_document_value_cursor_wrapper_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* gcp_c_document_value_cursor_wrapper_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		GcpCDocumentCursorWrapper* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = gcp_c_document_cursor_wrapper_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* gcp_c_document_value_cursor_wrapper_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	GcpCDocumentCursorWrapper** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = gcp_c_document_cursor_wrapper_ref (value->data[0].v_pointer);
	}
	return NULL;
}


static GParamSpec* gcp_c_document_param_spec_cursor_wrapper (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	GcpCDocumentParamSpecCursorWrapper* spec;
	g_return_val_if_fail (g_type_is_a (object_type, GCP_C_DOCUMENT_TYPE_CURSOR_WRAPPER), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


static gpointer gcp_c_document_value_get_cursor_wrapper (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GCP_C_DOCUMENT_TYPE_CURSOR_WRAPPER), NULL);
	return value->data[0].v_pointer;
}


static void gcp_c_document_value_set_cursor_wrapper (GValue* value, gpointer v_object) {
	GcpCDocumentCursorWrapper* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GCP_C_DOCUMENT_TYPE_CURSOR_WRAPPER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GCP_C_DOCUMENT_TYPE_CURSOR_WRAPPER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		gcp_c_document_cursor_wrapper_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gcp_c_document_cursor_wrapper_unref (old);
	}
}


static void gcp_c_document_value_take_cursor_wrapper (GValue* value, gpointer v_object) {
	GcpCDocumentCursorWrapper* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GCP_C_DOCUMENT_TYPE_CURSOR_WRAPPER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GCP_C_DOCUMENT_TYPE_CURSOR_WRAPPER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gcp_c_document_cursor_wrapper_unref (old);
	}
}


static void gcp_c_document_cursor_wrapper_class_init (GcpCDocumentCursorWrapperClass * klass) {
	gcp_c_document_cursor_wrapper_parent_class = g_type_class_peek_parent (klass);
	GCP_C_DOCUMENT_CURSOR_WRAPPER_CLASS (klass)->finalize = gcp_c_document_cursor_wrapper_finalize;
}


static void gcp_c_document_cursor_wrapper_instance_init (GcpCDocumentCursorWrapper * self) {
	self->ref_count = 1;
}


static void gcp_c_document_cursor_wrapper_finalize (GcpCDocumentCursorWrapper* obj) {
	GcpCDocumentCursorWrapper * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GCP_C_DOCUMENT_TYPE_CURSOR_WRAPPER, GcpCDocumentCursorWrapper);
}


GType gcp_c_document_cursor_wrapper_get_type (void) {
	return gcp_c_document_cursor_wrapper_type_id;
}


GType gcp_c_document_cursor_wrapper_register_type (GTypeModule * module) {
	static const GTypeValueTable g_define_type_value_table = { gcp_c_document_value_cursor_wrapper_init, gcp_c_document_value_cursor_wrapper_free_value, gcp_c_document_value_cursor_wrapper_copy_value, gcp_c_document_value_cursor_wrapper_peek_pointer, "p", gcp_c_document_value_cursor_wrapper_collect_value, "p", gcp_c_document_value_cursor_wrapper_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (GcpCDocumentCursorWrapperClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gcp_c_document_cursor_wrapper_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GcpCDocumentCursorWrapper), 0, (GInstanceInitFunc) gcp_c_document_cursor_wrapper_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	gcp_c_document_cursor_wrapper_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GcpCDocumentCursorWrapper", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return gcp_c_document_cursor_wrapper_type_id;
}


static gpointer gcp_c_document_cursor_wrapper_ref (gpointer instance) {
	GcpCDocumentCursorWrapper* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


static void gcp_c_document_cursor_wrapper_unref (gpointer instance) {
	GcpCDocumentCursorWrapper* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GCP_C_DOCUMENT_CURSOR_WRAPPER_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static void gcp_c_document_class_init (GcpCDocumentClass * klass) {
	gcp_c_document_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GcpCDocumentPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_gcp_c_document_get_property;
	G_OBJECT_CLASS (klass)->constructor = gcp_c_document_constructor;
	G_OBJECT_CLASS (klass)->finalize = gcp_c_document_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GCP_C_DOCUMENT_SYMBOL_BROWSER, g_param_spec_object ("symbol-browser", "symbol-browser", "symbol-browser", GCP_TYPE_SYMBOL_BROWSER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GCP_C_DOCUMENT_TRANSLATION_UNIT, gcp_c_param_spec_translation_unit ("translation-unit", "translation-unit", "translation-unit", GCP_C_TYPE_TRANSLATION_UNIT, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void gcp_c_document_gcp_symbol_browser_support_interface_init (GcpSymbolBrowserSupportIface * iface) {
	gcp_c_document_gcp_symbol_browser_support_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_symbol_browser = gcp_c_document_real_get_symbol_browser;
}


static void gcp_c_document_gcp_diagnostic_support_interface_init (GcpDiagnosticSupportIface * iface) {
	gcp_c_document_gcp_diagnostic_support_parent_iface = g_type_interface_peek_parent (iface);
	iface->set_diagnostic_tags = (void (*)(GcpDiagnosticSupport*, GcpDiagnosticTags*)) gcp_c_document_real_set_diagnostic_tags;
	iface->get_diagnostic_tags = (GcpDiagnosticTags* (*)(GcpDiagnosticSupport*)) gcp_c_document_real_get_diagnostic_tags;
	iface->begin_diagnostics = (GcpSourceIndex* (*)(GcpDiagnosticSupport*)) gcp_c_document_real_begin_diagnostics;
	iface->end_diagnostics = (void (*)(GcpDiagnosticSupport*)) gcp_c_document_real_end_diagnostics;
}


static void gcp_c_document_gcp_semantic_value_support_interface_init (GcpSemanticValueSupportIface * iface) {
	gcp_c_document_gcp_semantic_value_support_parent_iface = g_type_interface_peek_parent (iface);
	iface->begin_semantics = (GcpSourceIndex* (*)(GcpSemanticValueSupport*)) gcp_c_document_real_begin_semantics;
	iface->end_semantics = (void (*)(GcpSemanticValueSupport*)) gcp_c_document_real_end_semantics;
}


static void gcp_c_document_instance_init (GcpCDocument * self) {
	self->priv = GCP_C_DOCUMENT_GET_PRIVATE (self);
}


static void gcp_c_document_finalize (GObject* obj) {
	GcpCDocument * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GCP_C_TYPE_DOCUMENT, GcpCDocument);
	_g_object_unref0 (self->priv->d_tags);
	_gcp_c_translation_unit_unref0 (self->priv->d_tu);
	_g_object_unref0 (self->priv->d_symbols);
	_g_object_unref0 (self->priv->d_diagnostics);
	_g_mutex_free0 (self->priv->d_diagnosticsLock);
	_g_object_unref0 (self->priv->d_semantics);
	_g_mutex_free0 (self->priv->d_semanticsLock);
	G_OBJECT_CLASS (gcp_c_document_parent_class)->finalize (obj);
}


GType gcp_c_document_get_type (void) {
	return gcp_c_document_type_id;
}


GType gcp_c_document_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (GcpCDocumentClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gcp_c_document_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GcpCDocument), 0, (GInstanceInitFunc) gcp_c_document_instance_init, NULL };
	static const GInterfaceInfo gcp_symbol_browser_support_info = { (GInterfaceInitFunc) gcp_c_document_gcp_symbol_browser_support_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gcp_diagnostic_support_info = { (GInterfaceInitFunc) gcp_c_document_gcp_diagnostic_support_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gcp_semantic_value_support_info = { (GInterfaceInitFunc) gcp_c_document_gcp_semantic_value_support_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	gcp_c_document_type_id = g_type_module_register_type (module, GCP_TYPE_DOCUMENT, "GcpCDocument", &g_define_type_info, 0);
	g_type_module_add_interface (module, gcp_c_document_type_id, GCP_TYPE_SYMBOL_BROWSER_SUPPORT, &gcp_symbol_browser_support_info);
	g_type_module_add_interface (module, gcp_c_document_type_id, GCP_TYPE_DIAGNOSTIC_SUPPORT, &gcp_diagnostic_support_info);
	g_type_module_add_interface (module, gcp_c_document_type_id, GCP_TYPE_SEMANTIC_VALUE_SUPPORT, &gcp_semantic_value_support_info);
	return gcp_c_document_type_id;
}


static void _vala_gcp_c_document_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GcpCDocument * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GCP_C_TYPE_DOCUMENT, GcpCDocument);
	switch (property_id) {
		case GCP_C_DOCUMENT_SYMBOL_BROWSER:
		g_value_set_object (value, gcp_symbol_browser_support_get_symbol_browser ((GcpSymbolBrowserSupport*) self));
		break;
		case GCP_C_DOCUMENT_TRANSLATION_UNIT:
		gcp_c_value_set_translation_unit (value, gcp_c_document_get_translation_unit (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



