Commit 449a0c01 authored by Jürg Billeter's avatar Jürg Billeter

codegen: Drop CCodeModule

parent 664ebfd2
......@@ -22,11 +22,9 @@ libvala_la_VALASOURCES = \
valaccodecontrolflowmodule.vala \
valaccodedeclarationspace.vala \
valaccodedelegatemodule.vala \
valaccodegenerator.vala \
valaccodememberaccessmodule.vala \
valaccodemethodcallmodule.vala \
valaccodemethodmodule.vala \
valaccodemodule.vala \
valaccodestructmodule.vala \
valaclassregisterfunction.vala \
valactype.vala \
......
......@@ -27,10 +27,6 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
int next_array_dup_id = 0;
int next_array_add_id = 0;
public CCodeArrayModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
void append_initializer_list (CCodeCommaExpression ce, CCodeExpression name_cnode, InitializerList initializer_list, int rank, ref int i) {
foreach (Expression e in initializer_list.get_initializers ()) {
if (rank > 1) {
......@@ -411,7 +407,7 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
var memberaccess = expr.container as MemberAccess;
if (lit != null && memberaccess != null) {
int dim = lit.value.to_int ();
expr.ccodenode = head.get_array_length_cexpression (memberaccess.inner, dim + 1);
expr.ccodenode = get_array_length_cexpression (memberaccess.inner, dim + 1);
} else {
Report.error (expr.source_reference, "only integer literals supported as index");
}
......@@ -430,7 +426,7 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
} else {
// access to element in an array
for (int i = 1; i < rank; i++) {
var cmul = new CCodeBinaryExpression (CCodeBinaryOperator.MUL, cindex, head.get_array_length_cexpression (expr.container, i + 1));
var cmul = new CCodeBinaryExpression (CCodeBinaryOperator.MUL, cindex, get_array_length_cexpression (expr.container, i + 1));
cindex = new CCodeBinaryExpression (CCodeBinaryOperator.PLUS, cmul, (CCodeExpression) indices[i].ccodenode);
}
expr.ccodenode = new CCodeElementAccess (ccontainer, cindex);
......@@ -1039,7 +1035,7 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
}
for (int dim = 1; dim <= array_type.rank; dim++) {
var cparam = new CCodeFormalParameter (head.get_array_length_cname (get_variable_cname (param.name), dim), length_ctype);
var cparam = new CCodeFormalParameter (get_array_length_cname (get_variable_cname (param.name), dim), length_ctype);
cparam_map.set (get_param_pos (param.carray_length_parameter_position + 0.01 * dim), cparam);
if (carg_map != null) {
carg_map.set (get_param_pos (param.carray_length_parameter_position + 0.01 * dim), get_variable_cexpression (cparam.name));
......
......@@ -28,10 +28,6 @@ using GLib;
* The link between an assignment and generated code.
*/
public class Vala.CCodeAssignmentModule : CCodeMemberAccessModule {
public CCodeAssignmentModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
CCodeExpression emit_property_assignment (Assignment assignment) {
var ma = assignment.left as MemberAccess;
......@@ -50,7 +46,7 @@ public class Vala.CCodeAssignmentModule : CCodeMemberAccessModule {
}
if (prop.set_accessor.construction && current_type_symbol is Class && current_class.is_subtype_of (gobject_type) && in_creation_method) {
return head.get_construct_property_assignment (prop.get_canonical_cconstant (), prop.property_type, (CCodeExpression) assignment.right.ccodenode);
return get_construct_property_assignment (prop.get_canonical_cconstant (), prop.property_type, (CCodeExpression) assignment.right.ccodenode);
} else {
CCodeExpression cexpr = (CCodeExpression) assignment.right.ccodenode;
......@@ -150,8 +146,8 @@ public class Vala.CCodeAssignmentModule : CCodeMemberAccessModule {
if (array) {
var array_type = (ArrayType) assignment.left.value_type;
for (int dim = 1; dim <= array_type.rank; dim++) {
var lhs_array_len = head.get_array_length_cexpression (assignment.left, dim);
var rhs_array_len = head.get_array_length_cexpression (assignment.right, dim);
var lhs_array_len = get_array_length_cexpression (assignment.left, dim);
var rhs_array_len = get_array_length_cexpression (assignment.right, dim);
ccomma.append_expression (new CCodeAssignment (lhs_array_len, rhs_array_len));
}
if (array_type.rank == 1) {
......@@ -159,8 +155,8 @@ public class Vala.CCodeAssignmentModule : CCodeMemberAccessModule {
var array_local = array_var as LocalVariable;
if (array_var != null && array_var.is_internal_symbol ()
&& ((array_var is LocalVariable && !array_local.captured) || array_var is Field)) {
var lhs_array_size = head.get_array_size_cexpression (assignment.left);
var rhs_array_len = head.get_array_length_cexpression (assignment.left, 1);
var lhs_array_size = get_array_size_cexpression (assignment.left);
var rhs_array_len = get_array_length_cexpression (assignment.left, 1);
ccomma.append_expression (new CCodeAssignment (lhs_array_size, rhs_array_len));
}
}
......
This diff is collapsed.
......@@ -25,14 +25,10 @@
using GLib;
public class Vala.CCodeControlFlowModule : CCodeMethodModule {
public CCodeControlFlowModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
public override void visit_if_statement (IfStatement stmt) {
stmt.true_statement.emit (codegen);
stmt.true_statement.emit (this);
if (stmt.false_statement != null) {
stmt.false_statement.emit (codegen);
stmt.false_statement.emit (this);
}
if (stmt.false_statement != null) {
......@@ -193,7 +189,7 @@ public class Vala.CCodeControlFlowModule : CCodeMethodModule {
public override void visit_switch_statement (SwitchStatement stmt) {
foreach (SwitchSection section in stmt.get_sections ()) {
section.emit (codegen);
section.emit (this);
}
if (stmt.expression.value_type.compatible (string_type)) {
......@@ -227,14 +223,14 @@ public class Vala.CCodeControlFlowModule : CCodeMethodModule {
public override void visit_switch_label (SwitchLabel label) {
if (label.expression != null) {
label.expression.emit (codegen);
label.expression.emit (this);
codegen.visit_end_full_expression (label.expression);
visit_end_full_expression (label.expression);
}
}
public override void visit_loop (Loop stmt) {
stmt.body.emit (codegen);
stmt.body.emit (this);
if (context.profile == Profile.GOBJECT) {
stmt.ccodenode = new CCodeWhileStatement (new CCodeConstant ("TRUE"), (CCodeStatement) stmt.body.ccodenode);
......@@ -245,7 +241,7 @@ public class Vala.CCodeControlFlowModule : CCodeMethodModule {
}
public override void visit_foreach_statement (ForeachStatement stmt) {
stmt.body.emit (codegen);
stmt.body.emit (this);
visit_block (stmt);
......@@ -280,22 +276,22 @@ public class Vala.CCodeControlFlowModule : CCodeMethodModule {
if (stmt.tree_can_fail && stmt.collection.tree_can_fail) {
// exception handling
cfrag = new CCodeFragment ();
head.add_simple_check (stmt.collection, cfrag);
add_simple_check (stmt.collection, cfrag);
cblock.add_statement (cfrag);
}
if (stmt.collection.value_type is ArrayType) {
array_type = (ArrayType) stmt.collection.value_type;
var array_len = head.get_array_length_cexpression (stmt.collection);
var array_len = get_array_length_cexpression (stmt.collection);
// store array length for use by _vala_array_free
if (current_method != null && current_method.coroutine) {
closure_struct.add_field ("int", head.get_array_length_cname (collection_backup.name, 1));
cblock.add_statement (new CCodeExpressionStatement (new CCodeAssignment (get_variable_cexpression (head.get_array_length_cname (collection_backup.name, 1)), array_len)));
closure_struct.add_field ("int", get_array_length_cname (collection_backup.name, 1));
cblock.add_statement (new CCodeExpressionStatement (new CCodeAssignment (get_variable_cexpression (get_array_length_cname (collection_backup.name, 1)), array_len)));
} else {
var clendecl = new CCodeDeclaration ("int");
clendecl.add_declarator (new CCodeVariableDeclarator (head.get_array_length_cname (collection_backup.name, 1), array_len));
clendecl.add_declarator (new CCodeVariableDeclarator (get_array_length_cname (collection_backup.name, 1), array_len));
cblock.add_statement (clendecl);
}
......@@ -336,11 +332,11 @@ public class Vala.CCodeControlFlowModule : CCodeMethodModule {
var inner_array_type = (ArrayType) stmt.type_reference;
for (int dim = 1; dim <= inner_array_type.rank; dim++) {
if (current_method != null && current_method.coroutine) {
closure_struct.add_field ("int", head.get_array_length_cname (stmt.variable_name, dim));
cbody.add_statement (new CCodeExpressionStatement (new CCodeAssignment (get_variable_cexpression (head.get_array_length_cname (stmt.variable_name, dim)), new CCodeConstant ("-1"))));
closure_struct.add_field ("int", get_array_length_cname (stmt.variable_name, dim));
cbody.add_statement (new CCodeExpressionStatement (new CCodeAssignment (get_variable_cexpression (get_array_length_cname (stmt.variable_name, dim)), new CCodeConstant ("-1"))));
} else {
var cdecl = new CCodeDeclaration ("int");
cdecl.add_declarator (new CCodeVariableDeclarator (head.get_array_length_cname (stmt.variable_name, dim), new CCodeConstant ("-1")));
cdecl.add_declarator (new CCodeVariableDeclarator (get_array_length_cname (stmt.variable_name, dim), new CCodeConstant ("-1")));
cbody.add_statement (cdecl);
}
}
......
......@@ -27,10 +27,6 @@
* The link between an assignment and generated code.
*/
public class Vala.CCodeDelegateModule : CCodeArrayModule {
public CCodeDelegateModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
public override void generate_delegate_declaration (Delegate d, CCodeDeclarationSpace decl_space) {
if (decl_space.add_symbol_declaration (d, d.get_cname ())) {
return;
......@@ -66,7 +62,7 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
}
for (int dim = 1; dim <= array_type.rank; dim++) {
var cparam = new CCodeFormalParameter (head.get_array_length_cname (get_variable_cname (param.name), dim), length_ctype);
var cparam = new CCodeFormalParameter (get_array_length_cname (get_variable_cname (param.name), dim), length_ctype);
cfundecl.add_parameter (cparam);
}
}
......@@ -85,7 +81,7 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
var array_type = (ArrayType) d.return_type;
for (int dim = 1; dim <= array_type.rank; dim++) {
var cparam = new CCodeFormalParameter (head.get_array_length_cname ("result", dim), "int*");
var cparam = new CCodeFormalParameter (get_array_length_cname ("result", dim), "int*");
cfundecl.add_parameter (cparam);
}
} else if (d.return_type is DelegateType) {
......@@ -116,7 +112,7 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
}
public override void visit_delegate (Delegate d) {
d.accept_children (codegen);
d.accept_children (this);
generate_delegate_declaration (d, source_declarations);
......@@ -356,7 +352,7 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
var sig = d.parent_symbol as Signal;
var dynamic_sig = sig as DynamicSignal;
if (dynamic_sig != null) {
delegate_name = head.get_dynamic_signal_cname (dynamic_sig);
delegate_name = get_dynamic_signal_cname (dynamic_sig);
} else if (sig != null) {
delegate_name = sig.parent_symbol.get_lower_case_cprefix () + sig.get_cname ();
} else {
......@@ -412,7 +408,7 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
var array_type = (ArrayType) d.return_type;
for (int dim = 1; dim <= array_type.rank; dim++) {
var cparam = new CCodeFormalParameter (head.get_array_length_cname ("result", dim), "int*");
var cparam = new CCodeFormalParameter (get_array_length_cname ("result", dim), "int*");
cparam_map.set (get_param_pos (d.carray_length_parameter_position + 0.01 * dim), cparam);
}
} else if (d.return_type is DelegateType) {
......@@ -501,7 +497,7 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
} else if (d_params.get (i).no_array_length) {
clength = new CCodeConstant ("-1");
} else {
clength = new CCodeIdentifier (head.get_array_length_cname (d_params.get (i).name, dim));
clength = new CCodeIdentifier (get_array_length_cname (d_params.get (i).name, dim));
}
carg_map.set (get_param_pos (param.carray_length_parameter_position + 0.01 * dim), clength);
}
......@@ -523,7 +519,7 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
if (d.no_array_length) {
clength = new CCodeConstant ("NULL");
} else {
clength = new CCodeIdentifier (head.get_array_length_cname ("result", dim));
clength = new CCodeIdentifier (get_array_length_cname ("result", dim));
}
carg_map.set (get_param_pos (m.carray_length_parameter_position + 0.01 * dim), clength);
}
......
/* valaccodegenerator.vala
*
* Copyright (C) 2006-2010 Jürg Billeter
* Copyright (C) 2006-2008 Raffaele Sandrini
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author:
* Jürg Billeter <j@bitron.ch>
* Raffaele Sandrini <raffaele@sandrini.ch>
*/
using GLib;
/**
* Code visitor generating C Code.
*/
public class Vala.CCodeGenerator : CodeGenerator {
public CCodeModule head;
public CCodeGenerator () {
}
public override void emit (CodeContext context) {
if (context.profile == Profile.GOBJECT) {
/* included by inheritance
head = new CCodeBaseModule (this, head);
head = new CCodeStructModule (this, head);
head = new CCodeMethodModule (this, head);
head = new CCodeControlFlowModule (this, head);
head = new CCodeMemberAccessModule (this, head);
head = new CCodeAssignmentModule (this, head);
head = new CCodeMethodCallModule (this, head);
head = new CCodeArrayModule (this, head);
head = new CCodeDelegateModule (this, head);
head = new GErrorModule (this, head);
head = new GTypeModule (this, head);
head = new GObjectModule (this, head);
head = new GSignalModule (this, head);
head = new GAsyncModule (this, head);
*/
if (context.has_package ("dbus-glib-1")) {
/*
head = new DBusModule (this, head);
head = new DBusClientModule (this, head);
*/
head = new DBusServerModule (this, head);
} else {
/*
head = new GVariantModule (this, head);
head = new GDBusClientModule (this, head);
*/
head = new GDBusServerModule (this, head);
}
} else if (context.profile == Profile.DOVA) {
/* included by inheritance
head = new DovaBaseModule (this, head);
head = new DovaStructModule (this, head);
head = new DovaMethodModule (this, head);
head = new DovaControlFlowModule (this, head);
head = new DovaMemberAccessModule (this, head);
head = new DovaAssignmentModule (this, head);
head = new DovaMethodCallModule (this, head);
head = new DovaArrayModule (this, head);
head = new DovaObjectModule (this, head);
head = new DovaValueModule (this, head);
head = new DovaDelegateModule (this, head);
*/
head = new DovaErrorModule (this, head);
} else {
/* included by inheritance
head = new CCodeBaseModule (this, head);
head = new CCodeStructModule (this, head);
head = new CCodeMethodModule (this, head);
head = new CCodeControlFlowModule (this, head);
head = new CCodeMemberAccessModule (this, head);
head = new CCodeAssignmentModule (this, head);
head = new CCodeMethodCallModule (this, head);
head = new CCodeArrayModule (this, head);
*/
head = new CCodeDelegateModule (this, head);
}
head = add_modules (head);
head.emit (context);
head = null;
}
public virtual CCodeModule add_modules (CCodeModule head) {
return head;
}
public override void visit_source_file (SourceFile source_file) {
head.visit_source_file (source_file);
}
public override void visit_class (Class cl) {
head.visit_class (cl);
}
public override void visit_interface (Interface iface) {
head.visit_interface (iface);
}
public override void visit_struct (Struct st) {
head.visit_struct (st);
}
public override void visit_enum (Enum en) {
head.visit_enum (en);
}
public override void visit_error_domain (ErrorDomain edomain) {
head.visit_error_domain (edomain);
}
public override void visit_delegate (Delegate d) {
head.visit_delegate (d);
}
public override void visit_constant (Constant c) {
head.visit_constant (c);
}
public override void visit_field (Field f) {
head.visit_field (f);
}
public override void visit_method (Method m) {
head.visit_method (m);
}
public override void visit_creation_method (CreationMethod m) {
head.visit_creation_method (m);
}
public override void visit_formal_parameter (FormalParameter p) {
head.visit_formal_parameter (p);
}
public override void visit_property (Property prop) {
head.visit_property (prop);
}
public override void visit_property_accessor (PropertyAccessor acc) {
head.visit_property_accessor (acc);
}
public override void visit_signal (Signal sig) {
head.visit_signal (sig);
}
public override void visit_constructor (Constructor c) {
head.visit_constructor (c);
}
public override void visit_destructor (Destructor d) {
head.visit_destructor (d);
}
public override void visit_block (Block b) {
head.visit_block (b);
}
public override void visit_empty_statement (EmptyStatement stmt) {
head.visit_empty_statement (stmt);
}
public override void visit_declaration_statement (DeclarationStatement stmt) {
head.visit_declaration_statement (stmt);
}
public override void visit_local_variable (LocalVariable local) {
head.visit_local_variable (local);
}
public override void visit_initializer_list (InitializerList list) {
head.visit_initializer_list (list);
}
public override void visit_end_full_expression (Expression expr) {
head.visit_end_full_expression (expr);
}
public override void visit_expression_statement (ExpressionStatement stmt) {
head.visit_expression_statement (stmt);
}
public override void visit_if_statement (IfStatement stmt) {
head.visit_if_statement (stmt);
}
public override void visit_switch_statement (SwitchStatement stmt) {
head.visit_switch_statement (stmt);
}
public override void visit_switch_section (SwitchSection section) {
head.visit_switch_section (section);
}
public override void visit_switch_label (SwitchLabel label) {
head.visit_switch_label (label);
}
public override void visit_loop (Loop stmt) {
head.visit_loop (stmt);
}
public override void visit_foreach_statement (ForeachStatement stmt) {
head.visit_foreach_statement (stmt);
}
public override void visit_break_statement (BreakStatement stmt) {
head.visit_break_statement (stmt);
}
public override void visit_continue_statement (ContinueStatement stmt) {
head.visit_continue_statement (stmt);
}
public override void visit_return_statement (ReturnStatement stmt) {
head.visit_return_statement (stmt);
}
public override void visit_yield_statement (YieldStatement stmt) {
head.visit_yield_statement (stmt);
}
public override void visit_throw_statement (ThrowStatement stmt) {
head.visit_throw_statement (stmt);
}
public override void visit_try_statement (TryStatement stmt) {
head.visit_try_statement (stmt);
}
public override void visit_catch_clause (CatchClause clause) {
head.visit_catch_clause (clause);
}
public override void visit_lock_statement (LockStatement stmt) {
head.visit_lock_statement (stmt);
}
public override void visit_unlock_statement (UnlockStatement stmt) {
head.visit_unlock_statement (stmt);
}
public override void visit_delete_statement (DeleteStatement stmt) {
head.visit_delete_statement (stmt);
}
public override void visit_expression (Expression expr) {
head.visit_expression (expr);
}
public override void visit_array_creation_expression (ArrayCreationExpression expr) {
head.visit_array_creation_expression (expr);
}
public override void visit_boolean_literal (BooleanLiteral expr) {
head.visit_boolean_literal (expr);
}
public override void visit_character_literal (CharacterLiteral expr) {
head.visit_character_literal (expr);
}
public override void visit_integer_literal (IntegerLiteral expr) {
head.visit_integer_literal (expr);
}
public override void visit_real_literal (RealLiteral expr) {
head.visit_real_literal (expr);
}
public override void visit_string_literal (StringLiteral expr) {
head.visit_string_literal (expr);
}
public override void visit_list_literal (ListLiteral expr) {
head.visit_list_literal (expr);
}
public override void visit_set_literal (SetLiteral expr) {
head.visit_set_literal (expr);
}
public override void visit_map_literal (MapLiteral expr) {
head.visit_map_literal (expr);
}
public override void visit_tuple (Tuple expr) {
head.visit_tuple (expr);
}
public override void visit_regex_literal (RegexLiteral expr) {
head.visit_regex_literal (expr);
}
public override void visit_null_literal (NullLiteral expr) {
head.visit_null_literal (expr);
}
public override void visit_member_access (MemberAccess expr) {
head.visit_member_access (expr);
}
public override void visit_method_call (MethodCall expr) {
head.visit_method_call (expr);
}
public override void visit_element_access (ElementAccess expr) {
head.visit_element_access (expr);
}
public override void visit_slice_expression (SliceExpression expr) {
head.visit_slice_expression (expr);
}
public override void visit_base_access (BaseAccess expr) {
head.visit_base_access (expr);
}
public override void visit_postfix_expression (PostfixExpression expr) {
head.visit_postfix_expression (expr);
}
public override void visit_object_creation_expression (ObjectCreationExpression expr) {
head.visit_object_creation_expression (expr);
}
public override void visit_sizeof_expression (SizeofExpression expr) {
head.visit_sizeof_expression (expr);
}
public override void visit_typeof_expression (TypeofExpression expr) {
head.visit_typeof_expression (expr);
}
public override void visit_unary_expression (UnaryExpression expr) {
head.visit_unary_expression (expr);
}
public override void visit_cast_expression (CastExpression expr) {
head.visit_cast_expression (expr);
}
public override void visit_named_argument (NamedArgument expr) {
head.visit_named_argument (expr);
}
public override void visit_pointer_indirection (PointerIndirection expr) {
head.visit_pointer_indirection (expr);
}
public override void visit_addressof_expression (AddressofExpression expr) {
head.visit_addressof_expression (expr);
}
public override void visit_reference_transfer_expression (ReferenceTransferExpression expr) {
head.visit_reference_transfer_expression (expr);
}
public override void visit_binary_expression (BinaryExpression expr) {
head.visit_binary_expression (expr);
}
public override void visit_type_check (TypeCheck expr) {
head.visit_type_check (expr);
}
public override void visit_lambda_expression (LambdaExpression l) {
head.visit_lambda_expression (l);
}
public override void visit_assignment (Assignment a) {
head.visit_assignment (a);
}
}
......@@ -22,13 +22,7 @@
* Raffaele Sandrini <raffaele@sandrini.ch>
*/
using GLib;
public class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
public CCodeMemberAccessModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
public override void visit_member_access (MemberAccess expr) {
CCodeExpression pub_inst = null;
......@@ -69,7 +63,7 @@ public class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
}
if (m.base_method != null) {
if (!head.method_has_wrapper (m.base_method)) {
if (!method_has_wrapper (m.base_method)) {
var inst = pub_inst;
if (expr.inner != null && !expr.inner.is_pure ()) {
// instance expression has side-effects
......@@ -98,7 +92,7 @@ public class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
if (expr.value_type is ArrayType && !(expr.parent_node is ElementAccess)) {
Report.error (expr.source_reference, "unsupported use of length field of multi-dimensional array");
}
expr.ccodenode = head.get_array_length_cexpression (expr.inner, 1);
expr.ccodenode = get_array_length_cexpression (expr.inner, 1);
} else if (expr.symbol_reference is Field) {
var f = (Field) expr.symbol_reference;
if (f.binding == MemberBinding.INSTANCE) {
......@@ -249,7 +243,7 @@ public class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
}
string getter_cname;
if (prop is DynamicProperty) {
getter_cname = head.get_dynamic_property_getter_cname ((DynamicProperty) prop);
getter_cname = get_dynamic_property_getter_cname ((DynamicProperty) prop);
} else {
getter_cname = base_property.get_accessor.get_cname ();
}
......
......@@ -25,10 +25,6 @@
using GLib;
public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
public CCodeMethodCallModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
public override void visit_method_call (MethodCall expr) {
// the bare function call
var ccall = new CCodeFunctionCall ((CCodeExpression) expr.call.ccodenode);
......@@ -282,9 +278,9 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
param_nr++;