[vala/emitlocal: 6/8] codegen: Use create_temp_value in visit_cast_expression



commit 521232fd62bf7b94508e2673bb24d4111958af8a
Author: Luca Bruno <lucabru src gnome org>
Date:   Sat Jun 11 12:09:11 2011 +0200

    codegen: Use create_temp_value in visit_cast_expression

 codegen/valaccodebasemodule.vala |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 6dc12d0..ce1cae4 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -4575,11 +4575,10 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 		if (context.profile == Profile.GOBJECT && (iface != null || (cl != null && !cl.is_compact))) {
 			// checked cast for strict subtypes of GTypeInstance
 			if (expr.is_silent_cast) {
-				var temp_decl = get_temp_variable (expr.inner.value_type, expr.inner.value_type.value_owned, expr, false);
-				emit_temp_var (temp_decl);
-				var ctemp = get_variable_cexpression (temp_decl.name);
+				var temp_value = create_temp_value (expr.inner.value_type, false, expr);
+				var ctemp = get_cvalue_ (temp_value);
 
-				ccode.add_assignment (ctemp, get_cvalue (expr.inner));
+				store_value (temp_value, expr.inner.target_value);
 				var ccheck = create_type_check (ctemp, expr.type_reference);
 				var ccast = new CCodeCastExpression (ctemp, expr.type_reference.get_cname ());
 				var cnull = new CCodeConstant ("NULL");



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