~ubuntu-branches/ubuntu/vivid/vala/vivid

« back to all changes in this revision

Viewing changes to compiler/valacompiler.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2010-09-05 10:32:13 UTC
  • mfrom: (1.5.9 upstream) (28.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20100905103213-8nn88erk20o4wgm3
Tags: 0.9.8-1
New upstream development release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
static gboolean vala_compiler_enable_version_header = FALSE;
170
170
static gboolean vala_compiler_disable_version_header;
171
171
static gboolean vala_compiler_disable_version_header = FALSE;
 
172
static gboolean vala_compiler_fatal_warnings;
 
173
static gboolean vala_compiler_fatal_warnings = FALSE;
172
174
static char* vala_compiler_entry_point;
173
175
static char* vala_compiler_entry_point = NULL;
174
176
static gboolean vala_compiler_run_output;
207
209
static gint _vala_array_length (gpointer array);
208
210
static int _vala_strcmp0 (const char * str1, const char * str2);
209
211
 
210
 
static const GOptionEntry VALA_COMPILER_options[43] = {{"girdir", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &vala_compiler_gir_directories, "Look for .gir files in DIRECTORY", "DIRECTORY..."}, {"vapidir", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &vala_compiler_vapi_directories, "Look for package bindings in DIRECTORY", "DIRECTORY..."}, {"pkg", (gchar) 0, 0, G_OPTION_ARG_STRING_ARRAY, &vala_compiler_packages, "Include binding for PACKAGE", "PACKAGE..."}, {"vapi", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &vala_compiler_vapi_filename, "Output VAPI file name", "FILE"}, {"library", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_library, "Library name", "NAME"}, {"gir", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_gir, "GObject-Introspection repository file name", "NAME-VERSION.gir"}, {"basedir", 'b', 0, G_OPTION_ARG_FILENAME, &vala_compiler_basedir, "Base source directory", "DIRECTORY"}, {"directory", 'd', 0, G_OPTION_ARG_FILENAME, &vala_compiler_directory, "Output directory", "DIRECTORY"}, {"version", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_version, "Display version number", NULL}, {"ccode", 'C', 0, G_OPTION_ARG_NONE, &vala_compiler_ccode_only, "Output C code", NULL}, {"header", 'H', 0, G_OPTION_ARG_FILENAME, &vala_compiler_header_filename, "Output C header file", "FILE"}, {"use-header", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_use_header, "Use C header file", NULL}, {"includedir", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &vala_compiler_includedir, "Directory used to include the C header file", "DIRECTORY"}, {"internal-header", 'h', 0, G_OPTION_ARG_FILENAME, &vala_compiler_internal_header_filename, "Output internal C header file", "FILE"}, {"internal-vapi", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &vala_compiler_internal_vapi_filename, "Output vapi with internal api", "FILE"}, {"symbols", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &vala_compiler_symbols_filename, "Output symbols file", "FILE"}, {"compile", 'c', 0, G_OPTION_ARG_NONE, &vala_compiler_compile_only, "Compile but do not link", NULL}, {"output", 'o', 0, G_OPTION_ARG_FILENAME, &vala_compiler_output, "Place output in file FILE", "FILE"}, {"debug", 'g', 0, G_OPTION_ARG_NONE, &vala_compiler_debug, "Produce debug information", NULL}, {"thread", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_thread, "Enable multithreading support", NULL}, {"enable-mem-profiler", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_mem_profiler, "Enable GLib memory profiler", NULL}, {"define", 'D', 0, G_OPTION_ARG_STRING_ARRAY, &vala_compiler_defines, "Define SYMBOL", "SYMBOL..."}, {"main", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_entry_point, "Use SYMBOL as entry point", "SYMBOL..."}, {"nostdpkg", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_nostdpkg, "Do not include standard packages", NULL}, {"disable-assert", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_disable_assert, "Disable assertions", NULL}, {"enable-checking", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_enable_checking, "Enable additional run-time checks", NULL}, {"enable-deprecated", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_deprecated, "Enable deprecated features", NULL}, {"enable-experimental", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_experimental, "Enable experimental features", NULL}, {"disable-warnings", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_disable_warnings, "Disable warnings", NULL}, {"enable-experimental-non-null", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_experimental_non_null, "Enable experimental enhancements for non-null types", NULL}, {"disable-dbus-transformation", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_disable_dbus_transformation, "Disable transformation of D-Bus member names", NULL}, {"cc", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_cc_command, "Use COMMAND as C compiler command", "COMMAND"}, {"Xcc", 'X', 0, G_OPTION_ARG_STRING_ARRAY, &vala_compiler_cc_options, "Pass OPTION to the C compiler", "OPTION..."}, {"dump-tree", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &vala_compiler_dump_tree, "Write code tree to FILE", "FILE"}, {"save-temps", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_save_temps, "Keep temporary files", NULL}, {"profile", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_profile, "Use the given profile instead of the default", "PROFILE"}, {"quiet", 'q', 0, G_OPTION_ARG_NONE, &vala_compiler_quiet_mode, "Do not print messages to the console", NULL}, {"verbose", 'v', 0, G_OPTION_ARG_NONE, &vala_compiler_verbose_mode, "Print additional messages to the console", NULL}, {"target-glib", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_target_glib, "Target version of glib for code generation", "MAJOR.MINOR"}, {"enable-version-header", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_enable_version_header, "Write vala build version in generated files", NULL}, {"disable-version-header", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_disable_version_header, "Do not write vala build version in generated files", NULL}, {"", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &vala_compiler_sources, NULL, "FILE..."}, {NULL}};
 
212
static const GOptionEntry VALA_COMPILER_options[44] = {{"girdir", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &vala_compiler_gir_directories, "Look for .gir files in DIRECTORY", "DIRECTORY..."}, {"vapidir", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &vala_compiler_vapi_directories, "Look for package bindings in DIRECTORY", "DIRECTORY..."}, {"pkg", (gchar) 0, 0, G_OPTION_ARG_STRING_ARRAY, &vala_compiler_packages, "Include binding for PACKAGE", "PACKAGE..."}, {"vapi", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &vala_compiler_vapi_filename, "Output VAPI file name", "FILE"}, {"library", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_library, "Library name", "NAME"}, {"gir", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_gir, "GObject-Introspection repository file name", "NAME-VERSION.gir"}, {"basedir", 'b', 0, G_OPTION_ARG_FILENAME, &vala_compiler_basedir, "Base source directory", "DIRECTORY"}, {"directory", 'd', 0, G_OPTION_ARG_FILENAME, &vala_compiler_directory, "Output directory", "DIRECTORY"}, {"version", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_version, "Display version number", NULL}, {"ccode", 'C', 0, G_OPTION_ARG_NONE, &vala_compiler_ccode_only, "Output C code", NULL}, {"header", 'H', 0, G_OPTION_ARG_FILENAME, &vala_compiler_header_filename, "Output C header file", "FILE"}, {"use-header", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_use_header, "Use C header file", NULL}, {"includedir", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &vala_compiler_includedir, "Directory used to include the C header file", "DIRECTORY"}, {"internal-header", 'h', 0, G_OPTION_ARG_FILENAME, &vala_compiler_internal_header_filename, "Output internal C header file", "FILE"}, {"internal-vapi", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &vala_compiler_internal_vapi_filename, "Output vapi with internal api", "FILE"}, {"symbols", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &vala_compiler_symbols_filename, "Output symbols file", "FILE"}, {"compile", 'c', 0, G_OPTION_ARG_NONE, &vala_compiler_compile_only, "Compile but do not link", NULL}, {"output", 'o', 0, G_OPTION_ARG_FILENAME, &vala_compiler_output, "Place output in file FILE", "FILE"}, {"debug", 'g', 0, G_OPTION_ARG_NONE, &vala_compiler_debug, "Produce debug information", NULL}, {"thread", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_thread, "Enable multithreading support", NULL}, {"enable-mem-profiler", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_mem_profiler, "Enable GLib memory profiler", NULL}, {"define", 'D', 0, G_OPTION_ARG_STRING_ARRAY, &vala_compiler_defines, "Define SYMBOL", "SYMBOL..."}, {"main", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_entry_point, "Use SYMBOL as entry point", "SYMBOL..."}, {"nostdpkg", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_nostdpkg, "Do not include standard packages", NULL}, {"disable-assert", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_disable_assert, "Disable assertions", NULL}, {"enable-checking", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_enable_checking, "Enable additional run-time checks", NULL}, {"enable-deprecated", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_deprecated, "Enable deprecated features", NULL}, {"enable-experimental", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_experimental, "Enable experimental features", NULL}, {"disable-warnings", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_disable_warnings, "Disable warnings", NULL}, {"fatal-warnings", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_fatal_warnings, "Treat warnings as fatal", NULL}, {"enable-experimental-non-null", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_experimental_non_null, "Enable experimental enhancements for non-null types", NULL}, {"disable-dbus-transformation", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_disable_dbus_transformation, "Disable transformation of D-Bus member names", NULL}, {"cc", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_cc_command, "Use COMMAND as C compiler command", "COMMAND"}, {"Xcc", 'X', 0, G_OPTION_ARG_STRING_ARRAY, &vala_compiler_cc_options, "Pass OPTION to the C compiler", "OPTION..."}, {"dump-tree", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &vala_compiler_dump_tree, "Write code tree to FILE", "FILE"}, {"save-temps", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_save_temps, "Keep temporary files", NULL}, {"profile", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_profile, "Use the given profile instead of the default", "PROFILE"}, {"quiet", 'q', 0, G_OPTION_ARG_NONE, &vala_compiler_quiet_mode, "Do not print messages to the console", NULL}, {"verbose", 'v', 0, G_OPTION_ARG_NONE, &vala_compiler_verbose_mode, "Print additional messages to the console", NULL}, {"target-glib", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_target_glib, "Target version of glib for code generation", "MAJOR.MINOR"}, {"enable-version-header", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_enable_version_header, "Write vala build version in generated files", NULL}, {"disable-version-header", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_disable_version_header, "Do not write vala build version in generated files", NULL}, {"", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &vala_compiler_sources, NULL, "FILE..."}, {NULL}};
211
213
 
212
214
 
213
215
static gint vala_compiler_quit (ValaCompiler* self) {
214
216
        gint result = 0;
215
217
        gboolean _tmp0_ = FALSE;
 
218
        gboolean _tmp1_ = FALSE;
216
219
        g_return_val_if_fail (self != NULL, 0);
217
220
        if (vala_report_get_errors (vala_code_context_get_report (self->priv->context)) == 0) {
218
221
                _tmp0_ = vala_report_get_warnings (vala_code_context_get_report (self->priv->context)) == 0;
224
227
                return result;
225
228
        }
226
229
        if (vala_report_get_errors (vala_code_context_get_report (self->priv->context)) == 0) {
 
230
                gboolean _tmp2_ = FALSE;
 
231
                if (!vala_compiler_fatal_warnings) {
 
232
                        _tmp2_ = TRUE;
 
233
                } else {
 
234
                        _tmp2_ = vala_report_get_warnings (vala_code_context_get_report (self->priv->context)) == 0;
 
235
                }
 
236
                _tmp1_ = _tmp2_;
 
237
        } else {
 
238
                _tmp1_ = FALSE;
 
239
        }
 
240
        if (_tmp1_) {
227
241
                if (!vala_compiler_quiet_mode) {
228
242
                        fprintf (stdout, "Compilation succeeded - %d warning(s)\n", vala_report_get_warnings (vala_code_context_get_report (self->priv->context)));
229
243
                }
374
388
}
375
389
 
376
390
 
 
391
static glong string_get_length (const char* self) {
 
392
        glong result;
 
393
        g_return_val_if_fail (self != NULL, 0L);
 
394
        result = g_utf8_strlen (self, (gssize) (-1));
 
395
        return result;
 
396
}
 
397
 
 
398
 
377
399
static char* string_substring (const char* self, glong offset, glong len) {
378
400
        char* result = NULL;
379
401
        glong string_length;
380
402
        const char* start;
381
403
        g_return_val_if_fail (self != NULL, NULL);
382
 
        string_length = g_utf8_strlen (self, -1);
 
404
        string_length = string_get_length (self);
383
405
        if (offset < 0) {
384
406
                offset = string_length + offset;
385
407
                g_return_val_if_fail (offset >= 0, NULL);
411
433
        gboolean _tmp1_ = FALSE;
412
434
        gboolean _tmp2_ = FALSE;
413
435
        gboolean _tmp5_ = FALSE;
 
436
        gboolean _tmp21_ = FALSE;
414
437
        gboolean has_c_files;
415
 
        char** _tmp37_;
 
438
        char** _tmp38_;
 
439
        gboolean _tmp39_ = FALSE;
416
440
        ValaParser* parser;
417
441
        ValaGenieParser* genie_parser;
418
442
        ValaGirParser* gir_parser;
 
443
        gboolean _tmp42_ = FALSE;
419
444
        ValaSymbolResolver* resolver;
 
445
        gboolean _tmp44_ = FALSE;
420
446
        ValaSemanticAnalyzer* analyzer;
421
 
        gboolean _tmp39_ = FALSE;
422
 
        gboolean _tmp40_ = FALSE;
 
447
        gboolean _tmp46_ = FALSE;
 
448
        gboolean _tmp47_ = FALSE;
 
449
        gboolean _tmp49_ = FALSE;
423
450
        ValaFlowAnalyzer* flow_analyzer;
424
 
        gboolean _tmp42_ = FALSE;
 
451
        gboolean _tmp51_ = FALSE;
 
452
        gboolean _tmp53_ = FALSE;
 
453
        gboolean _tmp55_ = FALSE;
425
454
        g_return_val_if_fail (self != NULL, 0);
426
455
        self->priv->context = (_tmp0_ = vala_code_context_new (), _vala_code_context_unref0 (self->priv->context), _tmp0_);
427
456
        vala_code_context_push (self->priv->context);
665
694
                vala_compiler_packages = (_tmp20_ = NULL, vala_compiler_packages = (_vala_array_free (vala_compiler_packages, _vala_array_length (vala_compiler_packages), (GDestroyNotify) g_free), NULL), _tmp20_);
666
695
        }
667
696
        if (vala_report_get_errors (vala_code_context_get_report (self->priv->context)) > 0) {
 
697
                _tmp21_ = TRUE;
 
698
        } else {
 
699
                gboolean _tmp22_ = FALSE;
 
700
                if (vala_compiler_fatal_warnings) {
 
701
                        _tmp22_ = vala_report_get_warnings (vala_code_context_get_report (self->priv->context)) > 0;
 
702
                } else {
 
703
                        _tmp22_ = FALSE;
 
704
                }
 
705
                _tmp21_ = _tmp22_;
 
706
        }
 
707
        if (_tmp21_) {
668
708
                result = vala_compiler_quit (self);
669
709
                return result;
670
710
        }
671
711
        if (vala_code_context_get_profile (self->priv->context) == VALA_PROFILE_GOBJECT) {
672
712
                if (vala_code_context_has_package (self->priv->context, "dbus-glib-1")) {
673
 
                        ValaDBusServerModule* _tmp21_;
674
 
                        vala_code_context_set_codegen (self->priv->context, (ValaCodeGenerator*) (_tmp21_ = vala_dbus_server_module_new ()));
675
 
                        _vala_code_visitor_unref0 (_tmp21_);
676
 
                } else {
677
 
                        ValaGDBusServerModule* _tmp22_;
678
 
                        vala_code_context_set_codegen (self->priv->context, (ValaCodeGenerator*) (_tmp22_ = vala_gd_bus_server_module_new ()));
679
 
                        _vala_code_visitor_unref0 (_tmp22_);
680
 
                }
681
 
        } else {
682
 
                if (vala_code_context_get_profile (self->priv->context) == VALA_PROFILE_DOVA) {
683
 
                        ValaDovaErrorModule* _tmp23_;
684
 
                        vala_code_context_set_codegen (self->priv->context, (ValaCodeGenerator*) (_tmp23_ = vala_dova_error_module_new ()));
 
713
                        ValaDBusServerModule* _tmp23_;
 
714
                        if (!vala_code_context_get_deprecated (self->priv->context)) {
 
715
                                vala_report_warning (NULL, "D-Bus GLib is deprecated, use GDBus");
 
716
                        }
 
717
                        vala_code_context_set_codegen (self->priv->context, (ValaCodeGenerator*) (_tmp23_ = vala_dbus_server_module_new ()));
685
718
                        _vala_code_visitor_unref0 (_tmp23_);
686
719
                } else {
687
 
                        ValaCCodeDelegateModule* _tmp24_;
688
 
                        vala_code_context_set_codegen (self->priv->context, (ValaCodeGenerator*) (_tmp24_ = vala_ccode_delegate_module_new ()));
 
720
                        ValaGDBusServerModule* _tmp24_;
 
721
                        vala_code_context_set_codegen (self->priv->context, (ValaCodeGenerator*) (_tmp24_ = vala_gd_bus_server_module_new ()));
689
722
                        _vala_code_visitor_unref0 (_tmp24_);
690
723
                }
 
724
        } else {
 
725
                if (vala_code_context_get_profile (self->priv->context) == VALA_PROFILE_DOVA) {
 
726
                        ValaDovaErrorModule* _tmp25_;
 
727
                        vala_code_context_set_codegen (self->priv->context, (ValaCodeGenerator*) (_tmp25_ = vala_dova_error_module_new ()));
 
728
                        _vala_code_visitor_unref0 (_tmp25_);
 
729
                } else {
 
730
                        ValaCCodeDelegateModule* _tmp26_;
 
731
                        vala_code_context_set_codegen (self->priv->context, (ValaCodeGenerator*) (_tmp26_ = vala_ccode_delegate_module_new ()));
 
732
                        _vala_code_visitor_unref0 (_tmp26_);
 
733
                }
691
734
        }
692
735
        has_c_files = FALSE;
693
736
        {
702
745
                        {
703
746
                                if (g_file_test (source, G_FILE_TEST_EXISTS)) {
704
747
                                        char* rpath;
705
 
                                        gboolean _tmp25_ = FALSE;
706
 
                                        gboolean _tmp26_ = FALSE;
 
748
                                        gboolean _tmp27_ = FALSE;
 
749
                                        gboolean _tmp28_ = FALSE;
707
750
                                        rpath = vala_compiler_realpath (source);
708
751
                                        if (vala_compiler_run_output) {
709
 
                                                _tmp26_ = TRUE;
710
 
                                        } else {
711
 
                                                _tmp26_ = g_str_has_suffix (source, ".vala");
712
 
                                        }
713
 
                                        if (_tmp26_) {
714
 
                                                _tmp25_ = TRUE;
715
 
                                        } else {
716
 
                                                _tmp25_ = g_str_has_suffix (source, ".gs");
717
 
                                        }
718
 
                                        if (_tmp25_) {
 
752
                                                _tmp28_ = TRUE;
 
753
                                        } else {
 
754
                                                _tmp28_ = g_str_has_suffix (source, ".vala");
 
755
                                        }
 
756
                                        if (_tmp28_) {
 
757
                                                _tmp27_ = TRUE;
 
758
                                        } else {
 
759
                                                _tmp27_ = g_str_has_suffix (source, ".gs");
 
760
                                        }
 
761
                                        if (_tmp27_) {
719
762
                                                ValaSourceFile* source_file;
720
763
                                                source_file = vala_source_file_new (self->priv->context, rpath, FALSE, NULL);
 
764
                                                vala_source_file_set_relative_filename (source_file, source);
721
765
                                                if (vala_code_context_get_profile (self->priv->context) == VALA_PROFILE_POSIX) {
722
 
                                                        ValaUnresolvedSymbol* _tmp27_;
723
 
                                                        ValaUsingDirective* _tmp28_;
 
766
                                                        ValaUnresolvedSymbol* _tmp29_;
 
767
                                                        ValaUsingDirective* _tmp30_;
724
768
                                                        ValaUsingDirective* ns_ref;
725
 
                                                        ns_ref = (_tmp28_ = vala_using_directive_new ((ValaSymbol*) (_tmp27_ = vala_unresolved_symbol_new (NULL, "Posix", NULL)), NULL), _vala_code_node_unref0 (_tmp27_), _tmp28_);
 
769
                                                        ns_ref = (_tmp30_ = vala_using_directive_new ((ValaSymbol*) (_tmp29_ = vala_unresolved_symbol_new (NULL, "Posix", NULL)), NULL), _vala_code_node_unref0 (_tmp29_), _tmp30_);
726
770
                                                        vala_source_file_add_using_directive (source_file, ns_ref);
727
771
                                                        vala_namespace_add_using_directive (vala_code_context_get_root (self->priv->context), ns_ref);
728
772
                                                        _vala_code_node_unref0 (ns_ref);
729
773
                                                } else {
730
774
                                                        if (vala_code_context_get_profile (self->priv->context) == VALA_PROFILE_GOBJECT) {
731
 
                                                                ValaUnresolvedSymbol* _tmp29_;
732
 
                                                                ValaUsingDirective* _tmp30_;
 
775
                                                                ValaUnresolvedSymbol* _tmp31_;
 
776
                                                                ValaUsingDirective* _tmp32_;
733
777
                                                                ValaUsingDirective* ns_ref;
734
 
                                                                ns_ref = (_tmp30_ = vala_using_directive_new ((ValaSymbol*) (_tmp29_ = vala_unresolved_symbol_new (NULL, "GLib", NULL)), NULL), _vala_code_node_unref0 (_tmp29_), _tmp30_);
 
778
                                                                ns_ref = (_tmp32_ = vala_using_directive_new ((ValaSymbol*) (_tmp31_ = vala_unresolved_symbol_new (NULL, "GLib", NULL)), NULL), _vala_code_node_unref0 (_tmp31_), _tmp32_);
735
779
                                                                vala_source_file_add_using_directive (source_file, ns_ref);
736
780
                                                                vala_namespace_add_using_directive (vala_code_context_get_root (self->priv->context), ns_ref);
737
781
                                                                _vala_code_node_unref0 (ns_ref);
738
782
                                                        } else {
739
783
                                                                if (vala_code_context_get_profile (self->priv->context) == VALA_PROFILE_DOVA) {
740
 
                                                                        ValaUnresolvedSymbol* _tmp31_;
741
 
                                                                        ValaUsingDirective* _tmp32_;
 
784
                                                                        ValaUnresolvedSymbol* _tmp33_;
 
785
                                                                        ValaUsingDirective* _tmp34_;
742
786
                                                                        ValaUsingDirective* ns_ref;
743
 
                                                                        ns_ref = (_tmp32_ = vala_using_directive_new ((ValaSymbol*) (_tmp31_ = vala_unresolved_symbol_new (NULL, "Dova", NULL)), NULL), _vala_code_node_unref0 (_tmp31_), _tmp32_);
 
787
                                                                        ns_ref = (_tmp34_ = vala_using_directive_new ((ValaSymbol*) (_tmp33_ = vala_unresolved_symbol_new (NULL, "Dova", NULL)), NULL), _vala_code_node_unref0 (_tmp33_), _tmp34_);
744
788
                                                                        vala_source_file_add_using_directive (source_file, ns_ref);
745
789
                                                                        vala_namespace_add_using_directive (vala_code_context_get_root (self->priv->context), ns_ref);
746
790
                                                                        _vala_code_node_unref0 (ns_ref);
750
794
                                                vala_code_context_add_source_file (self->priv->context, source_file);
751
795
                                                _vala_source_file_unref0 (source_file);
752
796
                                        } else {
753
 
                                                gboolean _tmp33_ = FALSE;
 
797
                                                gboolean _tmp35_ = FALSE;
754
798
                                                if (g_str_has_suffix (source, ".vapi")) {
755
 
                                                        _tmp33_ = TRUE;
 
799
                                                        _tmp35_ = TRUE;
756
800
                                                } else {
757
 
                                                        _tmp33_ = g_str_has_suffix (source, ".gir");
 
801
                                                        _tmp35_ = g_str_has_suffix (source, ".gir");
758
802
                                                }
759
 
                                                if (_tmp33_) {
760
 
                                                        ValaSourceFile* _tmp34_;
761
 
                                                        vala_code_context_add_source_file (self->priv->context, _tmp34_ = vala_source_file_new (self->priv->context, rpath, TRUE, NULL));
762
 
                                                        _vala_source_file_unref0 (_tmp34_);
 
803
                                                if (_tmp35_) {
 
804
                                                        ValaSourceFile* source_file;
 
805
                                                        source_file = vala_source_file_new (self->priv->context, rpath, TRUE, NULL);
 
806
                                                        vala_source_file_set_relative_filename (source_file, source);
 
807
                                                        vala_code_context_add_source_file (self->priv->context, source_file);
 
808
                                                        _vala_source_file_unref0 (source_file);
763
809
                                                } else {
764
810
                                                        if (g_str_has_suffix (source, ".c")) {
765
811
                                                                vala_code_context_add_c_source_file (self->priv->context, rpath);
766
812
                                                                has_c_files = TRUE;
767
813
                                                        } else {
768
 
                                                                char* _tmp35_;
769
 
                                                                vala_report_error (NULL, _tmp35_ = g_strdup_printf ("%s is not a supported source file type. Only .vala, .vapi, .gs, and .c" \
 
814
                                                                char* _tmp36_;
 
815
                                                                vala_report_error (NULL, _tmp36_ = g_strdup_printf ("%s is not a supported source file type. Only .vala, .vapi, .gs, and .c" \
770
816
" files are supported.", source));
771
 
                                                                _g_free0 (_tmp35_);
 
817
                                                                _g_free0 (_tmp36_);
772
818
                                                        }
773
819
                                                }
774
820
                                        }
775
821
                                        _g_free0 (rpath);
776
822
                                } else {
777
 
                                        char* _tmp36_;
778
 
                                        vala_report_error (NULL, _tmp36_ = g_strdup_printf ("%s not found", source));
779
 
                                        _g_free0 (_tmp36_);
 
823
                                        char* _tmp37_;
 
824
                                        vala_report_error (NULL, _tmp37_ = g_strdup_printf ("%s not found", source));
 
825
                                        _g_free0 (_tmp37_);
780
826
                                }
781
827
                                _g_free0 (source);
782
828
                        }
783
829
                }
784
830
        }
785
 
        vala_compiler_sources = (_tmp37_ = NULL, vala_compiler_sources = (_vala_array_free (vala_compiler_sources, _vala_array_length (vala_compiler_sources), (GDestroyNotify) g_free), NULL), _tmp37_);
 
831
        vala_compiler_sources = (_tmp38_ = NULL, vala_compiler_sources = (_vala_array_free (vala_compiler_sources, _vala_array_length (vala_compiler_sources), (GDestroyNotify) g_free), NULL), _tmp38_);
786
832
        if (vala_report_get_errors (vala_code_context_get_report (self->priv->context)) > 0) {
 
833
                _tmp39_ = TRUE;
 
834
        } else {
 
835
                gboolean _tmp40_ = FALSE;
 
836
                if (vala_compiler_fatal_warnings) {
 
837
                        _tmp40_ = vala_report_get_warnings (vala_code_context_get_report (self->priv->context)) > 0;
 
838
                } else {
 
839
                        _tmp40_ = FALSE;
 
840
                }
 
841
                _tmp39_ = _tmp40_;
 
842
        }
 
843
        if (_tmp39_) {
787
844
                result = vala_compiler_quit (self);
788
845
                return result;
789
846
        }
795
852
        vala_gir_parser_parse (gir_parser, self->priv->context);
796
853
        if (vala_gir_parser_get_package_names != NULL) {
797
854
                {
798
 
                        gint _tmp38_;
 
855
                        gint _tmp41_;
799
856
                        char** pkg_collection;
800
857
                        int pkg_collection_length1;
801
858
                        int pkg_it;
802
 
                        pkg_collection = vala_gir_parser_get_package_names (gir_parser, &_tmp38_);
803
 
                        pkg_collection_length1 = _tmp38_;
804
 
                        for (pkg_it = 0; pkg_it < _tmp38_; pkg_it = pkg_it + 1) {
 
859
                        pkg_collection = vala_gir_parser_get_package_names (gir_parser, &_tmp41_);
 
860
                        pkg_collection_length1 = _tmp41_;
 
861
                        for (pkg_it = 0; pkg_it < _tmp41_; pkg_it = pkg_it + 1) {
805
862
                                char* pkg;
806
863
                                pkg = g_strdup (pkg_collection[pkg_it]);
807
864
                                {
813
870
                }
814
871
        }
815
872
        if (vala_report_get_errors (vala_code_context_get_report (self->priv->context)) > 0) {
 
873
                _tmp42_ = TRUE;
 
874
        } else {
 
875
                gboolean _tmp43_ = FALSE;
 
876
                if (vala_compiler_fatal_warnings) {
 
877
                        _tmp43_ = vala_report_get_warnings (vala_code_context_get_report (self->priv->context)) > 0;
 
878
                } else {
 
879
                        _tmp43_ = FALSE;
 
880
                }
 
881
                _tmp42_ = _tmp43_;
 
882
        }
 
883
        if (_tmp42_) {
816
884
                result = vala_compiler_quit (self);
817
885
                _vala_code_visitor_unref0 (gir_parser);
818
886
                _vala_code_visitor_unref0 (genie_parser);
822
890
        resolver = vala_symbol_resolver_new ();
823
891
        vala_symbol_resolver_resolve (resolver, self->priv->context);
824
892
        if (vala_report_get_errors (vala_code_context_get_report (self->priv->context)) > 0) {
 
893
                _tmp44_ = TRUE;
 
894
        } else {
 
895
                gboolean _tmp45_ = FALSE;
 
896
                if (vala_compiler_fatal_warnings) {
 
897
                        _tmp45_ = vala_report_get_warnings (vala_code_context_get_report (self->priv->context)) > 0;
 
898
                } else {
 
899
                        _tmp45_ = FALSE;
 
900
                }
 
901
                _tmp44_ = _tmp45_;
 
902
        }
 
903
        if (_tmp44_) {
825
904
                result = vala_compiler_quit (self);
826
905
                _vala_code_visitor_unref0 (resolver);
827
906
                _vala_code_visitor_unref0 (gir_parser);
832
911
        analyzer = vala_semantic_analyzer_new ();
833
912
        vala_semantic_analyzer_analyze (analyzer, self->priv->context);
834
913
        if (!vala_compiler_ccode_only) {
835
 
                _tmp40_ = !vala_compiler_compile_only;
836
 
        } else {
837
 
                _tmp40_ = FALSE;
838
 
        }
839
 
        if (_tmp40_) {
840
 
                _tmp39_ = vala_compiler_library == NULL;
841
 
        } else {
842
 
                _tmp39_ = FALSE;
843
 
        }
844
 
        if (_tmp39_) {
845
 
                gboolean _tmp41_ = FALSE;
 
914
                _tmp47_ = !vala_compiler_compile_only;
 
915
        } else {
 
916
                _tmp47_ = FALSE;
 
917
        }
 
918
        if (_tmp47_) {
 
919
                _tmp46_ = vala_compiler_library == NULL;
 
920
        } else {
 
921
                _tmp46_ = FALSE;
 
922
        }
 
923
        if (_tmp46_) {
 
924
                gboolean _tmp48_ = FALSE;
846
925
                if (!has_c_files) {
847
 
                        _tmp41_ = vala_code_context_get_entry_point (self->priv->context) == NULL;
 
926
                        _tmp48_ = vala_code_context_get_entry_point (self->priv->context) == NULL;
848
927
                } else {
849
 
                        _tmp41_ = FALSE;
 
928
                        _tmp48_ = FALSE;
850
929
                }
851
 
                if (_tmp41_) {
 
930
                if (_tmp48_) {
852
931
                        vala_report_error (NULL, "program does not contain a static `main' method");
853
932
                }
854
933
        }
859
938
                _vala_code_visitor_unref0 (code_writer);
860
939
        }
861
940
        if (vala_report_get_errors (vala_code_context_get_report (self->priv->context)) > 0) {
 
941
                _tmp49_ = TRUE;
 
942
        } else {
 
943
                gboolean _tmp50_ = FALSE;
 
944
                if (vala_compiler_fatal_warnings) {
 
945
                        _tmp50_ = vala_report_get_warnings (vala_code_context_get_report (self->priv->context)) > 0;
 
946
                } else {
 
947
                        _tmp50_ = FALSE;
 
948
                }
 
949
                _tmp49_ = _tmp50_;
 
950
        }
 
951
        if (_tmp49_) {
862
952
                result = vala_compiler_quit (self);
863
953
                _vala_code_visitor_unref0 (analyzer);
864
954
                _vala_code_visitor_unref0 (resolver);
870
960
        flow_analyzer = vala_flow_analyzer_new ();
871
961
        vala_flow_analyzer_analyze (flow_analyzer, self->priv->context);
872
962
        if (vala_report_get_errors (vala_code_context_get_report (self->priv->context)) > 0) {
 
963
                _tmp51_ = TRUE;
 
964
        } else {
 
965
                gboolean _tmp52_ = FALSE;
 
966
                if (vala_compiler_fatal_warnings) {
 
967
                        _tmp52_ = vala_report_get_warnings (vala_code_context_get_report (self->priv->context)) > 0;
 
968
                } else {
 
969
                        _tmp52_ = FALSE;
 
970
                }
 
971
                _tmp51_ = _tmp52_;
 
972
        }
 
973
        if (_tmp51_) {
873
974
                result = vala_compiler_quit (self);
874
975
                _vala_code_visitor_unref0 (flow_analyzer);
875
976
                _vala_code_visitor_unref0 (analyzer);
881
982
        }
882
983
        vala_code_generator_emit (vala_code_context_get_codegen (self->priv->context), self->priv->context);
883
984
        if (vala_report_get_errors (vala_code_context_get_report (self->priv->context)) > 0) {
 
985
                _tmp53_ = TRUE;
 
986
        } else {
 
987
                gboolean _tmp54_ = FALSE;
 
988
                if (vala_compiler_fatal_warnings) {
 
989
                        _tmp54_ = vala_report_get_warnings (vala_code_context_get_report (self->priv->context)) > 0;
 
990
                } else {
 
991
                        _tmp54_ = FALSE;
 
992
                }
 
993
                _tmp53_ = _tmp54_;
 
994
        }
 
995
        if (_tmp53_) {
884
996
                result = vala_compiler_quit (self);
885
997
                _vala_code_visitor_unref0 (flow_analyzer);
886
998
                _vala_code_visitor_unref0 (analyzer);
891
1003
                return result;
892
1004
        }
893
1005
        if (vala_compiler_vapi_filename == NULL) {
894
 
                _tmp42_ = vala_compiler_library != NULL;
 
1006
                _tmp55_ = vala_compiler_library != NULL;
895
1007
        } else {
896
 
                _tmp42_ = FALSE;
 
1008
                _tmp55_ = FALSE;
897
1009
        }
898
 
        if (_tmp42_) {
899
 
                char* _tmp43_;
900
 
                vala_compiler_vapi_filename = (_tmp43_ = g_strdup_printf ("%s.vapi", vala_compiler_library), _g_free0 (vala_compiler_vapi_filename), _tmp43_);
 
1010
        if (_tmp55_) {
 
1011
                char* _tmp56_;
 
1012
                vala_compiler_vapi_filename = (_tmp56_ = g_strdup_printf ("%s.vapi", vala_compiler_library), _g_free0 (vala_compiler_vapi_filename), _tmp56_);
901
1013
        }
902
1014
        if (vala_compiler_library != NULL) {
903
 
                char* _tmp52_;
 
1015
                char* _tmp65_;
904
1016
                if (vala_compiler_gir != NULL) {
905
 
                        char* _tmp51_;
 
1017
                        char* _tmp64_;
906
1018
                        if (vala_code_context_get_profile (self->priv->context) == VALA_PROFILE_GOBJECT) {
907
1019
                                glong gir_len;
908
1020
                                const char* last_hyphen;
909
 
                                gboolean _tmp44_ = FALSE;
910
 
                                gir_len = g_utf8_strlen (vala_compiler_gir, -1);
 
1021
                                gboolean _tmp57_ = FALSE;
 
1022
                                gir_len = string_get_length (vala_compiler_gir);
911
1023
                                last_hyphen = g_utf8_strrchr (vala_compiler_gir, (gssize) gir_len, (gunichar) '-');
912
1024
                                if (last_hyphen == NULL) {
913
 
                                        _tmp44_ = TRUE;
 
1025
                                        _tmp57_ = TRUE;
914
1026
                                } else {
915
 
                                        _tmp44_ = !g_str_has_suffix (vala_compiler_gir, ".gir");
 
1027
                                        _tmp57_ = !g_str_has_suffix (vala_compiler_gir, ".gir");
916
1028
                                }
917
 
                                if (_tmp44_) {
918
 
                                        char* _tmp45_;
919
 
                                        vala_report_error (NULL, _tmp45_ = g_strdup_printf ("GIR file name `%s' is not well-formed, expected NAME-VERSION.gir", vala_compiler_gir));
920
 
                                        _g_free0 (_tmp45_);
 
1029
                                if (_tmp57_) {
 
1030
                                        char* _tmp58_;
 
1031
                                        vala_report_error (NULL, _tmp58_ = g_strdup_printf ("GIR file name `%s' is not well-formed, expected NAME-VERSION.gir", vala_compiler_gir));
 
1032
                                        _g_free0 (_tmp58_);
921
1033
                                } else {
922
1034
                                        glong offset;
923
1035
                                        char* gir_namespace;
924
1036
                                        char* gir_version;
925
 
                                        gboolean _tmp46_ = FALSE;
926
 
                                        gboolean _tmp47_ = FALSE;
927
 
                                        gboolean _tmp48_ = FALSE;
 
1037
                                        gboolean _tmp59_ = FALSE;
 
1038
                                        gboolean _tmp60_ = FALSE;
 
1039
                                        gboolean _tmp61_ = FALSE;
928
1040
                                        offset = g_utf8_pointer_to_offset (vala_compiler_gir, last_hyphen);
929
1041
                                        gir_namespace = string_substring (vala_compiler_gir, (glong) 0, offset);
930
1042
                                        gir_version = string_substring (vala_compiler_gir, offset + 1, (gir_len - offset) - 5);
931
1043
                                        g_strcanon (gir_version, "0123456789.", '?');
932
1044
                                        if (_vala_strcmp0 (gir_namespace, "") == 0) {
933
 
                                                _tmp48_ = TRUE;
934
 
                                        } else {
935
 
                                                _tmp48_ = _vala_strcmp0 (gir_version, "") == 0;
936
 
                                        }
937
 
                                        if (_tmp48_) {
938
 
                                                _tmp47_ = TRUE;
939
 
                                        } else {
940
 
                                                _tmp47_ = !g_unichar_isdigit (g_utf8_get_char (g_utf8_offset_to_pointer (gir_version, 0)));
941
 
                                        }
942
 
                                        if (_tmp47_) {
943
 
                                                _tmp46_ = TRUE;
944
 
                                        } else {
945
 
                                                _tmp46_ = string_contains (gir_version, "?");
946
 
                                        }
947
 
                                        if (_tmp46_) {
948
 
                                                char* _tmp49_;
949
 
                                                vala_report_error (NULL, _tmp49_ = g_strdup_printf ("GIR file name `%s' is not well-formed, expected NAME-VERSION.gir", vala_compiler_gir));
950
 
                                                _g_free0 (_tmp49_);
 
1045
                                                _tmp61_ = TRUE;
 
1046
                                        } else {
 
1047
                                                _tmp61_ = _vala_strcmp0 (gir_version, "") == 0;
 
1048
                                        }
 
1049
                                        if (_tmp61_) {
 
1050
                                                _tmp60_ = TRUE;
 
1051
                                        } else {
 
1052
                                                _tmp60_ = !g_unichar_isdigit (g_utf8_get_char (g_utf8_offset_to_pointer (gir_version, 0)));
 
1053
                                        }
 
1054
                                        if (_tmp60_) {
 
1055
                                                _tmp59_ = TRUE;
 
1056
                                        } else {
 
1057
                                                _tmp59_ = string_contains (gir_version, "?");
 
1058
                                        }
 
1059
                                        if (_tmp59_) {
 
1060
                                                char* _tmp62_;
 
1061
                                                vala_report_error (NULL, _tmp62_ = g_strdup_printf ("GIR file name `%s' is not well-formed, expected NAME-VERSION.gir", vala_compiler_gir));
 
1062
                                                _g_free0 (_tmp62_);
951
1063
                                        } else {
952
1064
                                                ValaGIRWriter* gir_writer;
953
1065
                                                char* gir_directory;
954
1066
                                                gir_writer = vala_gir_writer_new ();
955
1067
                                                gir_directory = g_strdup (".");
956
1068
                                                if (vala_compiler_directory != NULL) {
957
 
                                                        char* _tmp50_;
958
 
                                                        gir_directory = (_tmp50_ = g_strdup (vala_code_context_get_directory (self->priv->context)), _g_free0 (gir_directory), _tmp50_);
 
1069
                                                        char* _tmp63_;
 
1070
                                                        gir_directory = (_tmp63_ = g_strdup (vala_code_context_get_directory (self->priv->context)), _g_free0 (gir_directory), _tmp63_);
959
1071
                                                }
960
1072
                                                vala_gir_writer_write_file (gir_writer, self->priv->context, gir_directory, gir_namespace, gir_version, vala_compiler_library);
961
1073
                                                _g_free0 (gir_directory);
965
1077
                                        _g_free0 (gir_namespace);
966
1078
                                }
967
1079
                        }
968
 
                        vala_compiler_gir = (_tmp51_ = NULL, _g_free0 (vala_compiler_gir), _tmp51_);
 
1080
                        vala_compiler_gir = (_tmp64_ = NULL, _g_free0 (vala_compiler_gir), _tmp64_);
969
1081
                }
970
 
                vala_compiler_library = (_tmp52_ = NULL, _g_free0 (vala_compiler_library), _tmp52_);
 
1082
                vala_compiler_library = (_tmp65_ = NULL, _g_free0 (vala_compiler_library), _tmp65_);
971
1083
        }
972
1084
        if (vala_compiler_vapi_filename != NULL) {
973
1085
                ValaCodeWriter* interface_writer;
974
 
                gboolean _tmp53_ = FALSE;
 
1086
                gboolean _tmp66_ = FALSE;
975
1087
                interface_writer = vala_code_writer_new (FALSE, FALSE);
976
1088
                if (vala_compiler_directory != NULL) {
977
 
                        _tmp53_ = !g_path_is_absolute (vala_compiler_vapi_filename);
 
1089
                        _tmp66_ = !g_path_is_absolute (vala_compiler_vapi_filename);
978
1090
                } else {
979
 
                        _tmp53_ = FALSE;
 
1091
                        _tmp66_ = FALSE;
980
1092
                }
981
 
                if (_tmp53_) {
982
 
                        char* _tmp54_;
983
 
                        vala_compiler_vapi_filename = (_tmp54_ = g_strdup_printf ("%s%c%s", vala_code_context_get_directory (self->priv->context), (gint) G_DIR_SEPARATOR, vala_compiler_vapi_filename), _g_free0 (vala_compiler_vapi_filename), _tmp54_);
 
1093
                if (_tmp66_) {
 
1094
                        char* _tmp67_;
 
1095
                        vala_compiler_vapi_filename = (_tmp67_ = g_strdup_printf ("%s%c%s", vala_code_context_get_directory (self->priv->context), (gint) G_DIR_SEPARATOR, vala_compiler_vapi_filename), _g_free0 (vala_compiler_vapi_filename), _tmp67_);
984
1096
                }
985
1097
                vala_code_writer_write_file (interface_writer, self->priv->context, vala_compiler_vapi_filename);
986
1098
                _vala_code_visitor_unref0 (interface_writer);
987
1099
        }
988
1100
        if (vala_compiler_internal_vapi_filename != NULL) {
989
 
                gboolean _tmp55_ = FALSE;
 
1101
                gboolean _tmp68_ = FALSE;
990
1102
                ValaCodeWriter* interface_writer;
991
1103
                char* vapi_filename;
992
 
                gboolean _tmp56_ = FALSE;
993
 
                char* _tmp58_;
 
1104
                gboolean _tmp69_ = FALSE;
 
1105
                char* _tmp71_;
994
1106
                if (vala_compiler_internal_header_filename == NULL) {
995
 
                        _tmp55_ = TRUE;
 
1107
                        _tmp68_ = TRUE;
996
1108
                } else {
997
 
                        _tmp55_ = vala_compiler_header_filename == NULL;
 
1109
                        _tmp68_ = vala_compiler_header_filename == NULL;
998
1110
                }
999
 
                if (_tmp55_) {
 
1111
                if (_tmp68_) {
1000
1112
                        vala_report_error (NULL, "--internal-vapi may only be used in combination with --header and --in" \
1001
1113
"ternal-header");
1002
1114
                        result = vala_compiler_quit (self);
1012
1124
                vala_code_writer_set_cheader_override (interface_writer, vala_compiler_header_filename, vala_compiler_internal_header_filename);
1013
1125
                vapi_filename = g_strdup (vala_compiler_internal_vapi_filename);
1014
1126
                if (vala_compiler_directory != NULL) {
1015
 
                        _tmp56_ = !g_path_is_absolute (vapi_filename);
 
1127
                        _tmp69_ = !g_path_is_absolute (vapi_filename);
1016
1128
                } else {
1017
 
                        _tmp56_ = FALSE;
 
1129
                        _tmp69_ = FALSE;
1018
1130
                }
1019
 
                if (_tmp56_) {
1020
 
                        char* _tmp57_;
1021
 
                        vapi_filename = (_tmp57_ = g_strdup_printf ("%s%c%s", vala_code_context_get_directory (self->priv->context), (gint) G_DIR_SEPARATOR, vapi_filename), _g_free0 (vapi_filename), _tmp57_);
 
1131
                if (_tmp69_) {
 
1132
                        char* _tmp70_;
 
1133
                        vapi_filename = (_tmp70_ = g_strdup_printf ("%s%c%s", vala_code_context_get_directory (self->priv->context), (gint) G_DIR_SEPARATOR, vapi_filename), _g_free0 (vapi_filename), _tmp70_);
1022
1134
                }
1023
1135
                vala_code_writer_write_file (interface_writer, self->priv->context, vapi_filename);
1024
 
                vala_compiler_internal_vapi_filename = (_tmp58_ = NULL, _g_free0 (vala_compiler_internal_vapi_filename), _tmp58_);
 
1136
                vala_compiler_internal_vapi_filename = (_tmp71_ = NULL, _g_free0 (vala_compiler_internal_vapi_filename), _tmp71_);
1025
1137
                _g_free0 (vapi_filename);
1026
1138
                _vala_code_visitor_unref0 (interface_writer);
1027
1139
        }
1028
1140
        if (!vala_compiler_ccode_only) {
1029
1141
                ValaCCodeCompiler* ccompiler;
1030
 
                gboolean _tmp59_ = FALSE;
 
1142
                gboolean _tmp72_ = FALSE;
1031
1143
                ccompiler = vala_ccode_compiler_new ();
1032
1144
                if (vala_compiler_cc_command == NULL) {
1033
 
                        _tmp59_ = g_getenv ("CC") != NULL;
 
1145
                        _tmp72_ = g_getenv ("CC") != NULL;
1034
1146
                } else {
1035
 
                        _tmp59_ = FALSE;
 
1147
                        _tmp72_ = FALSE;
1036
1148
                }
1037
 
                if (_tmp59_) {
1038
 
                        char* _tmp60_;
1039
 
                        vala_compiler_cc_command = (_tmp60_ = g_strdup (g_getenv ("CC")), _g_free0 (vala_compiler_cc_command), _tmp60_);
 
1149
                if (_tmp72_) {
 
1150
                        char* _tmp73_;
 
1151
                        vala_compiler_cc_command = (_tmp73_ = g_strdup (g_getenv ("CC")), _g_free0 (vala_compiler_cc_command), _tmp73_);
1040
1152
                }
1041
1153
                if (vala_compiler_cc_options == NULL) {
1042
 
                        char** _tmp61_ = NULL;
1043
 
                        char** _tmp62_;
1044
 
                        gint _tmp62__length1;
1045
 
                        vala_ccode_compiler_compile (ccompiler, self->priv->context, vala_compiler_cc_command, (_tmp62_ = (_tmp61_ = g_new0 (char*, 0 + 1), _tmp61_), _tmp62__length1 = 0, _tmp62_), 0);
1046
 
                        _tmp62_ = (_vala_array_free (_tmp62_, _tmp62__length1, (GDestroyNotify) g_free), NULL);
 
1154
                        char** _tmp74_ = NULL;
 
1155
                        char** _tmp75_;
 
1156
                        gint _tmp75__length1;
 
1157
                        vala_ccode_compiler_compile (ccompiler, self->priv->context, vala_compiler_cc_command, (_tmp75_ = (_tmp74_ = g_new0 (char*, 0 + 1), _tmp74_), _tmp75__length1 = 0, _tmp75_), 0);
 
1158
                        _tmp75_ = (_vala_array_free (_tmp75_, _tmp75__length1, (GDestroyNotify) g_free), NULL);
1047
1159
                } else {
1048
1160
                        vala_ccode_compiler_compile (ccompiler, self->priv->context, vala_compiler_cc_command, vala_compiler_cc_options, _vala_array_length (vala_compiler_cc_options));
1049
1161
                }
1063
1175
static gboolean vala_compiler_ends_with_dir_separator (const char* s) {
1064
1176
        gboolean result = FALSE;
1065
1177
        g_return_val_if_fail (s != NULL, FALSE);
1066
 
        result = G_IS_DIR_SEPARATOR (g_utf8_get_char (g_utf8_offset_to_pointer (s, g_utf8_strlen (s, -1) - 1)));
 
1178
        result = G_IS_DIR_SEPARATOR (g_utf8_get_char (g_utf8_offset_to_pointer (s, string_get_length (s) - 1)));
1067
1179
        return result;
1068
1180
}
1069
1181
 
1147
1259
                                                _tmp6_ = FALSE;
1148
1260
                                        }
1149
1261
                                        if (_tmp6_) {
1150
 
                                                if (g_utf8_strlen (rpath, -1) > root_len) {
 
1262
                                                if (string_get_length (rpath) > root_len) {
1151
1263
                                                        {
1152
1264
                                                                gboolean _tmp7_;
1153
1265
                                                                _tmp7_ = TRUE;
1159
1271
                                                                                }
1160
1272
                                                                        }
1161
1273
                                                                        _tmp7_ = FALSE;
1162
 
                                                                        rpath = (_tmp8_ = string_substring (rpath, (glong) 0, g_utf8_strlen (rpath, -1) - 1), _g_free0 (rpath), _tmp8_);
 
1274
                                                                        rpath = (_tmp8_ = string_substring (rpath, (glong) 0, string_get_length (rpath) - 1), _g_free0 (rpath), _tmp8_);
1163
1275
                                                                }
1164
1276
                                                        }
1165
1277
                                                }
1177
1289
                        }
1178
1290
                }
1179
1291
        }
1180
 
        if (g_utf8_strlen (rpath, -1) > root_len) {
 
1292
        if (string_get_length (rpath) > root_len) {
1181
1293
                _tmp12_ = vala_compiler_ends_with_dir_separator (rpath);
1182
1294
        } else {
1183
1295
                _tmp12_ = FALSE;
1184
1296
        }
1185
1297
        if (_tmp12_) {
1186
1298
                char* _tmp13_;
1187
 
                rpath = (_tmp13_ = string_substring (rpath, (glong) 0, g_utf8_strlen (rpath, -1) - 1), _g_free0 (rpath), _tmp13_);
 
1299
                rpath = (_tmp13_ = string_substring (rpath, (glong) 0, string_get_length (rpath) - 1), _g_free0 (rpath), _tmp13_);
1188
1300
        }
1189
1301
        if (G_DIR_SEPARATOR != '/') {
1190
1302
                gint components_length1;
1577
1689
        }
1578
1690
        if (!value->data[0].v_pointer) {
1579
1691
                *object_p = NULL;
1580
 
        } else if (collect_flags && G_VALUE_NOCOPY_CONTENTS) {
 
1692
        } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
1581
1693
                *object_p = value->data[0].v_pointer;
1582
1694
        } else {
1583
1695
                *object_p = vala_compiler_ref (value->data[0].v_pointer);