[vala] codegen: Do not create unused real functions for interface methods
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Do not create unused real functions for interface methods
- Date: Tue, 21 Dec 2010 21:35:30 +0000 (UTC)
commit 31722a7d1cb75ce24dc0423ddc003f2b702ee2cb
Author: Jürg Billeter <j bitron ch>
Date: Tue Dec 21 21:51:01 2010 +0100
codegen: Do not create unused real functions for interface methods
codegen/valaccodemethodmodule.vala | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index c2d4b88..428dac1 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.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]