[vala/emit-j: 1/2] codegen: Use temporary variable for string concatenation
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/emit-j: 1/2] codegen: Use temporary variable for string concatenation
- Date: Wed, 16 Feb 2011 15:06:12 +0000 (UTC)
commit d3fe0a0aa08f2479399bace3720c54b6afcf4372
Author: Jürg Billeter <j bitron ch>
Date: Wed Feb 16 13:22:12 2011 +0100
codegen: Use temporary variable for string concatenation
codegen/valaccodebasemodule.vala | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index e36b507..bc8604e 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -4994,11 +4994,17 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
set_cvalue (expr, strcat);
} else {
// convert to g_strconcat (a, b, NULL)
+ var temp_var = get_temp_variable (expr.value_type, true, null, false);
+ var temp_ref = get_variable_cexpression (temp_var.name);
+ emit_temp_var (temp_var);
+
var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_strconcat"));
ccall.add_argument (cleft);
ccall.add_argument (cright);
ccall.add_argument (new CCodeConstant("NULL"));
- set_cvalue (expr, ccall);
+
+ ccode.add_assignment (temp_ref, ccall);
+ set_cvalue (expr, temp_ref);
}
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]