[vala: 8/8] DEBUG




commit 9319f309dd97532a3174de995a83884739d70460
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Nov 14 08:19:23 2020 +0100

    DEBUG

 codegen/valaccodebasemodule.vala       | 20 ++++++++++++++++++++
 codegen/valaccodemethodcallmodule.vala |  1 +
 vala/valaparameter.vala                |  5 +++++
 3 files changed, 26 insertions(+)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 41736e528..c6391d387 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -2720,6 +2720,12 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        public TargetValue store_temp_value (TargetValue initializer, CodeNode node_reference, bool? 
value_owned = null) {
                var lvalue = create_temp_value (initializer.value_type, false, node_reference, value_owned);
                store_value (lvalue, initializer, node_reference.source_reference);
+               if (lvalue.value_type is ArrayType) {
+                       stdout.printf ("%s tweaked\n", node_reference.to_string ());
+                       /*((GLibValue) lvalue).array_length_cvalues = null;
+                       ((GLibValue) lvalue).array_size_cvalue = null;
+                       ((GLibValue) lvalue).array_length_cexpr = null;*/
+               }
                return load_temp_value (lvalue);
        }
 
@@ -5224,6 +5230,12 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        }
 
        public override void visit_sizeof_expression (SizeofExpression expr) {
+               // FIXME
+               if (expr.value_type == null) {
+                       warning ("BAD %s\n", expr.to_string ());
+                       expr.value_type = context.analyzer.ulong_type.copy ();
+               }
+
                generate_type_declaration (expr.type_reference, cfile);
 
                var csizeof = new CCodeFunctionCall (new CCodeIdentifier ("sizeof"));
@@ -5238,6 +5250,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        }
 
        public override void visit_unary_expression (UnaryExpression expr) {
+               assert (expr.checked);
                if (expr.operator == UnaryOperator.REF || expr.operator == UnaryOperator.OUT) {
                        var glib_value = (GLibValue) expr.inner.target_value;
 
@@ -5845,6 +5858,13 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        }
 
        public override void visit_type_check (TypeCheck expr) {
+               assert (expr.checked);
+               // FIXME
+               if (expr.value_type == null) {
+                       warning ("BAD %s\n", expr.to_string ());
+                       expr.value_type = context.analyzer.bool_type.copy ();
+               }
+
                generate_type_declaration (expr.type_reference, cfile);
 
                var type = expr.expression.value_type;
diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala
index c196928c8..6abc25e2d 100644
--- a/codegen/valaccodemethodcallmodule.vala
+++ b/codegen/valaccodemethodcallmodule.vala
@@ -431,6 +431,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                                                var temp_var = get_temp_variable (param.variable_type, 
param.variable_type.value_owned, null, true);
                                                emit_temp_var (temp_var);
                                                set_cvalue (arg, get_variable_cexpression (temp_var.name));
+                                               stdout.printf ("%s.%s\n", param.parent_symbol.to_string (), 
param.name);
                                                arg.target_value.value_type = arg.target_type.copy ();
 
                                                cexpr = new CCodeUnaryExpression 
(CCodeUnaryOperator.ADDRESS_OF, get_cvalue (arg));
diff --git a/vala/valaparameter.vala b/vala/valaparameter.vala
index 41a59da61..05a1e9f65 100644
--- a/vala/valaparameter.vala
+++ b/vala/valaparameter.vala
@@ -138,6 +138,11 @@ public class Vala.Parameter : Variable {
                if (source_reference != null) {
                        context.analyzer.current_source_file = source_reference.file;
                }
+               
+               if (parent_symbol == null) {
+                       stdout.printf ("%s\n", name);
+                       assert_not_reached ();
+               }
                context.analyzer.current_symbol = parent_symbol;
 
                if (variable_type != null) {


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