]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Don't emit invoker for methods attributed with NoWrapper
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 30 Jan 2021 10:44:17 +0000 (11:44 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 30 Jan 2021 12:18:58 +0000 (13:18 +0100)
codegen/valaccodemethodmodule.vala

index ae05c917a0405f97e5a2abf47a94244c83388e76..4672735478be88ca96be696c1264db887de0ef8d 100644 (file)
@@ -335,7 +335,9 @@ 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.signal_reference == null) {
+                   || (m.base_method == null && m.base_interface_method == null))
+                   && m.get_attribute ("NoWrapper") == null
+                   && m.signal_reference == null) {
                        generate_method_declaration (m, cfile);
 
                        if (!m.is_internal_symbol ()) {
@@ -807,11 +809,11 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
 
                pop_context ();
 
-               if ((m.is_abstract || m.is_virtual) && !m.coroutine &&
-               /* If the method is a signal handler, the declaration
-                * is not needed. -- the name should be reserved for the
-                * emitter! */
-                           m.signal_reference == null) {
+               if ((m.is_abstract || m.is_virtual) && !m.coroutine
+                   && m.get_attribute ("NoWrapper") == null
+                   // If the method is a signal handler, the declaration is not needed.
+                   // the name should be reserved for the emitter!
+                   && m.signal_reference == null) {
 
                        cparam_map = new HashMap<int,CCodeParameter> (direct_hash, direct_equal);
                        var carg_map = new HashMap<int,CCodeExpression> (direct_hash, direct_equal);