[vala/wip/vapicheck: 4/4] Revert "WIP Direct parse and compile checking"




commit 134bd5079093f37aaf55750bace9987f0d8910f3
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Jan 29 18:30:39 2021 +0100

    Revert "WIP Direct parse and compile checking"
    
    This reverts commit ba802e6e039c73369118ce2892ab46e243746999.

 vapigen/Makefile.am        | 39 ++++++++++++++-------------------------
 vapigen/valavapicheck.vala | 44 ++++++++++++++++++++++----------------------
 2 files changed, 36 insertions(+), 47 deletions(-)
---
diff --git a/vapigen/Makefile.am b/vapigen/Makefile.am
index 673fe448f..cdeab3ffd 100644
--- a/vapigen/Makefile.am
+++ b/vapigen/Makefile.am
@@ -6,6 +6,16 @@ SUBDIRS = \
        vala-gen-introspect \
        $(NULL)
 
+AM_CPPFLAGS = \
+       -DG_LOG_DOMAIN=\"vapigen\" \
+       $(COVERAGE_CFLAGS) \
+       $(GLIB_CFLAGS) \
+       -I$(top_srcdir)/gee \
+       -I$(top_srcdir)/ccode \
+       -I$(top_srcdir)/vala \
+       -I$(top_srcdir)/gobject-introspection \
+       $(NULL)
+
 bin_PROGRAMS = \
        vapigen \
        $(NULL)
@@ -54,22 +64,13 @@ vapicheck.vala.stamp: $(vapicheck_VALASOURCES)
                $(VALAFLAGS) \
                -C \
                --vapidir $(top_srcdir)/vapi \
-               --vapidir $(top_srcdir)/vala --pkg libvala@PACKAGE_SUFFIX@ \
-               --vapidir $(top_srcdir)/ccode --pkg ccode \
-               --vapidir $(top_srcdir)/codegen --pkg codegen \
+               --vapidir $(top_srcdir)/gee --pkg gee \
+               --vapidir $(top_srcdir)/vala --pkg vala \
+               --vapidir $(top_srcdir)/gobject-introspection --pkg gidl \
                --pkg config \
                $^
        @touch $@
 
-vapigen_CPPFLAGS = \
-       -DG_LOG_DOMAIN=\"vapigen\" \
-       $(COVERAGE_CFLAGS) \
-       $(GLIB_CFLAGS) \
-       -I$(top_srcdir)/gee \
-       -I$(top_srcdir)/vala \
-       -I$(top_srcdir)/gobject-introspection \
-       $(NULL)
-
 vapigen_LDADD = \
        $(COVERAGE_LIBS) \
        $(GLIB_LIBS) \
@@ -77,23 +78,11 @@ vapigen_LDADD = \
        $(top_builddir)/gobject-introspection/libgidl.la \
        $(NULL)
 
-vapicheck_CPPFLAGS = \
-       -DG_LOG_DOMAIN=\"vapicheck\" \
-       $(COVERAGE_CFLAGS) \
-       $(GLIB_CFLAGS) \
-       -I$(top_srcdir)/gee \
-       -I$(top_srcdir)/vala \
-       -I$(top_srcdir)/ccode \
-       -I$(top_srcdir)/vala \
-       -I$(top_srcdir)/codegen \
-       $(NULL)
-
 vapicheck_LDADD = \
        $(COVERAGE_LIBS) \
        $(GLIB_LIBS) \
        $(top_builddir)/vala/libvala@PACKAGE_SUFFIX@.la \
-       $(top_builddir)/ccode/libvalaccode.la \
-       $(top_builddir)/codegen/libvalaccodegen.la \
+       $(top_builddir)/gobject-introspection/libgidl.la \
        $(NULL)
 
 if ENABLE_UNVERSIONED
diff --git a/vapigen/valavapicheck.vala b/vapigen/valavapicheck.vala
index 83b0fa396..45833d7c0 100644
--- a/vapigen/valavapicheck.vala
+++ b/vapigen/valavapicheck.vala
@@ -390,15 +390,6 @@ class Vala.VapiCheck {
                        return quit ();
                }
 
-               var codegen = new Codegen ();
-               foreach (SourceFile file in context.get_source_files ()) {
-                       if (file.filename != source_filename) {
-                               continue;
-                       }
-                       codegen.run (context, file);
-                       break;
-               }
-
                if (fast_vapi_filename != null) {
                        var interface_writer = new CodeWriter (CodeWriterType.FAST);
                        interface_writer.write_file (context, fast_vapi_filename);
@@ -418,6 +409,15 @@ class Vala.VapiCheck {
                        }
                }
 
+               var codegen = new Codegen ();
+               foreach (SourceFile file in context.get_source_files ()) {
+                       if (file.filename != source_filename) {
+                               continue;
+                       }
+                       codegen.run (context, file);
+                       break;
+               }
+
                if (dump_tree != null) {
                        var code_writer = new CodeWriter (CodeWriterType.DUMP);
                        code_writer.write_file (context, dump_tree);
@@ -427,7 +427,7 @@ class Vala.VapiCheck {
                        return quit ();
                }
 
-               context.codegen.emit (context);
+               //context.codegen.emit (context);
 
                if (context.report.get_errors () > 0 || (fatal_warnings && context.report.get_warnings () > 
0)) {
                        return quit ();
@@ -532,14 +532,14 @@ class Vala.VapiCheck {
                }
                
                if (!ccode_only) {
-                       var ccompiler = new CCodeCompiler ();
+                       //var ccompiler = new CCodeCompiler ();
                        if (cc_command == null && Environment.get_variable ("CC") != null) {
                                cc_command = Environment.get_variable ("CC");
                        }
                        if (cc_options == null) {
-                               ccompiler.compile (context, cc_command, new string[] { });
+                               //ccompiler.compile (context, cc_command, new string[] { });
                        } else {
-                               ccompiler.compile (context, cc_command, cc_options);
+                               //ccompiler.compile (context, cc_command, cc_options);
                        }
                }
 
@@ -611,7 +611,7 @@ public class Codegen : Vala.CodeVisitor {
                b.add_statement (decl);
                block.add_statement (b);
 
-               //b.check (context);
+               b.check (context);
                current_block = b;
                element.accept_children (this);
        }
@@ -628,7 +628,7 @@ public class Codegen : Vala.CodeVisitor {
                b.add_statement (decl);
                block.add_statement (b);
 
-               //b.check (context);
+               b.check (context);
                current_block = b;
                element.accept_children (this);
        }
@@ -650,7 +650,7 @@ public class Codegen : Vala.CodeVisitor {
                b.add_statement (decl);
                block.add_statement (b);
 
-               //b.check (context);
+               b.check (context);
                current_block = b;
                element.accept_children (this);
        }
@@ -671,7 +671,7 @@ public class Codegen : Vala.CodeVisitor {
                }
 
                current_block.add_statement (b);
-               //current_block.check (context);
+               current_block.check (context);
        }
 
        public override void visit_property (Vala.Property element) {
@@ -711,7 +711,7 @@ public class Codegen : Vala.CodeVisitor {
 
                var stmt = new ExpressionStatement (mcall);
                b.add_statement (stmt);
-               //b.check (context);
+               b.check (context);
                block.add_statement (b);
        }
 
@@ -772,7 +772,7 @@ public class Codegen : Vala.CodeVisitor {
                        b.add_statement (new ExpressionStatement (mcall));
                }
 
-               //b.check (context);
+               b.check (context);
                block.add_statement (b);
        }
 
@@ -804,7 +804,7 @@ public class Codegen : Vala.CodeVisitor {
                append_arguments (b, mcall, parameters, ref i);
                b.add_statement (new ExpressionStatement (mcall));
 
-               //b.check (context);
+               b.check (context);
                block.add_statement (b);
        }
 
@@ -820,7 +820,7 @@ public class Codegen : Vala.CodeVisitor {
                var b = new Block ();
                var decl = new DeclarationStatement (new LocalVariable (new VarType (false), "v", 
get_member_access (element), element.source_reference));
                b.add_statement (decl);
-               //b.check (context);
+               b.check (context);
 
                var assert = new MethodCall (new MemberAccess (null, "assert"));
                assert.add_argument (new BinaryExpression (BinaryOperator.EQUALITY, new MemberAccess (null, 
"v"), get_member_access (element)));
@@ -837,7 +837,7 @@ public class Codegen : Vala.CodeVisitor {
                var b = new Block ();
                var decl = new DeclarationStatement (new LocalVariable (get_local_type 
(element.type_reference), "v", get_member_access (element), element.source_reference));
                b.add_statement (decl);
-               //b.check (context);
+               b.check (context);
 
                var assert = new MethodCall (new MemberAccess (null, "assert"));
                assert.add_argument (new BinaryExpression (BinaryOperator.EQUALITY, new MemberAccess (null, 
"v"), get_member_access (element)));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]