From: Jürg Billeter Date: Tue, 21 Dec 2010 20:51:01 +0000 (+0100) Subject: codegen: Do not create unused real functions for interface methods X-Git-Tag: 0.11.3~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31722a7d1cb75ce24dc0423ddc003f2b702ee2cb;p=thirdparty%2Fvala.git codegen: Do not create unused real functions for interface methods --- diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala index c2d4b880f..428dac1e6 100644 --- a/codegen/valaccodemethodmodule.vala +++ b/codegen/valaccodemethodmodule.vala @@ -331,14 +331,8 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule { } else if (m.is_private_symbol ()) { function.modifiers |= CCodeModifiers.STATIC; } - } - } - - // generate *_real_* functions for virtual methods - // also generate them for abstract methods of classes to prevent faulty subclassing - if (!m.is_abstract || (m.is_abstract && current_type_symbol is Class)) { - if (m.body != null) { - if (m.coroutine) { + } else { + if (m.body != null) { function = new CCodeFunction (m.get_real_cname () + "_co", "gboolean"); // data struct to hold parameters, local variables, and the return value @@ -644,7 +638,7 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule { } } - if (m.is_abstract) { + if (m.is_abstract && current_type_symbol is Class) { // generate helpful error message if a sublcass does not implement an abstract method. // This is only meaningful for subclasses implemented in C since the vala compiler would // complain during compile time of such en error.