[vala/0.48] codegen: Don't emit invoker for async methods attributed with NoWrapper



commit 273a7cdd26dfad9e2bb2c4e74d13d02b2d00ddd5
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Jan 31 13:04:52 2021 +0100

    codegen: Don't emit invoker for async methods attributed with NoWrapper

 codegen/valaccodebasemodule.vala   | 2 +-
 codegen/valaccodemethodmodule.vala | 4 +++-
 codegen/valagasyncmodule.vala      | 5 ++++-
 3 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 04c722f6e..e08556b90 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -4730,7 +4730,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        }
 
        public virtual bool generate_method_declaration (Method m, CCodeFile decl_space) {
-               return !add_symbol_declaration (decl_space, m, get_ccode_name (m));
+               return false;
        }
 
        public virtual void generate_error_domain_declaration (ErrorDomain edomain, CCodeFile decl_space) {
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index fecaf1b70..3f3f2e3ca 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -157,6 +157,9 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
                if (m.is_async_callback) {
                        return false;
                }
+               if ((m.is_abstract || m.is_virtual) && m.get_attribute ("NoWrapper") != null) {
+                       return false;
+               }
                if (add_symbol_declaration (decl_space, m, get_ccode_name (m))) {
                        return false;
                }
@@ -340,7 +343,6 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
                // do not declare overriding methods and interface implementations
                if ((m.is_abstract || m.is_virtual
                    || (m.base_method == null && m.base_interface_method == null))
-                   && m.get_attribute ("NoWrapper") == null
                    && m.signal_reference == null) {
                        generate_method_declaration (m, cfile);
 
diff --git a/codegen/valagasyncmodule.vala b/codegen/valagasyncmodule.vala
index 5fe6fd64e..c927c41f8 100644
--- a/codegen/valagasyncmodule.vala
+++ b/codegen/valagasyncmodule.vala
@@ -318,6 +318,9 @@ public class Vala.GAsyncModule : GtkModule {
 
        public override bool generate_method_declaration (Method m, CCodeFile decl_space) {
                if (m.coroutine) {
+                       if ((m.is_abstract || m.is_virtual) && m.get_attribute ("NoWrapper") != null) {
+                               return false;
+                       }
                        if (add_symbol_declaration (decl_space, m, get_ccode_name (m))) {
                                return false;
                        }
@@ -429,7 +432,7 @@ public class Vala.GAsyncModule : GtkModule {
                                }
                        }
 
-                       if (m.is_abstract || m.is_virtual) {
+                       if ((m.is_abstract || m.is_virtual) && m.get_attribute ("NoWrapper") == null) {
                                // generate virtual function wrappers
                                var cparam_map = new HashMap<int,CCodeParameter> (direct_hash, direct_equal);
                                var carg_map = new HashMap<int,CCodeExpression> (direct_hash, direct_equal);


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