[vala/staging] codegen: Don't use temp variable for stack allocated simple type assignment
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] codegen: Don't use temp variable for stack allocated simple type assignment
- Date: Thu, 22 Nov 2018 14:15:13 +0000 (UTC)
commit 32ffc862417be39d42a1b8eeb3d0748b3e138aff
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Nov 22 14:58:34 2018 +0100
codegen: Don't use temp variable for stack allocated simple type assignment
codegen/valaccodememberaccessmodule.vala | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala
index faf4545c9..06a4d2bb4 100644
--- a/codegen/valaccodememberaccessmodule.vala
+++ b/codegen/valaccodememberaccessmodule.vala
@@ -765,6 +765,10 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
// except for structs that are always passed by reference
use_temp = false;
}
+ if (result.value_type.is_non_null_simple_type ()) {
+ // no need to an extra copy of variables that are stack allocated simple types
+ use_temp = false;
+ }
var local = variable as LocalVariable;
if (local != null && local.name[0] == '.') {
// already a temporary variable generated internally
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]